Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 19 additions & 25 deletions client/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,39 +668,33 @@ void MainWindow::updateMyEid(const QSmartCardData &data)
bool pin1Blocked = data.retryCount(QSmartCardData::Pin1Type) == 0;
bool pin2Blocked = data.retryCount(QSmartCardData::Pin2Type) == 0;
bool pukBlocked = data.retryCount(QSmartCardData::PukType) == 0;
bool pin1Locked = data.pinLocked(QSmartCardData::Pin1Type);
bool pin2Locked = data.pinLocked(QSmartCardData::Pin2Type);
bool isPUKReplacable = data.isPUKReplacable();
ui->myEid->warningIcon(
pin1Blocked || pin1Locked ||
pin1Blocked ||
pin2Blocked || pin2Locked ||
pukBlocked);
ui->signContainerPage->cardChanged(data.signCert(), pin2Blocked || pin2Locked);
ui->cryptoContainerPage->cardChanged(data.authCert(), pin1Blocked || pin1Locked);
ui->cryptoContainerPage->cardChanged(data.authCert(), pin1Blocked);

using enum WarningText::WarningType;
if(pin1Locked)
ui->warnings->showWarning({LockedCardWarning});
else
{
if(pin1Blocked && pukBlocked)
ui->warnings->showWarning({isPUKReplacable ? Pin1PukBlockedResetWarning : Pin1PukBlockedWarning});
else if(pin1Blocked)
ui->warnings->showWarning({UnblockPin1Warning, 0,
[this]{ changePinClicked(QSmartCardData::Pin1Type, QSmartCard::UnblockWithPuk); }});

if(pin2Locked && pin2Blocked)
ui->warnings->showWarning({ActivatePin2WithPUKWarning, 0,
[this]{ changePinClicked(QSmartCardData::Pin2Type, QSmartCard::ActivateWithPuk); }});
else if(pin2Blocked && pukBlocked)
ui->warnings->showWarning({isPUKReplacable ? Pin2PukBlockedResetWarning : Pin2PukBlockedWarning});
else if(pin2Blocked)
ui->warnings->showWarning({UnblockPin2Warning, 0,
[this]{ changePinClicked(QSmartCardData::Pin2Type, QSmartCard::UnblockWithPuk); }});
else if(pin2Locked)
ui->warnings->showWarning({ActivatePin2Warning, 0,
[this]{ changePinClicked(QSmartCardData::Pin2Type, QSmartCard::ActivateWithPin); }});
}
if(pin1Blocked && pukBlocked)
ui->warnings->showWarning({isPUKReplacable ? Pin1PukBlockedResetWarning : Pin1PukBlockedWarning});
else if(pin1Blocked)
ui->warnings->showWarning({UnblockPin1Warning, 0,
[this]{ changePinClicked(QSmartCardData::Pin1Type, QSmartCard::UnblockWithPuk); }});

if(pin2Locked && pin2Blocked)
ui->warnings->showWarning({UnblockPin2Warning, 0,
[this]{ changePinClicked(QSmartCardData::Pin2Type, QSmartCard::ActivateWithPuk); }});
else if(pin2Blocked && pukBlocked)
ui->warnings->showWarning({isPUKReplacable ? Pin2PukBlockedResetWarning : Pin2PukBlockedWarning});
else if(pin2Blocked)
ui->warnings->showWarning({UnblockPin2Warning, 0,
[this]{ changePinClicked(QSmartCardData::Pin2Type, QSmartCard::UnblockWithPuk); }});
else if(pin2Locked)
ui->warnings->showWarning({ActivatePin2Warning, 0,
[this]{ changePinClicked(QSmartCardData::Pin2Type, QSmartCard::ActivateWithPin); }});

