use available methods for structure detection
This commit is contained in:
parent
57a5d96173
commit
ac628a265d
2 changed files with 4 additions and 5 deletions
|
@ -233,7 +233,7 @@ public class MessageCryptoStructureDetector {
|
|||
return dataUnavailable || protocolMatches;
|
||||
}
|
||||
|
||||
private static boolean isPartMultipartEncrypted(Part part) {
|
||||
public static boolean isPartMultipartEncrypted(Part part) {
|
||||
if (!isSameMimeType(part.getMimeType(), MULTIPART_ENCRYPTED)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -83,10 +83,9 @@ public class MessageViewInfoExtractor {
|
|||
return extractSimpleMessageForView(message, message);
|
||||
}
|
||||
|
||||
boolean isOpenPgpEncrypted =
|
||||
MimeUtility.isSameMimeType(cryptoContentPart.getMimeType(), "multipart/encrypted") &&
|
||||
MimeUtility.isSameMimeType(getHeaderParameter(cryptoContentPart.getContentType(), "protocol"),
|
||||
"application/pgp-encrypted");
|
||||
boolean isOpenPgpEncrypted = (MessageCryptoStructureDetector.isPartMultipartEncrypted(cryptoContentPart) &&
|
||||
MessageCryptoStructureDetector.isMultipartEncryptedOpenPgpProtocol(cryptoContentPart)) ||
|
||||
MessageCryptoStructureDetector.isPartPgpInlineEncrypted(cryptoContentPart);
|
||||
if (!K9.isOpenPgpProviderConfigured() && isOpenPgpEncrypted) {
|
||||
CryptoResultAnnotation noProviderAnnotation = CryptoResultAnnotation.createErrorAnnotation(
|
||||
CryptoError.OPENPGP_ENCRYPTED_NO_PROVIDER, null);
|
||||
|
|
Loading…
Reference in a new issue