Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d2de3b1 authored by alexandre's avatar alexandre Committed by cketti
Browse files

Errors on decryption were not handled #588

parent 2bec5efe
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ public class OpenPgpHeaderView extends LinearLayout {
        if (error == null) {
            text = context.getString(R.string.openpgp_unknown_error);
        } else {
            text = context.getString(R.string.openpgp_error, error.getMessage());
            text = context.getString(R.string.openpgp_decryption_failed, error.getMessage());
        }
        resultEncryptionText.setText(text);
    }
@@ -160,6 +160,9 @@ public class OpenPgpHeaderView extends LinearLayout {

        switch (cryptoAnnotation.getErrorType()) {
            case CRYPTO_API_RETURNED_ERROR:
                displayEncryptionError();
                dontDisplayVerification();
                break;
            case NONE: {
                displayVerificationResult();
                break;
@@ -171,6 +174,11 @@ public class OpenPgpHeaderView extends LinearLayout {
            }
        }
    }
    private void dontDisplayVerification(){
        hideSignatureLayout();
        resultSignatureText.setVisibility(View.GONE);
        resultSignatureIcon.setVisibility(View.GONE);
    }

    private void displayIncompleteSignedPart() {
        setSignatureImageAndTextColor(CryptoState.UNAVAILABLE);
+1 −1
Original line number Diff line number Diff line
@@ -1123,7 +1123,7 @@ Please submit bug reports, contribute new features and ask questions at
    <string name="openpgp_successful_decryption_valid_signature_uncertified">Successful decryption and valid signature but uncertified</string>
    <string name="openpgp_successful_decryption_unknown_signature">Successful decryption but missing public key</string>
    <string name="openpgp_get_key">Lookup missing key</string>
    <string name="openpgp_error">OpenPGP Error: %s</string>
    <string name="openpgp_decryption_failed">Decryption failed: %s</string>
    <string name="openpgp_unknown_error">Unknown OpenPGP Error</string>
    <string name="openpgp_user_id">User Id</string>
    <string name="openpgp_canceled_by_user">Canceled by user</string>