const qint64 DAY = 24 * 60 * 60;
qint64 expiresIn = 106 * DAY;
Expand Down
20 changes: 0 additions & 20 deletions client/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3032,14 +3032,6 @@ Additional licenses and components</translation>
<source>Please check your internet connection.</source>
<translation>Please check your internet connection.</translation>
</message>
<message>
<source>The ID-card must be activated in order to authenticate</source>
<translation>The ID-card must be activated in order to authenticate</translation>
</message>
<message>
<source>The ID-card must be activated in order to sign</source>
<translation>The ID-card must be activated in order to sign</translation>
</message>
<message>
<source>PIN%1 has been blocked because PIN%1 code has been entered incorrectly 3 times.</source>
<translation>PIN%1 has been blocked because PIN%1 code has been entered incorrectly 3 times.</translation>
Expand Down Expand Up @@ -3162,18 +3154,6 @@ Additional licenses and components</translation>
<source>https://www.id.ee/en/article/changing-id-card-pin-codes-and-puk-code/</source>
<translation>https://www.id.ee/en/article/changing-id-card-pin-codes-and-puk-code/</translation>
</message>
<message>
<source>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it.</source>
<translation>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it.</translation>
</message>
<message>
<source>Activate ID-card</source>
<translation>Activate ID-card</translation>
</message>
<message>
<source>https://www.politsei.ee/en/self-service-portal/</source>
<translation>https://www.politsei.ee/en/self-service-portal/</translation>
</message>
<message>
<source>This ASiC-S container contains XAdES signature. You are not allowed to add or remove signatures to this container.</source>
<translation>This ASiC-S container contains XAdES signature. You are not allowed to add or remove signatures to this container.</translation>
Expand Down
20 changes: 0 additions & 20 deletions client/translations/et.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2948,14 +2948,6 @@ Täiendavad litsentsid ja komponendid</translation>
<source>Change with PUK code</source>
<translation>Muuda PUK-koodiga</translation>
</message>
<message>
<source>The ID-card must be activated in order to authenticate</source>
<translation>Autentimiseks tuleb ID-kaart aktiveerida</translation>
</message>
<message>
<source>The ID-card must be activated in order to sign</source>
<translation>Allkirjastamiseks tuleb ID-kaart aktiveerida</translation>
</message>
<message>
<source>PIN%1 code must be changed in order to authenticate</source>
<translation>Autentimiseks tuleb PIN%1-koodi muuta</translation>
Expand Down Expand Up @@ -3162,18 +3154,6 @@ Täiendavad litsentsid ja komponendid</translation>
<source>https://www.id.ee/en/article/changing-id-card-pin-codes-and-puk-code/</source>
<translation>https://www.id.ee/artikkel/id-kaardi-pin-ja-puk-koodide-muutmine/</translation>
</message>
<message>
<source>Authentication and signing with the ID-card isn&apos;t possible yet. ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it.</source>
<translation>ID-kaardiga isikutuvastamine ja allkirjastamine ei ole veel võimalik. ID-kaardi kasutamiseks tuleb see aktiveerida Politsei- ja Piirivalveameti iseteeninduses.</translation>
</message>
<message>
<source>Activate ID-card</source>
<translation>Aktiveeri ID-kaart</translation>
</message>
<message>
<source>https://www.politsei.ee/en/self-service-portal/</source>
<translation>https://www.politsei.ee/et/iseteenindus/</translation>
</message>
<message>
<source>This ASiC-S container contains XAdES signature. You are not allowed to add or remove signatures to this container.</source>
<translation>Tegemist on XAdES allkirja sisaldava ASiC-S ümbrikuga. Sellele ümbrikule ei saa allkirja lisada ega eemaldada.</translation>
Expand Down
13 changes: 2 additions & 11 deletions client/widgets/VerifyCert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ void VerifyCert::update()
{
if(cardData.isNull() && c.isNull())
return clear();
bool isLockedCard = !cardData.isNull() && cardData.pinLocked(QSmartCardData::Pin1Type);
bool isLockedPin = !cardData.isNull() && pinType == QSmartCardData::Pin2Type && cardData.pinLocked(pinType);
bool isBlockedPin = !cardData.isNull() && cardData.retryCount(pinType) == 0;
bool isBlockedPuk = !cardData.isNull() && cardData.retryCount(QSmartCardData::PukType) == 0;
Expand Down Expand Up @@ -198,21 +197,13 @@ void VerifyCert::update()

ui->changePIN->setText(tr("Change PIN%1").arg(pinType));
ui->forgotPinLink->setText(tr("Change with PUK code"));
ui->changePIN->setHidden(isLockedCard || (isBlockedPin && isBlockedPuk) || isTempelType);
ui->changePIN->setHidden((isBlockedPin && isBlockedPuk) || isTempelType);

if(isTempelType)
{
ui->info->setLabel({});
ui->info->setText(tr("PIN can be changed only using eToken utility"));
}
else if(isLockedCard)
{
icon = QStringLiteral(":/images/icon_alert_large_warning.svg");
ui->info->setLabel(QStringLiteral("warning"));
ui->info->setText(pinType == QSmartCardData::Pin1Type ?
tr("The ID-card must be activated in order to authenticate") :
tr("The ID-card must be activated in order to sign"));
}
else if(isBlockedPin)
{
ui->changePIN->setText(tr("Unblock"));
Expand Down Expand Up @@ -242,7 +233,7 @@ void VerifyCert::update()

ui->links->setHidden(pinType == QSmartCardData::PukType && ui->changePIN->isHidden());
ui->details->setHidden(pinType == QSmartCardData::PukType);
ui->forgotPinLink->setHidden(pinType == QSmartCardData::PukType || isLockedCard || isBlockedPin || isBlockedPuk || isTempelType);
ui->forgotPinLink->setHidden(pinType == QSmartCardData::PukType || isBlockedPin || isBlockedPuk || isTempelType);
ui->checkCert->setHidden(pinType == QSmartCardData::PukType || isInvalidCert);
}

Expand Down
9 changes: 0 additions & 9 deletions client/widgets/WarningItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,13 @@ void WarningItem::lookupWarning()
url = tr("https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/");
_page = MyEid;
break;
case ActivatePin1WithPUKWarning:
case UnblockPin1Warning:
ui->warningText->setText(QStringLiteral("%1 %2").arg(
VerifyCert::tr("PIN%1 has been blocked because PIN%1 code has been entered incorrectly 3 times.").arg(1),
VerifyCert::tr("Unblock to reuse PIN%1.").arg(1)));
ui->warningAction->setText(VerifyCert::tr("Unblock"));
_page = MyEid;
break;
case ActivatePin2WithPUKWarning:
case UnblockPin2Warning:
ui->warningText->setText(QStringLiteral("%1 %2").arg(
VerifyCert::tr("PIN%1 has been blocked because PIN%1 code has been entered incorrectly 3 times.").arg(2),
Expand All @@ -127,13 +125,6 @@ void WarningItem::lookupWarning()
url = tr("https://www.id.ee/en/article/changing-id-card-pin-codes-and-puk-code/");
_page = MyEid;
break;
case LockedCardWarning:
ui->warningText->setText(tr("Authentication and signing with the ID-card isn't possible yet. "
"ID-card must be activated in the Police and Border Guard Board’s self-service portal in order to use it."));
ui->warningAction->setText(tr("Activate ID-card"));
url = tr("https://www.politsei.ee/en/self-service-portal/");
_page = MyEid;
break;
// SignDetails
case InvalidSignatureError:
setObjectName("WarningItemError");
Expand Down
3 changes: 0 additions & 3 deletions client/widgets/WarningItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ struct WarningText {
UnblockPin1Warning,
UnblockPin2Warning,
ActivatePin2Warning,
ActivatePin1WithPUKWarning,
ActivatePin2WithPUKWarning,
LockedCardWarning,

InvalidSignatureError,
InvalidTimestampError,
Expand Down
Loading