mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-12-18 05:12:16 -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;
|
this.mSignatureAvailable = signatureAvailable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isValidSignature() {
|
||||||
|
return mValidSignature;
|
||||||
|
}
|
||||||
|
|
||||||
public OpenPgpSignatureResult build() {
|
public OpenPgpSignatureResult build() {
|
||||||
if (mSignatureAvailable) {
|
if (mSignatureAvailable) {
|
||||||
OpenPgpSignatureResult result = new OpenPgpSignatureResult();
|
OpenPgpSignatureResult result = new OpenPgpSignatureResult();
|
||||||
|
@ -535,10 +535,14 @@ public class PgpDecryptVerify {
|
|||||||
} else {
|
} else {
|
||||||
// no integrity check
|
// no integrity check
|
||||||
Log.d(Constants.TAG, "Encrypted data was not integrity protected! MDC packet is missing!");
|
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!
|
// Handle missing integrity protection like failed integrity protection!
|
||||||
// The MDC packet can be stripped by an attacker!
|
// The MDC packet can be stripped by an attacker!
|
||||||
|
if (!signatureResultBuilder.isValidSignature()) {
|
||||||
throw new IntegrityCheckFailedException();
|
throw new IntegrityCheckFailedException();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
updateProgress(R.string.progress_done, 100, 100);
|
updateProgress(R.string.progress_done, 100, 100);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user