mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-11 03:25:05 -05:00
Handle missing MDC as failed only if no valid signature is present
This commit is contained in:
parent
33a4d68520
commit
13f86890d6
@ -65,6 +65,10 @@ public class OpenPgpSignatureResultBuilder {
|
||||
this.mSignatureAvailable = signatureAvailable;
|
||||
}
|
||||
|
||||
public boolean isValidSignature() {
|
||||
return mValidSignature;
|
||||
}
|
||||
|
||||
public OpenPgpSignatureResult build() {
|
||||
if (mSignatureAvailable) {
|
||||
OpenPgpSignatureResult result = new OpenPgpSignatureResult();
|
||||
|
@ -535,9 +535,13 @@ public class PgpDecryptVerify {
|
||||
} else {
|
||||
// no integrity check
|
||||
Log.d(Constants.TAG, "Encrypted data was not integrity protected! MDC packet is missing!");
|
||||
|
||||
// If no valid signature is present:
|
||||
// Handle missing integrity protection like failed integrity protection!
|
||||
// The MDC packet can be stripped by an attacker!
|
||||
throw new IntegrityCheckFailedException();
|
||||
if (!signatureResultBuilder.isValidSignature()) {
|
||||
throw new IntegrityCheckFailedException();
|
||||
}
|
||||
}
|
||||
|
||||
updateProgress(R.string.progress_done, 100, 100);
|
||||
|
Loading…
Reference in New Issue
Block a user