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
7 changes: 7 additions & 0 deletions client/CDocSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,13 @@ DDNetworkBackend::fetchKey(std::vector<uint8_t> &result, const std::string &url,
e.exec();

if(reply->error() != QNetworkReply::NoError && reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() != 201) {
if (backend.get()->status != QCryptoBackend::PinOK) {
// The actual error was in QCryptoBackend
libcdoc::result_t lresult = getDecryptStatus(backend.get()->status);
last_error = getLastErrorStr(lresult);
return lresult;
}
// Probably network problem
last_error = reply->errorString().toStdString();
return BACKEND_ERROR;
}
Expand Down
5 changes: 4 additions & 1 deletion client/CryptoDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,11 @@ bool CryptoDoc::decrypt(const libcdoc::Lock *lock, const QByteArray& secret)
case DDCryptoBackend::IN_PROGRESS:
str = QCryptoBackend::errorString(QCryptoBackend::Status::InProgress);
break;
case DDCryptoBackend::BACKEND_ERROR:
str = QCryptoBackend::errorString(QCryptoBackend::Status::GeneralError);
break;
default:
str = tr("Please check your internet connection and network settings.");
str = tr("General decryption error. Neither the card reader not network layer did not give more information. Please check your internet connection, network settings and card reader. On some readers it may also indicate the wrong pin code or locked card.");
break;
}
WarningDialog::create()
Expand Down
6 changes: 3 additions & 3 deletions client/QCryptoBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ QString QCryptoBackend::errorString(Status error)
case PinCanceled: return QCoreApplication::translate("QCryptoBackend", "PIN entry canceled");
case PinLocked: return QCoreApplication::translate("QCryptoBackend", "PIN locked");
case PinIncorrect: return QCoreApplication::translate("QCryptoBackend", "PIN incorrect");
case InProgress: return QCoreApplication::translate("QCryptoBackend", "Signing/decrypting is already in progress another window.");
case GeneralError: return QCoreApplication::translate("QCryptoBackend", "PKCS11 general error");
case DeviceError: return QCoreApplication::translate("QCryptoBackend", "PKCS11 device error");
case InProgress: return QCoreApplication::translate("QCryptoBackend", "Signing/decrypting is already in progress in another window.");
case GeneralError: return QCoreApplication::translate("QCryptoBackend", "Error in smart card driver, reader or the card. On some readers it may indicate the wrong pin code or locked card.");
case DeviceError: return QCoreApplication::translate("QCryptoBackend", "Error in smart card driver, reader or the card. On some readers it may indicate the wrong pin code or locked card.");
default: return QCoreApplication::translate("QCryptoBackend", "Unknown error");
}
}
Expand Down
32 changes: 26 additions & 6 deletions client/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,11 @@
</message>
<message>
<source>You are about to delete the last file in the container</source>
<translation>You are about to delete the last file in the container</translation>
<translation type="vanished">You are about to delete the last file in the container</translation>
</message>
<message>
<source>It is removed along with the container.</source>
<translation>It is removed along with the container.</translation>
<translation type="vanished">It is removed along with the container.</translation>
</message>
<message>
<source>In order to view Validity Confirmation Sheet there has to be at least one printer installed!</source>
Expand Down Expand Up @@ -610,7 +610,7 @@
</message>
<message>
<source>Key transfer server is not configured</source>
<translation type="unfinished"></translation>
<translation>Key transfer server is not configured</translation>
</message>
<message>
<source>Failed to remove key</source>
Expand All @@ -636,6 +636,10 @@
<source>Cannot read file.</source>
<translation>Cannot read file.</translation>
</message>
<message>
<source>General decryption error. Neither the card reader not network layer did not give more information. Please check your internet connection, network settings and card reader. On some readers it may also indicate the wrong pin code or locked card.</source>
<translation>General decryption error. Neither the card reader not network layer did not give more information. Please check your internet connection, network settings and card reader. On some readers it may also indicate the wrong pin code or locked card.</translation>
</message>
</context>
<context>
<name>Diagnostics</name>
Expand Down Expand Up @@ -2166,15 +2170,15 @@ ID-Card</translation>
</message>
<message>
<source>Signing/decrypting is already in progress another window.</source>
<translation>Signing/decrypting is already in progress another window.</translation>
<translation type="vanished">Signing/decrypting is already in progress another window.</translation>
</message>
<message>
<source>PKCS11 general error</source>
<translation>PKCS11 general error</translation>
<translation type="vanished">PKCS11 general error</translation>
</message>
<message>
<source>PKCS11 device error</source>
<translation>PKCS11 device error</translation>
<translation type="vanished">PKCS11 device error</translation>
</message>
<message>
<source>Unknown error</source>
Expand All @@ -2188,6 +2192,14 @@ ID-Card</translation>
<source>PIN entry canceled</source>
<translation>PIN entry canceled</translation>
</message>
<message>
<source>Signing/decrypting is already in progress in another window.</source>
<translation>Signing/decrypting is already in progress in another window.</translation>
</message>
<message>
<source>Error in smart card driver, reader or the card. On some readers it may indicate the wrong pin code or locked card.</source>
<translation>Error in smart card driver, reader or the card. On some readers it may indicate the wrong pin code or locked card.</translation>
</message>
</context>
<context>
<name>QFileDialog</name>
Expand Down Expand Up @@ -3083,6 +3095,14 @@ Additional licenses and components</translation>
<source>Remove</source>
<translation>Remove</translation>
</message>
<message>
<source>You are about to delete the last file in the container</source>
<translation type="unfinished">You are about to delete the last file in the container</translation>
</message>
<message>
<source>It is removed along with the container.</source>
<translation type="unfinished">It is removed along with the container.</translation>
</message>
</context>
<context>
<name>WarningItem</name>
Expand Down
30 changes: 25 additions & 5 deletions client/translations/et.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,11 @@
</message>
<message>
<source>You are about to delete the last file in the container</source>
<translation>Oled kustutamas viimast faili ümbrikus</translation>
<translation type="vanished">Oled kustutamas viimast faili ümbrikus</translation>
</message>
<message>
<source>It is removed along with the container.</source>
<translation>Koos sellega eemaldatakse ka ümbrik.</translation>
<translation type="vanished">Koos sellega eemaldatakse ka ümbrik.</translation>
</message>
<message>
<source>In order to view Validity Confirmation Sheet there has to be at least one printer installed!</source>
Expand Down Expand Up @@ -636,6 +636,10 @@
<source>Cannot read file.</source>
<translation>Faili ei saa lugeda.</translation>
</message>
<message>
<source>General decryption error. Neither the card reader not network layer did not give more information. Please check your internet connection, network settings and card reader. On some readers it may also indicate the wrong pin code or locked card.</source>
<translation>Täpsustamata dekrüpteerimise viga. Ei kaardilugeja ega võrguühendus ei andnud täpsemat informatsiooni. Kontrollige internetiühendust, võrgu sätteid ja kaardilugejat. Mõne lugeja korral võib põhjuseks olla ka vale pin või lukustatud kaart.</translation>
</message>
</context>
<context>
<name>Diagnostics</name>
Expand Down Expand Up @@ -2166,15 +2170,15 @@ ID-kaardiga</translation>
</message>
<message>
<source>Signing/decrypting is already in progress another window.</source>
<translation>Allkirjastamine/dekrüpteerimine on juba käimas teises aknas.</translation>
<translation type="vanished">Allkirjastamine/dekrüpteerimine on juba käimas teises aknas.</translation>
</message>
<message>
<source>PKCS11 general error</source>
<translation>PKCS11 üldine viga</translation>
<translation type="vanished">PKCS11 üldine viga</translation>
</message>
<message>
<source>PKCS11 device error</source>
<translation>PKCS11 seadme viga</translation>
<translation type="vanished">PKCS11 seadme viga</translation>
</message>
<message>
<source>Unknown error</source>
Expand All @@ -2188,6 +2192,14 @@ ID-kaardiga</translation>
<source>PIN entry canceled</source>
<translation>PIN sisestus katkestatus</translation>
</message>
<message>
<source>Signing/decrypting is already in progress in another window.</source>
<translation>Allkirjastamine/dekrüpteerimine juba toimub teises aknas.</translation>
</message>
<message>
<source>Error in smart card driver, reader or the card. On some readers it may indicate the wrong pin code or locked card.</source>
<translation>Viga kiipkaardi draiveris, lugejas või kaardis. Osade draiverite korral võib see tähendada ka lihtsalt vale PIN-i või lukus kaarti.</translation>
</message>
</context>
<context>
<name>QFileDialog</name>
Expand Down Expand Up @@ -3083,6 +3095,14 @@ Täiendavad litsentsid ja komponendid</translation>
<source>Remove</source>
<translation>Eemalda</translation>
</message>
<message>
<source>You are about to delete the last file in the container</source>
<translation type="unfinished">Oled kustutamas viimast faili ümbrikus</translation>
</message>
<message>
<source>It is removed along with the container.</source>
<translation type="unfinished">Koos sellega eemaldatakse ka ümbrik.</translation>
</message>
</context>
<context>
<name>WarningItem</name>
Expand Down
Loading