mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-13 04:25:00 -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,9 +535,13 @@ 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!
|
||||||
throw new IntegrityCheckFailedException();
|
if (!signatureResultBuilder.isValidSignature()) {
|
||||||
|
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