@@ -704,12 +704,14 @@ void MainWindow::updateMyEid(const QSmartCardData &data)
704704 return ;
705705 bool pin1Blocked = data.retryCount (QSmartCardData::Pin1Type) == 0 ;
706706 bool pin2Blocked = data.retryCount (QSmartCardData::Pin2Type) == 0 ;
707+ bool pukBlocked = data.retryCount (QSmartCardData::PukType) == 0 ;
707708 bool pin1Locked = data.pinLocked (QSmartCardData::Pin1Type);
708709 bool pin2Locked = data.pinLocked (QSmartCardData::Pin2Type);
710+ bool isPUKReplacable = data.isPUKReplacable ();
709711 ui->myEid ->warningIcon (
710712 pin1Blocked || pin1Locked ||
711713 pin2Blocked || pin2Locked ||
712- data. retryCount (QSmartCardData::PukType) == 0 );
714+ pukBlocked );
713715 ui->signContainerPage ->cardChanged (data.signCert (), pin2Blocked || pin2Locked);
714716 ui->cryptoContainerPage ->cardChanged (data.authCert (), pin1Blocked || pin1Locked);
715717
@@ -718,13 +720,17 @@ void MainWindow::updateMyEid(const QSmartCardData &data)
718720 ui->warnings ->showWarning ({LockedCardWarning});
719721 else
720722 {
721- if (pin1Blocked)
723+ if (pin1Blocked && pukBlocked)
724+ ui->warnings ->showWarning ({isPUKReplacable ? Pin1PukBlockedResetWarning : Pin1PukBlockedWarning});
725+ else if (pin1Blocked)
722726 ui->warnings ->showWarning ({UnblockPin1Warning, 0 ,
723727 [this ]{ changePinClicked (QSmartCardData::Pin1Type, QSmartCard::UnblockWithPuk); }});
724728
725729 if (pin2Locked && pin2Blocked)
726730 ui->warnings ->showWarning ({ActivatePin2WithPUKWarning, 0 ,
727731 [this ]{ changePinClicked (QSmartCardData::Pin2Type, QSmartCard::ActivateWithPuk); }});
732+ else if (pin2Blocked && pukBlocked)
733+ ui->warnings ->showWarning ({isPUKReplacable ? Pin2PukBlockedResetWarning : Pin2PukBlockedWarning});
728734 else if (pin2Blocked)
729735 ui->warnings ->showWarning ({UnblockPin2Warning, 0 ,
730736 [this ]{ changePinClicked (QSmartCardData::Pin2Type, QSmartCard::UnblockWithPuk); }});
0 commit comments