File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
Yubico.YubiKey/src/Yubico/YubiKey/Piv Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -1347,7 +1347,33 @@ private ResponseStatus ChangePinOrPuk(KeyEntryData keyEntryData)
1347
1347
// If error, throws exception.
1348
1348
keyEntryData . RetriesRemaining = response . GetData ( ) ;
1349
1349
1350
- return response . Status ;
1350
+ var status = response . Status ;
1351
+ switch ( status )
1352
+ {
1353
+ case ResponseStatus . Success :
1354
+ Logger . LogInformation (
1355
+ slotNumber == PivSlot . Pin
1356
+ ? "The PIV PIN has been changed"
1357
+ : "The PIV PUK has been changed" ) ;
1358
+
1359
+ break ;
1360
+ case ResponseStatus . ConditionsNotSatisfied :
1361
+ Logger . LogWarning (
1362
+ slotNumber == PivSlot . Pin
1363
+ ? "The PIV PIN does not meet the complexity requirements"
1364
+ : "The PIV PUK does not meet the complexity requirements" ) ;
1365
+
1366
+ break ;
1367
+ default :
1368
+ Logger . LogError (
1369
+ slotNumber == PivSlot . Pin
1370
+ ? $ "The PIV PIN could not be changed. Reason: { response . StatusMessage } (0x{ response . StatusWord : X4} )"
1371
+ : $ "The PIV PUK could not be changed. Reason: { response . StatusMessage } (0x{ response . StatusWord : X4} )") ;
1372
+
1373
+ break ;
1374
+ }
1375
+
1376
+ return status ;
1351
1377
}
1352
1378
1353
1379
// This is a delegate that implements the CommandResponse declaration of
You can’t perform that action at this time.
0 commit comments