From 3f802431e3af120b4117d476946b996479c0194a Mon Sep 17 00:00:00 2001 From: DenBond7 Date: Tue, 7 Dec 2021 16:55:18 +0200 Subject: [PATCH 01/12] Added a workable version of signature verification(Not all cases).| #1097 --- ...nd7@flowcrypt.test_prv_strong_primary.asc} | 0 ...bond7@flowcrypt.test_prv_strong_second.asc | 17 ++ ...> denbond7@flowcrypt.test_pub_primary.asc} | 0 .../denbond7@flowcrypt.test_pub_second.asc | 13 + .../ui/activity/MessageDetailsActivityTest.kt | 2 +- .../api/email/model/IncomingMessageInfo.kt | 13 +- .../DecryptedAndOrSignedContentMsgBlock.kt | 53 ++++ .../api/retrofit/response/model/MsgBlock.kt | 16 +- .../response/model/VerificationResult.kt | 49 ++++ .../com/flowcrypt/email/core/msg/MimeUtils.kt | 3 +- .../jetpack/viewmodel/MsgDetailsViewModel.kt | 5 +- .../viewmodel/PgpSignatureHandlerViewModel.kt | 16 ++ .../email/security/pgp/PgpDecrypt.kt | 32 ++- .../flowcrypt/email/security/pgp/PgpMsg.kt | 258 ++++++++++++------ .../fragment/MessageDetailsFragment.kt | 51 ++++ .../email/ui/adapter/PgpBadgeListAdapter.kt | 89 ++++++ .../drawable/ic_bad_signature_white_16.xml | 21 ++ .../ic_baseline_report_gmailerrorred_24.xml | 21 ++ .../drawable/ic_encrypted_badge_white_16.xml | 15 + .../ic_not_encrypted_badge_white_16.xml | 15 + .../res/drawable/ic_not_signed_white_16.xml | 15 + .../main/res/drawable/ic_signed_white_16.xml | 18 ++ .../drawable/ic_signing_warning_white_16.xml | 15 + .../ic_verifying_signature_white_16.xml | 18 ++ .../res/layout/fragment_message_details.xml | 47 ++-- .../src/main/res/layout/item_pgp_badge.xml | 38 +++ FlowCrypt/src/main/res/values/strings.xml | 10 + .../email/security/pgp/PgpMsgTest.kt | 29 +- docker-mailserver/docker-compose.yml | 2 +- .../default/dovecot.list.index.log | Bin 376 -> 1180 bytes .../Drafts/dbox-Mails/dovecot.index.log | Bin 368 -> 368 bytes .../INBOX/dbox-Mails/dovecot.index.cache | Bin 18352 -> 25708 bytes .../INBOX/dbox-Mails/dovecot.index.log | Bin 11688 -> 14076 bytes .../default/mailboxes/INBOX/dbox-Mails/u.29 | 73 ++--- .../default/mailboxes/INBOX/dbox-Mails/u.31 | 42 +++ .../default/mailboxes/INBOX/dbox-Mails/u.32 | 47 ++++ .../default/mailboxes/INBOX/dbox-Mails/u.33 | 48 ++++ .../default/mailboxes/INBOX/dbox-Mails/u.34 | 43 +++ .../default/mailboxes/INBOX/dbox-Mails/u.35 | 59 ++++ .../default/mailboxes/INBOX/dbox-Mails/u.36 | 44 +++ .../default/mailboxes/INBOX/dbox-Mails/u.37 | 61 +++++ .../default/mailboxes/INBOX/dbox-Mails/u.38 | 51 ++++ .../Junk/dbox-Mails/dovecot.index.log | Bin 368 -> 368 bytes .../Sent/dbox-Mails/dovecot.index.cache | Bin 980 -> 1452 bytes .../Sent/dbox-Mails/dovecot.index.log | Bin 776 -> 832 bytes .../Trash/dbox-Mails/dovecot.index.cache | Bin 3332 -> 856 bytes .../Trash/dbox-Mails/dovecot.index.log | Bin 2408 -> 3032 bytes .../denbond7/dovecot.list.index | Bin 784 -> 784 bytes .../denbond7/dovecot.list.index.log | Bin 5048 -> 1896 bytes .../denbond7/dovecot.list.index.log.2 | Bin 8192 -> 8336 bytes .../Drafts/dbox-Mails/dovecot.index.log | Bin 384 -> 384 bytes .../INBOX/dbox-Mails/dovecot.index.cache | Bin 2272 -> 2272 bytes .../INBOX/dbox-Mails/dovecot.index.log | Bin 1096 -> 1096 bytes .../Junk/dbox-Mails/dovecot.index.log | Bin 384 -> 384 bytes .../mailboxes/Sent/dbox-Mails/dovecot.index | Bin 640 -> 640 bytes .../Sent/dbox-Mails/dovecot.index.cache | Bin 44 -> 21040 bytes .../Sent/dbox-Mails/dovecot.index.log | Bin 8196 -> 11024 bytes .../denbond7/mailboxes/Sent/dbox-Mails/u.27 | 67 ++--- .../denbond7/mailboxes/Sent/dbox-Mails/u.29 | 33 +++ .../denbond7/mailboxes/Sent/dbox-Mails/u.30 | 38 +++ .../denbond7/mailboxes/Sent/dbox-Mails/u.31 | 39 +++ .../denbond7/mailboxes/Sent/dbox-Mails/u.32 | 34 +++ .../denbond7/mailboxes/Sent/dbox-Mails/u.33 | 50 ++++ .../denbond7/mailboxes/Sent/dbox-Mails/u.34 | 35 +++ .../denbond7/mailboxes/Sent/dbox-Mails/u.35 | 52 ++++ .../denbond7/mailboxes/Sent/dbox-Mails/u.36 | 42 +++ .../Trash/dbox-Mails/dovecot.index.cache | Bin 3836 -> 880 bytes .../Trash/dbox-Mails/dovecot.index.log | Bin 2616 -> 3312 bytes .../INBOX/dbox-Mails/dovecot.index.log | Bin 1252 -> 1268 bytes .../dovecot.list.index.log | Bin 3280 -> 3584 bytes .../Drafts/dbox-Mails/dovecot.index.log | Bin 384 -> 400 bytes .../INBOX/dbox-Mails/dovecot.index.log | Bin 11800 -> 11816 bytes .../Junk/dbox-Mails/dovecot.index.log | Bin 384 -> 400 bytes .../Sent/dbox-Mails/dovecot.index.log | Bin 384 -> 400 bytes .../Trash/dbox-Mails/dovecot.index.log | Bin 384 -> 400 bytes 75 files changed, 1509 insertions(+), 230 deletions(-) rename FlowCrypt/src/androidTest/assets/pgp/{denbond7@flowcrypt.test_prv_strong.asc => denbond7@flowcrypt.test_prv_strong_primary.asc} (100%) create mode 100644 FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_prv_strong_second.asc rename FlowCrypt/src/androidTest/assets/pgp/{denbond7@flowcrypt.test_pub.asc => denbond7@flowcrypt.test_pub_primary.asc} (100%) create mode 100644 FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_pub_second.asc create mode 100644 FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/DecryptedAndOrSignedContentMsgBlock.kt create mode 100644 FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/VerificationResult.kt create mode 100644 FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/PgpSignatureHandlerViewModel.kt create mode 100644 FlowCrypt/src/main/java/com/flowcrypt/email/ui/adapter/PgpBadgeListAdapter.kt create mode 100644 FlowCrypt/src/main/res/drawable/ic_bad_signature_white_16.xml create mode 100644 FlowCrypt/src/main/res/drawable/ic_baseline_report_gmailerrorred_24.xml create mode 100644 FlowCrypt/src/main/res/drawable/ic_encrypted_badge_white_16.xml create mode 100644 FlowCrypt/src/main/res/drawable/ic_not_encrypted_badge_white_16.xml create mode 100644 FlowCrypt/src/main/res/drawable/ic_not_signed_white_16.xml create mode 100644 FlowCrypt/src/main/res/drawable/ic_signed_white_16.xml create mode 100644 FlowCrypt/src/main/res/drawable/ic_signing_warning_white_16.xml create mode 100644 FlowCrypt/src/main/res/drawable/ic_verifying_signature_white_16.xml create mode 100644 FlowCrypt/src/main/res/layout/item_pgp_badge.xml create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.31 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.32 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.33 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.34 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.35 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.36 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.37 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.38 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.29 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.30 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.31 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.32 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.33 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.34 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.35 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.36 diff --git a/FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_prv_strong.asc b/FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_prv_strong_primary.asc similarity index 100% rename from FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_prv_strong.asc rename to FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_prv_strong_primary.asc diff --git a/FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_prv_strong_second.asc b/FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_prv_strong_second.asc new file mode 100644 index 0000000000..af36b49b41 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_prv_strong_second.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP PRIVATE KEY BLOCK----- +Version: PGPainless + +lIYEYbXg9xYJKwYBBAHaRw8BAQdAjU9kv9cb0xfBXcXQrYUlqG2eiwGsohMYotN4 +CpAebUr+CQMCDH1gBMQ0PxVgYuhn3lmmt9BUJFB6AO/KkNvVOHswGdKYmfD8cIPH +yh57/11cO+uImNLQCJDvm88qCwYg5Bdd+UEa7nFhTwmHce9evrCfK7QXZGVuYm9u +ZDdAZmxvd2NyeXB0LnRlc3SIeAQTFgoAIAUCYbXg9wIbAwUWAgMBAAUVCgkICwQL +CQgHAh4BAhkBAAoJEIE/vu8WkLVTVH4A/1SwDUMznNrTPTAhZCCNTQGEP2fvlL7Y +hSZ+YQglVPeyAQCQOwW7Xo0nGzGunnPZfZK3oEMWo0yiWCHLRVkFlb3HCpyLBGG1 +4PcSCisGAQQBl1UBBQEBB0DHDqFonIH6bVQHdEI2zApC8FoB4Vus9DVwbseb9aUg +QAMBCAf+CQMCDH1gBMQ0PxVgOeMvXYhjqkQReahybagjEVVknNBPWbn8wWIwVVV9 +Q+s8gmFATu9C3DW9QFbqtwwyR7rp66qXVVcRCzcU3KqMThc56MK43Ih1BBgWCgAd +BQJhteD3AhsMBRYCAwEABRUKCQgLBAsJCAcCHgEACgkQgT++7xaQtVMmjQD+MFs1 +ll4eD+arY/6nBDD31Q60ZuU3Tz6V/2EwVQZBnVcA/RNlFaw+7GLxhtqQKOk0HsmE +4gcvw7Tug9ws/9TdBBMH +=2xMu +-----END PGP PRIVATE KEY BLOCK----- diff --git a/FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_pub.asc b/FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_pub_primary.asc similarity index 100% rename from FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_pub.asc rename to FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_pub_primary.asc diff --git a/FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_pub_second.asc b/FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_pub_second.asc new file mode 100644 index 0000000000..6aa5ce047f --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/pgp/denbond7@flowcrypt.test_pub_second.asc @@ -0,0 +1,13 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: PGPainless + +mDMEYbXg9xYJKwYBBAHaRw8BAQdAjU9kv9cb0xfBXcXQrYUlqG2eiwGsohMYotN4 +CpAebUq0F2RlbmJvbmQ3QGZsb3djcnlwdC50ZXN0iHgEExYKACAFAmG14PcCGwMF +FgIDAQAFFQoJCAsECwkIBwIeAQIZAQAKCRCBP77vFpC1U1R+AP9UsA1DM5za0z0w +IWQgjU0BhD9n75S+2IUmfmEIJVT3sgEAkDsFu16NJxsxrp5z2X2St6BDFqNMolgh +y0VZBZW9xwq4OARhteD3EgorBgEEAZdVAQUBAQdAxw6haJyB+m1UB3RCNswKQvBa +AeFbrPQ1cG7Hm/WlIEADAQgHiHUEGBYKAB0FAmG14PcCGwwFFgIDAQAFFQoJCAsE +CwkIBwIeAQAKCRCBP77vFpC1UyaNAP4wWzWWXh4P5qtj/qcEMPfVDrRm5TdPPpX/ +YTBVBkGdVwD9E2UVrD7sYvGG2pAo6TQeyYTiBy/DtO6D3Cz/1N0EEwc= +=WuSJ +-----END PGP PUBLIC KEY BLOCK----- diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt index 4275a31990..330450acf9 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt @@ -365,7 +365,7 @@ class MessageDetailsActivityTest : BaseMessageDetailsActivityTest() { baseCheckWithAtt(msgInfo, pubKeyAttInfo) val pgpKeyDetails = - PrivateKeysManager.getPgpKeyDetailsFromAssets("pgp/denbond7@flowcrypt.test_pub.asc") + PrivateKeysManager.getPgpKeyDetailsFromAssets("pgp/denbond7@flowcrypt.test_pub_primary.asc") val email = requireNotNull(pgpKeyDetails.getPrimaryInternetAddress()).address onView(withId(R.id.textViewKeyOwnerTemplate)).check( matches(withText(getResString(R.string.template_message_part_public_key_owner, email))) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/IncomingMessageInfo.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/IncomingMessageInfo.kt index 105f44ef1f..98e9f4d8ad 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/IncomingMessageInfo.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/model/IncomingMessageInfo.kt @@ -9,6 +9,7 @@ import android.os.Parcel import android.os.Parcelable import com.flowcrypt.email.api.retrofit.response.model.GenericMsgBlock import com.flowcrypt.email.api.retrofit.response.model.MsgBlock +import com.flowcrypt.email.api.retrofit.response.model.VerificationResult import com.flowcrypt.email.database.entity.MessageEntity import com.flowcrypt.email.model.MessageEncryptionType import java.util.Date @@ -30,7 +31,8 @@ data class IncomingMessageInfo constructor( var text: String? = null, var inlineSubject: String? = null, val msgBlocks: List<@JvmSuppressWildcards MsgBlock>? = null, - val encryptionType: MessageEncryptionType + val encryptionType: MessageEncryptionType, + val verificationResult: VerificationResult ) : Parcelable { fun getSubject(): String? = msgEntity.subject @@ -62,7 +64,7 @@ data class IncomingMessageInfo constructor( constructor( msgEntity: MessageEntity, text: String?, subject: String?, msgBlocks: List, - encryptionType: MessageEncryptionType + encryptionType: MessageEncryptionType, verificationResult: VerificationResult ) : this( msgEntity, null, @@ -70,7 +72,8 @@ data class IncomingMessageInfo constructor( text, subject, msgBlocks, - encryptionType + encryptionType, + verificationResult ) fun hasHtmlText(): Boolean { @@ -98,7 +101,8 @@ data class IncomingMessageInfo constructor( source.readString(), source.readString(), mutableListOf().apply { source.readTypedList(this, GenericMsgBlock.CREATOR) }, - source.readParcelable(MessageEncryptionType::class.java.classLoader)!! + source.readParcelable(MessageEncryptionType::class.java.classLoader)!!, + source.readParcelable(VerificationResult::class.java.classLoader)!! ) override fun describeContents() = 0 @@ -111,6 +115,7 @@ data class IncomingMessageInfo constructor( writeString(inlineSubject) writeTypedList(msgBlocks) writeParcelable(encryptionType, flags) + writeParcelable(verificationResult, flags) } companion object { diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/DecryptedAndOrSignedContentMsgBlock.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/DecryptedAndOrSignedContentMsgBlock.kt new file mode 100644 index 0000000000..1917925ac7 --- /dev/null +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/DecryptedAndOrSignedContentMsgBlock.kt @@ -0,0 +1,53 @@ +/* + * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com + * Contributors: DenBond7 + */ + +package com.flowcrypt.email.api.retrofit.response.model + +import android.os.Parcel +import android.os.Parcelable +import com.google.gson.annotations.Expose +import org.pgpainless.decryption_verification.OpenPgpMetadata + +/** + * @author Denis Bondarenko + * Date: 12/8/21 + * Time: 6:55 PM + * E-mail: DenBond7@gmail.com + */ +data class DecryptedAndOrSignedContentMsgBlock( + @Expose override val error: MsgBlockError? = null, + @Expose val blocks: List = listOf() +) : MsgBlock { + @Expose + override val content: String? = null + + @Expose + override val complete: Boolean = true + + @Expose + override val type: MsgBlock.Type = MsgBlock.Type.DECRYPTED_AND_OR_SIGNED_CONTENT + + var openPgpMetadata: OpenPgpMetadata? = null + + constructor(parcel: Parcel) : this( + parcel.readParcelable(MsgBlockError::class.java.classLoader), + mutableListOf().apply { parcel.readTypedList(this, GenericMsgBlock.CREATOR) } + ) + + override fun writeToParcel(parcel: Parcel, flags: Int) { + parcel.writeParcelable(error, flags) + parcel.writeList(blocks) + } + + override fun describeContents(): Int { + return 0 + } + + companion object CREATOR : Parcelable.Creator { + override fun createFromParcel(parcel: Parcel) = DecryptedAndOrSignedContentMsgBlock(parcel) + override fun newArray(size: Int): Array = + arrayOfNulls(size) + } +} diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/MsgBlock.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/MsgBlock.kt index 990d4e261d..0ec4444210 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/MsgBlock.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/MsgBlock.kt @@ -39,9 +39,6 @@ interface MsgBlock : Parcelable { @SerializedName("attestPacket") ATTEST_PACKET, - @SerializedName("cryptupVerification") - VERIFICATION, - @SerializedName("privateKey") PRIVATE_KEY, @@ -79,7 +76,10 @@ interface MsgBlock : Parcelable { SIGNED_HTML, @SerializedName("verifiedMsg") - VERIFIED_MSG; + VERIFIED_MSG, + + @SerializedName("decryptedAndOrSignedContent") + DECRYPTED_AND_OR_SIGNED_CONTENT; override fun describeContents(): Int { return 0 @@ -111,7 +111,13 @@ interface MsgBlock : Parcelable { val SIGNED_BLOCK_TYPES = setOf(SIGNED_TEXT, SIGNED_HTML, SIGNED_MSG) val CONTENT_BLOCK_TYPES = setOf( - PLAIN_TEXT, PLAIN_HTML, DECRYPTED_TEXT, DECRYPTED_HTML, SIGNED_MSG, VERIFIED_MSG + PLAIN_TEXT, + PLAIN_HTML, + DECRYPTED_TEXT, + DECRYPTED_HTML, + SIGNED_MSG, + VERIFIED_MSG, + DECRYPTED_AND_OR_SIGNED_CONTENT ) val DECRYPTED_CONTENT_BLOCK_TYPES = setOf( diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/VerificationResult.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/VerificationResult.kt new file mode 100644 index 0000000000..dd217727f8 --- /dev/null +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/VerificationResult.kt @@ -0,0 +1,49 @@ +/* + * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com + * Contributors: DenBond7 + */ + +package com.flowcrypt.email.api.retrofit.response.model + +import android.os.Parcel +import android.os.Parcelable +import com.google.gson.annotations.Expose + +/** + * @author Denis Bondarenko + * Date: 12/10/21 + * Time: 10:09 AM + * E-mail: DenBond7@gmail.com + */ +class VerificationResult( + @Expose val isEncrypted: Boolean, + @Expose val isSigned: Boolean, + @Expose val hasMixedSignatures: Boolean, + @Expose val isPartialSigned: Boolean, + @Expose val hasUnverifiedSignatures: Boolean, +) : Parcelable { + constructor(parcel: Parcel) : this( + parcel.readByte() != 0.toByte(), + parcel.readByte() != 0.toByte(), + parcel.readByte() != 0.toByte(), + parcel.readByte() != 0.toByte(), + parcel.readByte() != 0.toByte() + ) + + override fun writeToParcel(parcel: Parcel, flags: Int) { + parcel.writeByte(if (isEncrypted) 1 else 0) + parcel.writeByte(if (isSigned) 1 else 0) + parcel.writeByte(if (hasMixedSignatures) 1 else 0) + parcel.writeByte(if (isPartialSigned) 1 else 0) + parcel.writeByte(if (hasUnverifiedSignatures) 1 else 0) + } + + override fun describeContents(): Int { + return 0 + } + + companion object CREATOR : Parcelable.Creator { + override fun createFromParcel(parcel: Parcel) = VerificationResult(parcel) + override fun newArray(size: Int): Array = arrayOfNulls(size) + } +} diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/core/msg/MimeUtils.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/core/msg/MimeUtils.kt index 7e61465e07..6596df78fd 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/core/msg/MimeUtils.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/core/msg/MimeUtils.kt @@ -10,7 +10,6 @@ import com.flowcrypt.email.api.retrofit.response.model.MsgBlock import com.flowcrypt.email.api.retrofit.response.model.PlainAttMsgBlock import com.flowcrypt.email.extensions.kotlin.toInputStream import java.nio.charset.StandardCharsets -import java.util.Locale import java.util.Properties import javax.mail.Session import javax.mail.internet.MimeMessage @@ -20,7 +19,7 @@ object MimeUtils { if (msg == null) return false val firstChars = msg.copyOfRange(0, msg.size.coerceAtMost(1000)) .toString(StandardCharsets.US_ASCII) - .toLowerCase(Locale.ROOT) + .lowercase() val contentType = CONTENT_TYPE_REGEX.find(firstChars) ?: return false return CONTENT_TRANSFER_ENCODING_REGEX.containsMatchIn(firstChars) || CONTENT_DISPOSITION_REGEX.containsMatchIn(firstChars) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/MsgDetailsViewModel.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/MsgDetailsViewModel.kt index 4caba176c8..f78ce564dc 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/MsgDetailsViewModel.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/MsgDetailsViewModel.kt @@ -211,11 +211,12 @@ class MsgDetailsViewModel( text = processedMimeMessageResult.text, //subject = parseDecryptedMsgResult.subject, msgBlocks = processedMimeMessageResult.blocks, - encryptionType = if (processedMimeMessageResult.isReplyEncrypted) { + encryptionType = if (processedMimeMessageResult.verificationResult.isEncrypted) { MessageEncryptionType.ENCRYPTED } else { MessageEncryptionType.STANDARD - } + }, + verificationResult = processedMimeMessageResult.verificationResult ) Result.success(requestCode = it.requestCode, data = msgInfo) } catch (e: Exception) { diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/PgpSignatureHandlerViewModel.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/PgpSignatureHandlerViewModel.kt new file mode 100644 index 0000000000..e0e46fe2a7 --- /dev/null +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/PgpSignatureHandlerViewModel.kt @@ -0,0 +1,16 @@ +/* + * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com + * Contributors: DenBond7 + */ + +package com.flowcrypt.email.jetpack.viewmodel + +import android.app.Application + +/** + * @author Denis Bondarenko + * Date: 12/7/21 + * Time: 9:25 PM + * E-mail: DenBond7@gmail.com + */ +class PgpSignatureHandlerViewModel(application: Application) : AccountViewModel(application) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecrypt.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecrypt.kt index 7976310822..a926f82179 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecrypt.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecrypt.kt @@ -10,6 +10,7 @@ import android.os.Parcelable import com.flowcrypt.email.util.exception.DecryptionException import org.bouncycastle.openpgp.PGPDataValidationException import org.bouncycastle.openpgp.PGPException +import org.bouncycastle.openpgp.PGPPublicKeyRingCollection import org.bouncycastle.openpgp.PGPSecretKeyRingCollection import org.pgpainless.PGPainless import org.pgpainless.decryption_verification.ConsumerOptions @@ -63,6 +64,7 @@ object PgpDecrypt { fun decryptWithResult( srcInputStream: InputStream, + pgpPublicKeyRingCollection: PGPPublicKeyRingCollection, pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector, ignoreMdcErrors: Boolean = false @@ -78,14 +80,13 @@ object PgpDecrypt { .addDecryptionKeys(pgpSecretKeyRingCollection, protector) .setMissingKeyPassphraseStrategy(MissingKeyPassphraseStrategy.THROW_EXCEPTION) .setIgnoreMDCErrors(ignoreMdcErrors) + .addVerificationCerts(pgpPublicKeyRingCollection) ) decryptionStream.use { it.copyTo(outStream) } return DecryptionResult( - content = destOutputStream, - isEncrypted = decryptionStream.result.isEncrypted, - isSigned = decryptionStream.result.isSigned, - filename = decryptionStream.result.fileName + openPgpMetadata = decryptionStream.result, + content = destOutputStream ) } catch (e: Exception) { return DecryptionResult.withError( @@ -139,26 +140,27 @@ object PgpDecrypt { } data class DecryptionResult( + val openPgpMetadata: OpenPgpMetadata? = null, // provided if decryption was successful val content: ByteArrayOutputStream? = null, - // true if message was encrypted. - // Alternatively false (because it could have also been plaintext signed, - // or wrapped in PGP armor as plaintext packet without encrypting) - // also false when error happens. - val isEncrypted: Boolean = false, - - val isSigned: Boolean = false, - - // pgp messages may include original filename in them - val filename: String? = null, - // todo later - signature verification not supported on Android yet val signature: String? = null, // provided if error happens val exception: DecryptionException? = null ) { + /** + * true if message was encrypted. + * Alternatively false (because it could have also been plaintext signed, or wrapped in + * PGP armor as plaintext packet without encrypting). Also false when error happens. + */ + val isEncrypted: Boolean = openPgpMetadata?.isEncrypted ?: false + val isSigned = openPgpMetadata?.isSigned ?: false + + // pgp messages may include original filename in them + val filename = openPgpMetadata?.fileName + companion object { fun withError(exception: DecryptionException): DecryptionResult { return DecryptionResult(exception = exception) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt index 310f9e470e..a3117e94d0 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt @@ -11,6 +11,7 @@ import com.flowcrypt.email.api.email.JavaEmailConstants import com.flowcrypt.email.api.retrofit.response.model.AttMeta import com.flowcrypt.email.api.retrofit.response.model.AttMsgBlock import com.flowcrypt.email.api.retrofit.response.model.DecryptErrorMsgBlock +import com.flowcrypt.email.api.retrofit.response.model.DecryptedAndOrSignedContentMsgBlock import com.flowcrypt.email.api.retrofit.response.model.EncryptedAttLinkMsgBlock import com.flowcrypt.email.api.retrofit.response.model.EncryptedAttMsgBlock import com.flowcrypt.email.api.retrofit.response.model.MsgBlock @@ -18,8 +19,10 @@ import com.flowcrypt.email.api.retrofit.response.model.MsgBlockError import com.flowcrypt.email.api.retrofit.response.model.MsgBlockFactory import com.flowcrypt.email.api.retrofit.response.model.PublicKeyMsgBlock import com.flowcrypt.email.api.retrofit.response.model.SignedMsgBlock +import com.flowcrypt.email.api.retrofit.response.model.VerificationResult import com.flowcrypt.email.core.msg.MimeUtils import com.flowcrypt.email.core.msg.MsgBlockParser +import com.flowcrypt.email.database.FlowCryptRoomDatabase import com.flowcrypt.email.extensions.java.io.readText import com.flowcrypt.email.extensions.javax.mail.internet.hasFileName import com.flowcrypt.email.extensions.javax.mail.isInline @@ -32,7 +35,12 @@ import com.flowcrypt.email.extensions.kotlin.unescapeHtml import com.flowcrypt.email.extensions.org.bouncycastle.openpgp.armor import com.flowcrypt.email.extensions.org.owasp.html.allowAttributesOnElementsExt import com.flowcrypt.email.security.KeysStorageImpl +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import org.bouncycastle.openpgp.PGPPublicKeyRing +import org.bouncycastle.openpgp.PGPPublicKeyRingCollection import org.bouncycastle.openpgp.PGPSecretKeyRingCollection +import org.bouncycastle.openpgp.PGPSignature import org.json.JSONObject import org.jsoup.Jsoup import org.jsoup.nodes.Document @@ -40,6 +48,7 @@ import org.jsoup.nodes.Element import org.jsoup.nodes.Node import org.jsoup.nodes.TextNode import org.owasp.html.HtmlPolicyBuilder +import org.pgpainless.key.SubkeyIdentifier import org.pgpainless.key.protection.SecretKeyRingProtector import java.io.InputStream import java.nio.charset.StandardCharsets @@ -48,6 +57,7 @@ import javax.mail.Multipart import javax.mail.Part import javax.mail.Session import javax.mail.internet.ContentType +import javax.mail.internet.InternetAddress import javax.mail.internet.MimeMessage import javax.mail.internet.MimePart import kotlin.random.Random @@ -198,12 +208,32 @@ object PgpMsg { .allowAttributesOnElementsExt(ALLOWED_ATTRS) .toFactory() - fun processMimeMessage(context: Context, inputStream: InputStream): ProcessedMimeMessageResult { + suspend fun processMimeMessage(context: Context, inputStream: InputStream): + ProcessedMimeMessageResult = withContext(Dispatchers.IO) { val keysStorage = KeysStorageImpl.getInstance(context) val pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keysStorage.getPGPSecretKeyRings()) val protector = keysStorage.getSecretKeyRingProtector() - return processMimeMessage( - msg = MimeMessage(Session.getInstance(Properties()), inputStream), + val msg = MimeMessage(Session.getInstance(Properties()), inputStream) + + val keys = mutableListOf() + val pubKeyDao = FlowCryptRoomDatabase.getDatabase(context).pubKeyDao() + + for (address in msg.from) { + if (address is InternetAddress) { + val existingPubKeysInfo = pubKeyDao.getPublicKeysByRecipient(address.address.lowercase()) + for (existingPublicKeyEntity in existingPubKeysInfo) { + keys.addAll( + //ask Tom about this place. Do we need to catch exception here or we can throw it + PgpKey.parseKeys(source = existingPublicKeyEntity.publicKey) + .pgpKeyRingCollection.pgpPublicKeyRingCollection + ) + } + } + } + + return@withContext processMimeMessage( + msg = msg, + pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(keys), pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, protector = protector ) @@ -223,12 +253,18 @@ object PgpMsg { fun processMimeMessage( msg: MimeMessage, + pgpPublicKeyRingCollection: PGPPublicKeyRingCollection = PGPPublicKeyRingCollection(listOf()), pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): ProcessedMimeMessageResult { val extractedMimeContent = extractMimeContent(msg) val extractedMsgBlocks = extractMsgBlocks(extractedMimeContent) - return processExtractedMsgBlocks(extractedMsgBlocks, pgpSecretKeyRingCollection, protector) + return processExtractedMsgBlocks( + extractedMsgBlocks, + pgpPublicKeyRingCollection, + pgpSecretKeyRingCollection, + protector + ) } fun extractMimeContent(msg: MimeMessage): ExtractedMimeContent { @@ -764,15 +800,27 @@ object PgpMsg { private fun processExtractedMsgBlocks( msgBlocks: List, - ringCollection: PGPSecretKeyRingCollection, + pgpPublicKeyRingCollection: PGPPublicKeyRingCollection, + pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): ProcessedMimeMessageResult { - val sequentialProcessedBlocks = handleExtractedMsgBlocks(msgBlocks, ringCollection, protector) + val sequentialProcessedBlocks = handleExtractedMsgBlocks( + msgBlocks = msgBlocks, + pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, + pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + protector = protector + ) - var isReplyEncrypted = false + var isEncrypted = false val contentBlocks = mutableListOf() val resultBlocks = mutableListOf() + var hasMixedSignatures = false + var hasUnverifiedSignatures = false + var signedBlockCount = 0 + var isPartialSigned = false + val verifiedSignatures = mutableMapOf() + for (block in sequentialProcessedBlocks) { // We don't need Base64 correction here, fromAttachment() does this for us // We also seem to don't need to make correction between raw and utf8 @@ -780,75 +828,81 @@ object PgpMsg { // So, at least meanwhile, not porting this: // block.content = isContentBlock(block.type) // ? block.content.toUtfStr() : block.content.toRawBytesStr(); - - if (block.type in MsgBlock.Type.DECRYPTED_CONTENT_BLOCK_TYPES) { - isReplyEncrypted = true - } - - when { - block.type == MsgBlock.Type.DECRYPTED_ATT -> { - resultBlocks.add(block) + if (block is DecryptedAndOrSignedContentMsgBlock) { + if (!isEncrypted) { + isEncrypted = block.openPgpMetadata?.isEncrypted ?: false } - block.type == MsgBlock.Type.PUBLIC_KEY -> { - block.content?.let { source -> - try { - val keyRings = PgpKey.parseAndNormalizeKeyRings(source) - if (keyRings.isNotEmpty()) { - resultBlocks.addAll(keyRings.map { - MsgBlockFactory.fromContent(MsgBlock.Type.PUBLIC_KEY, it.armor(null)) - }) - } else { - resultBlocks.add( - PublicKeyMsgBlock( - content = block.content, - complete = false, - keyDetails = null, - error = MsgBlockError("empty KeyRing") - ) - ) + if (block.openPgpMetadata?.isSigned == true) { + signedBlockCount++ + block.openPgpMetadata?.let { openPgpMetadata -> + if (openPgpMetadata.invalidInbandSignatures.isNotEmpty() + || openPgpMetadata.invalidDetachedSignatures.isNotEmpty() + ) { + hasUnverifiedSignatures = true + } + if (verifiedSignatures.isEmpty()) { + verifiedSignatures.putAll(openPgpMetadata.verifiedSignatures) + } else { + if (verifiedSignatures.keys.map { it.keyId } != openPgpMetadata.verifiedSignatures.keys.map { it.keyId }) { + hasMixedSignatures = true + //todo-denbond7 need to check it + verifiedSignatures.putAll(openPgpMetadata.verifiedSignatures) } - } catch (ex: Exception) { - ex.printStackTrace() - resultBlocks.add( - PublicKeyMsgBlock( - content = block.content, - complete = false, - keyDetails = null, - error = MsgBlockError(ex.javaClass.simpleName + ": " + ex.message) - ) - ) } } } - block.type.isContentBlockType() || MimeUtils.isPlainImgAtt(block) -> { - if (block.error != null) { - resultBlocks.add(block) + for (innerBlock in block.blocks) { + if (canBeAddedToCombinedContent(innerBlock)) { + contentBlocks.add(innerBlock) } else { - contentBlocks.add(block) + resultBlocks.add(innerBlock) } } + } - block.type != MsgBlock.Type.PLAIN_ATT -> { - resultBlocks.add(block) - } + if (canBeAddedToCombinedContent(block)) { + contentBlocks.add(block) + } else { + resultBlocks.add(block) } } val fmtRes = prepareFormattedContentBlock(contentBlocks) resultBlocks.add(0, fmtRes.contentBlock) + if (signedBlockCount > 0 && signedBlockCount != sequentialProcessedBlocks.size) { + isPartialSigned = true + } + return ProcessedMimeMessageResult( - isReplyEncrypted = isReplyEncrypted, text = fmtRes.text, - blocks = resultBlocks + blocks = resultBlocks, + verificationResult = VerificationResult( + isEncrypted = isEncrypted, + isSigned = signedBlockCount > 0, + hasMixedSignatures = hasMixedSignatures, + isPartialSigned = isPartialSigned, + hasUnverifiedSignatures = hasUnverifiedSignatures + ) ) } + private fun canBeAddedToCombinedContent(block: MsgBlock): Boolean { + return when { + block.type.isContentBlockType() || MimeUtils.isPlainImgAtt(block) -> { + block.error == null + } + + else -> false + } + } + private fun handleExtractedMsgBlocks( msgBlocks: List, - keyRings: PGPSecretKeyRingCollection, + pgpPublicKeyRingCollection: PGPPublicKeyRingCollection, + pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): MutableList { val sequentialProcessedBlocks = mutableListOf() @@ -859,8 +913,13 @@ object PgpMsg { } msgBlock.type == MsgBlock.Type.ENCRYPTED_MSG -> { - val handledBlocks = processEncryptedMsgBlock(msgBlock, keyRings, protector) - sequentialProcessedBlocks.addAll(handledBlocks) + val decryptedContentMsgBlock = processEncryptedMsgBlock( + msgBlock = msgBlock, + pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, + pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + protector = protector + ) + sequentialProcessedBlocks.add(decryptedContentMsgBlock) } msgBlock.type == MsgBlock.Type.ENCRYPTED_ATT @@ -868,13 +927,46 @@ object PgpMsg { && PUBLIC_KEY_REGEX_3.matches(msgBlock.attMeta.name ?: "") -> { sequentialProcessedBlocks.add( processPublicKeyMsgBlock( - msgBlock, - keyRings, - protector + msgBlock = msgBlock, + pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, + pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + protector = protector ) ) } + msgBlock.type == MsgBlock.Type.PUBLIC_KEY -> { + msgBlock.content?.let { source -> + try { + val keyRings = PgpKey.parseAndNormalizeKeyRings(source) + if (keyRings.isNotEmpty()) { + sequentialProcessedBlocks.addAll(keyRings.map { + MsgBlockFactory.fromContent(MsgBlock.Type.PUBLIC_KEY, it.armor(null)) + }) + } else { + sequentialProcessedBlocks.add( + PublicKeyMsgBlock( + content = source, + complete = false, + keyDetails = null, + error = MsgBlockError("empty KeyRing") + ) + ) + } + } catch (ex: Exception) { + ex.printStackTrace() + sequentialProcessedBlocks.add( + PublicKeyMsgBlock( + content = source, + complete = false, + keyDetails = null, + error = MsgBlockError(ex.javaClass.simpleName + ": " + ex.message) + ) + ) + } + } + } + else -> { sequentialProcessedBlocks.add(msgBlock) } @@ -885,14 +977,16 @@ object PgpMsg { private fun processPublicKeyMsgBlock( msgBlock: MsgBlock, - keyRings: PGPSecretKeyRingCollection, + pgpPublicKeyRingCollection: PGPPublicKeyRingCollection, + pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): MsgBlock { // encrypted public key attached val decryptionResult = PgpDecrypt.decryptWithResult( - msgBlock.content?.toInputStream()!!, - keyRings, - protector + srcInputStream = msgBlock.content?.toInputStream()!!, + pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, + pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + protector = protector ) return if (decryptionResult.content != null) { val content = decryptionResult.content.toString(StandardCharsets.UTF_8.displayName()) @@ -905,23 +999,24 @@ object PgpMsg { private fun processEncryptedMsgBlock( msgBlock: MsgBlock, - ringCollection: PGPSecretKeyRingCollection, + pgpPublicKeyRingCollection: PGPPublicKeyRingCollection, + pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector - ): List { + ): DecryptedAndOrSignedContentMsgBlock { val decryptionResult = PgpDecrypt.decryptWithResult( - msgBlock.content?.toInputStream()!!, - ringCollection, - protector + srcInputStream = msgBlock.content?.toInputStream()!!, + pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, + pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + protector = protector ) - val results = mutableListOf() - + val blocks = mutableListOf() if (decryptionResult.exception == null) { if (decryptionResult.isEncrypted) { val decrypted = decryptionResult.content?.toByteArray() val formatted = MsgBlockParser.fmtDecryptedAsSanitizedHtmlBlocks(decrypted) //todo-denbond7 fix it //if (subject == null) subject = formatted.subject - results.addAll(formatted.blocks) + blocks.addAll(formatted.blocks) } else { // ------------------------------------------------------------------------------------ // Comment from TS code: @@ -933,7 +1028,7 @@ object PgpMsg { // message that was actually fully armored (text not visible) with a mime msg inside // ... -> in which case the user would I think see full mime content? // ------------------------------------------------------------------------------------ - results.add( + blocks.add( MsgBlockFactory.fromContent( type = MsgBlock.Type.VERIFIED_MSG, content = decryptionResult.content?.toString( @@ -946,14 +1041,15 @@ object PgpMsg { } else { if (PgpDecrypt.DecryptionErrorType.NO_MDC == decryptionResult.exception.decryptionErrorType) { val resultWithIgnoredMDCErrors = PgpDecrypt.decryptWithResult( - msgBlock.content?.toInputStream()!!, - ringCollection, - protector, - true + srcInputStream = msgBlock.content?.toInputStream()!!, + pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, + pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + protector = protector, + ignoreMdcErrors = true ) val decryptErrorMsgBlock = if (resultWithIgnoredMDCErrors.exception == null) { DecryptErrorMsgBlock( - content = resultWithIgnoredMDCErrors.content.toString(), + content = String(resultWithIgnoredMDCErrors.content?.toByteArray() ?: byteArrayOf()), complete = true, decryptErr = decryptionResult.exception.toDecryptError() ) @@ -965,9 +1061,9 @@ object PgpMsg { ) } - results.add(decryptErrorMsgBlock) + blocks.add(decryptErrorMsgBlock) } else { - results.add( + blocks.add( DecryptErrorMsgBlock( content = msgBlock.content, complete = true, @@ -977,7 +1073,9 @@ object PgpMsg { } } - return results + return DecryptedAndOrSignedContentMsgBlock(blocks = blocks).apply { + openPgpMetadata = decryptionResult.openPgpMetadata + } } private fun processSignedMsgBlock(msgBlock: SignedMsgBlock): MsgBlock? { @@ -1266,9 +1364,9 @@ object PgpMsg { } data class ProcessedMimeMessageResult( - val isReplyEncrypted: Boolean, val text: String, - val blocks: List + val blocks: List, + val verificationResult: VerificationResult ) enum class TreatAs { diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MessageDetailsFragment.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MessageDetailsFragment.kt index f5298f7d61..0fbc1e79ef 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MessageDetailsFragment.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MessageDetailsFragment.kt @@ -69,6 +69,7 @@ import com.flowcrypt.email.extensions.visible import com.flowcrypt.email.extensions.visibleOrGone import com.flowcrypt.email.jetpack.viewmodel.LabelsViewModel import com.flowcrypt.email.jetpack.viewmodel.MsgDetailsViewModel +import com.flowcrypt.email.jetpack.viewmodel.PgpSignatureHandlerViewModel import com.flowcrypt.email.jetpack.viewmodel.RecipientsViewModel import com.flowcrypt.email.jetpack.viewmodel.factory.MsgDetailsViewModelFactory import com.flowcrypt.email.model.MessageEncryptionType @@ -87,6 +88,7 @@ import com.flowcrypt.email.ui.activity.fragment.dialog.ChoosePublicKeyDialogFrag import com.flowcrypt.email.ui.activity.fragment.dialog.TwoWayDialogFragment import com.flowcrypt.email.ui.adapter.AttachmentsRecyclerViewAdapter import com.flowcrypt.email.ui.adapter.MsgDetailsRecyclerViewAdapter +import com.flowcrypt.email.ui.adapter.PgpBadgeListAdapter import com.flowcrypt.email.ui.adapter.recyclerview.itemdecoration.MarginItemDecoration import com.flowcrypt.email.ui.adapter.recyclerview.itemdecoration.VerticalSpaceMarginItemDecoration import com.flowcrypt.email.ui.widget.EmailWebView @@ -129,6 +131,7 @@ class MessageDetailsFragment : BaseFragment(), ProgressBehaviour, View.OnClickLi private val msgDetailsViewModel: MsgDetailsViewModel by viewModels { MsgDetailsViewModelFactory(args.localFolder, args.messageEntity, requireActivity().application) } + private val pgpSignatureHandlerViewModel: PgpSignatureHandlerViewModel by viewModels() private val attachmentsRecyclerViewAdapter = AttachmentsRecyclerViewAdapter( object : AttachmentsRecyclerViewAdapter.Listener { @@ -188,12 +191,14 @@ class MessageDetailsFragment : BaseFragment(), ProgressBehaviour, View.OnClickLi private var progressBarActionProgress: ProgressBar? = null private var rVAttachments: RecyclerView? = null private var rVMsgDetails: RecyclerView? = null + private var rVPgpBadges: RecyclerView? = null private var msgInfo: IncomingMessageInfo? = null private var folderType: FoldersManager.FolderType? = null private val labelsViewModel: LabelsViewModel by viewModels() private val recipientsViewModel: RecipientsViewModel by viewModels() private val msgDetailsAdapter = MsgDetailsRecyclerViewAdapter() + private val pgpBadgeListAdapter = PgpBadgeListAdapter() private var isAdditionalActionEnabled: Boolean = false private var isDeleteActionEnabled: Boolean = false @@ -462,10 +467,45 @@ class MessageDetailsFragment : BaseFragment(), ProgressBehaviour, View.OnClickLi private fun updateMsgBody() { if (msgInfo != null) { + updatePgpBadges() updateMsgView() } } + private fun updatePgpBadges() { + msgInfo?.verificationResult?.let { verificationResult -> + val badges = mutableListOf() + + if (msgInfo?.encryptionType == MessageEncryptionType.ENCRYPTED) { + badges.add(PgpBadgeListAdapter.PgpBadge(PgpBadgeListAdapter.PgpBadge.Type.ENCRYPTED)) + } else { + badges.add(PgpBadgeListAdapter.PgpBadge(PgpBadgeListAdapter.PgpBadge.Type.NOT_ENCRYPTED)) + } + + if (verificationResult.isSigned) { + val badge = when { + verificationResult.hasUnverifiedSignatures -> { + PgpBadgeListAdapter.PgpBadge(PgpBadgeListAdapter.PgpBadge.Type.CAN_NOT_VERIFY_SIGNATURE) + } + + verificationResult.isPartialSigned -> { + PgpBadgeListAdapter.PgpBadge(PgpBadgeListAdapter.PgpBadge.Type.ONLY_PARTIALLY_SIGNED) + } + + !verificationResult.isPartialSigned && verificationResult.hasMixedSignatures -> { + PgpBadgeListAdapter.PgpBadge(PgpBadgeListAdapter.PgpBadge.Type.MIXED_SIGNED) + } + + else -> PgpBadgeListAdapter.PgpBadge(PgpBadgeListAdapter.PgpBadge.Type.SIGNED) + } + badges.add(badge) + } else { + badges.add(PgpBadgeListAdapter.PgpBadge(PgpBadgeListAdapter.PgpBadge.Type.NOT_SIGNED)) + } + pgpBadgeListAdapter.submitList(badges) + } + } + private fun showConnLostHint() { showSnackbar( requireView(), getString(R.string.failed_load_message_from_email_server), @@ -649,6 +689,7 @@ class MessageDetailsFragment : BaseFragment(), ProgressBehaviour, View.OnClickLi rVAttachments = view.findViewById(R.id.rVAttachments) rVMsgDetails = view.findViewById(R.id.rVMsgDetails) + rVPgpBadges = view.findViewById(R.id.rVPgpBadges) } private fun updateViews() { @@ -703,6 +744,16 @@ class MessageDetailsFragment : BaseFragment(), ProgressBehaviour, View.OnClickLi adapter = msgDetailsAdapter } + rVPgpBadges?.apply { + layoutManager = LinearLayoutManager(context, RecyclerView.HORIZONTAL, false) + addItemDecoration( + MarginItemDecoration( + marginRight = resources.getDimensionPixelSize(R.dimen.default_margin_small) + ) + ) + adapter = pgpBadgeListAdapter + } + tVTo?.text = prepareToText() val headers = mutableListOf().apply { diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/adapter/PgpBadgeListAdapter.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/adapter/PgpBadgeListAdapter.kt new file mode 100644 index 0000000000..4e41f6047b --- /dev/null +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/adapter/PgpBadgeListAdapter.kt @@ -0,0 +1,89 @@ +/* + * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com + * Contributors: DenBond7 + */ + +package com.flowcrypt.email.ui.adapter + +import android.content.Context +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.ImageView +import android.widget.TextView +import androidx.core.content.ContextCompat +import androidx.recyclerview.widget.DiffUtil +import androidx.recyclerview.widget.ListAdapter +import androidx.recyclerview.widget.RecyclerView +import com.flowcrypt.email.R + +/** + * @author Denis Bondarenko + * Date: 12/10/21 + * Time: 11:41 AM + * E-mail: DenBond7@gmail.com + */ +class PgpBadgeListAdapter : ListAdapter(DiffUtilCallBack()) { + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { + return ViewHolder( + LayoutInflater.from(parent.context).inflate(R.layout.item_pgp_badge, parent, false) + ) + } + + override fun onBindViewHolder(holder: ViewHolder, position: Int) { + holder.bindTo(getItem(position)) + } + + inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { + private val imageViewIcon: ImageView = itemView.findViewById(R.id.imageViewIcon) + private val textViewStatus: TextView = itemView.findViewById(R.id.textViewStatus) + + fun bindTo(item: PgpBadge) { + itemView.backgroundTintList = ContextCompat.getColorStateList( + itemView.context, item.type.backgroundColorId + ) + imageViewIcon.setImageResource(item.type.imageResourceId) + textViewStatus.text = item.getLocalizedText(itemView.context) + } + } + + data class PgpBadge(val type: Type) { + fun getLocalizedText(context: Context): CharSequence { + return when (type) { + Type.ENCRYPTED -> context.getString(R.string.encrypted) + Type.SIGNED -> context.getString(R.string.signed) + Type.NOT_ENCRYPTED -> context.getString(R.string.not_encrypted) + Type.NOT_SIGNED -> context.getString(R.string.not_signed) + Type.BAD_SIGNATURE -> context.getString(R.string.bad_signature) + Type.ONLY_PARTIALLY_SIGNED -> context.getString(R.string.only_partially_signed) + Type.MIXED_SIGNED -> context.getString(R.string.mixed_signed) + Type.CAN_NOT_VERIFY_SIGNATURE -> context.getString(R.string.can_not_verify_signature) + Type.VERIFYING_SIGNATURE -> context.getString(R.string.verifying_signature) + } + } + + enum class Type constructor(val imageResourceId: Int, val backgroundColorId: Int) { + ENCRYPTED(R.drawable.ic_encrypted_badge_white_16, R.color.colorPrimary), + SIGNED(R.drawable.ic_signed_white_16, R.color.colorPrimary), + NOT_ENCRYPTED(R.drawable.ic_not_encrypted_badge_white_16, R.color.red), + NOT_SIGNED(R.drawable.ic_not_signed_white_16, R.color.red), + BAD_SIGNATURE(R.drawable.ic_bad_signature_white_16, R.color.red), + ONLY_PARTIALLY_SIGNED(R.drawable.ic_signing_warning_white_16, R.color.orange), + MIXED_SIGNED(R.drawable.ic_signing_warning_white_16, R.color.orange), + CAN_NOT_VERIFY_SIGNATURE(R.drawable.ic_signing_warning_white_16, R.color.orange), + VERIFYING_SIGNATURE(R.drawable.ic_verifying_signature_white_16, R.color.gray) + } + } + + class DiffUtilCallBack : DiffUtil.ItemCallback() { + override fun areItemsTheSame(oldItem: PgpBadge, newItem: PgpBadge): Boolean { + return oldItem.type == newItem.type + } + + override fun areContentsTheSame(oldItem: PgpBadge, newItem: PgpBadge): Boolean { + return oldItem == newItem + } + } +} diff --git a/FlowCrypt/src/main/res/drawable/ic_bad_signature_white_16.xml b/FlowCrypt/src/main/res/drawable/ic_bad_signature_white_16.xml new file mode 100644 index 0000000000..63fb8c9a30 --- /dev/null +++ b/FlowCrypt/src/main/res/drawable/ic_bad_signature_white_16.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/FlowCrypt/src/main/res/drawable/ic_baseline_report_gmailerrorred_24.xml b/FlowCrypt/src/main/res/drawable/ic_baseline_report_gmailerrorred_24.xml new file mode 100644 index 0000000000..63fb8c9a30 --- /dev/null +++ b/FlowCrypt/src/main/res/drawable/ic_baseline_report_gmailerrorred_24.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/FlowCrypt/src/main/res/drawable/ic_encrypted_badge_white_16.xml b/FlowCrypt/src/main/res/drawable/ic_encrypted_badge_white_16.xml new file mode 100644 index 0000000000..0a43b39306 --- /dev/null +++ b/FlowCrypt/src/main/res/drawable/ic_encrypted_badge_white_16.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/FlowCrypt/src/main/res/drawable/ic_not_encrypted_badge_white_16.xml b/FlowCrypt/src/main/res/drawable/ic_not_encrypted_badge_white_16.xml new file mode 100644 index 0000000000..b097b3c0f3 --- /dev/null +++ b/FlowCrypt/src/main/res/drawable/ic_not_encrypted_badge_white_16.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/FlowCrypt/src/main/res/drawable/ic_not_signed_white_16.xml b/FlowCrypt/src/main/res/drawable/ic_not_signed_white_16.xml new file mode 100644 index 0000000000..1bfa82de2d --- /dev/null +++ b/FlowCrypt/src/main/res/drawable/ic_not_signed_white_16.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/FlowCrypt/src/main/res/drawable/ic_signed_white_16.xml b/FlowCrypt/src/main/res/drawable/ic_signed_white_16.xml new file mode 100644 index 0000000000..8c49f61ce0 --- /dev/null +++ b/FlowCrypt/src/main/res/drawable/ic_signed_white_16.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/FlowCrypt/src/main/res/drawable/ic_signing_warning_white_16.xml b/FlowCrypt/src/main/res/drawable/ic_signing_warning_white_16.xml new file mode 100644 index 0000000000..ae56a42a4a --- /dev/null +++ b/FlowCrypt/src/main/res/drawable/ic_signing_warning_white_16.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/FlowCrypt/src/main/res/drawable/ic_verifying_signature_white_16.xml b/FlowCrypt/src/main/res/drawable/ic_verifying_signature_white_16.xml new file mode 100644 index 0000000000..f50fc1a404 --- /dev/null +++ b/FlowCrypt/src/main/res/drawable/ic_verifying_signature_white_16.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/FlowCrypt/src/main/res/layout/fragment_message_details.xml b/FlowCrypt/src/main/res/layout/fragment_message_details.xml index 0858362aa0..197e15e427 100644 --- a/FlowCrypt/src/main/res/layout/fragment_message_details.xml +++ b/FlowCrypt/src/main/res/layout/fragment_message_details.xml @@ -112,22 +112,6 @@ app:layout_constraintTop_toTopOf="@+id/tVTo" tools:text="1:05 PM" /> - - + + + + + + + + + + + diff --git a/FlowCrypt/src/main/res/values/strings.xml b/FlowCrypt/src/main/res/values/strings.xml index 2321a90a81..e3199a6c1e 100644 --- a/FlowCrypt/src/main/res/values/strings.xml +++ b/FlowCrypt/src/main/res/values/strings.xml @@ -546,4 +546,14 @@ Manually importing Public Keys received over email can be dangerous. Contact the sender to verify that the fingerprint matches. Manually importing Public Keys can be dangerous + PGP details badge + encrypted + signed + not encrypted + bad signature + only partially signed + can\'t verify signature + verifying signature… + not signed + mixed signed diff --git a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt index 1bb2e110fb..da4218142d 100644 --- a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt +++ b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt @@ -16,6 +16,7 @@ import com.flowcrypt.email.extensions.kotlin.toEscapedHtml import com.flowcrypt.email.extensions.kotlin.toInputStream import com.flowcrypt.email.util.TestUtil import com.google.gson.JsonParser +import org.bouncycastle.openpgp.PGPPublicKeyRingCollection import org.bouncycastle.openpgp.PGPSecretKeyRing import org.bouncycastle.openpgp.PGPSecretKeyRingCollection import org.jsoup.Jsoup @@ -225,9 +226,10 @@ class PgpMsgTest { TestKeys.KeyWithPassPhrase(keyRing = it.keyRing, passphrase = wrongPassphrase) } val r = PgpDecrypt.decryptWithResult( - messageInfo.armored.byteInputStream(), - PGPSecretKeyRingCollection(privateKeysWithWrongPassPhrases.map { it.keyRing }), - SecretKeyRingProtector.unprotectedKeys() + srcInputStream = messageInfo.armored.byteInputStream(), + pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), + pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(privateKeysWithWrongPassPhrases.map { it.keyRing }), + protector = SecretKeyRingProtector.unprotectedKeys() ) assertTrue("Message returned", r.content == null) assertTrue("Error not returned", r.exception != null) @@ -241,9 +243,10 @@ class PgpMsgTest { fun missingPassphraseTest() { val messageInfo = findMessage("decrypt - without a subject") val r = PgpDecrypt.decryptWithResult( - messageInfo.armored.byteInputStream(), - PGPSecretKeyRingCollection(PRIVATE_KEYS.map { it.keyRing }), - SecretKeyRingProtector.unprotectedKeys() + srcInputStream = messageInfo.armored.byteInputStream(), + pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), + pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(PRIVATE_KEYS.map { it.keyRing }), + protector = SecretKeyRingProtector.unprotectedKeys() ) assertTrue("Message returned", r.content == null) assertTrue("Error returned", r.exception != null) @@ -259,8 +262,9 @@ class PgpMsgTest { val wrongKey = listOf(PRIVATE_KEYS[1]) val r = PgpDecrypt.decryptWithResult( messageInfo.armored.byteInputStream(), - PGPSecretKeyRingCollection(wrongKey.map { it.keyRing }), - SecretKeyRingProtector.unprotectedKeys() + pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), + pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(wrongKey.map { it.keyRing }), + protector = SecretKeyRingProtector.unprotectedKeys() ) assertTrue("Message returned", r.content == null) assertTrue("Error not returned", r.exception != null) @@ -290,8 +294,9 @@ class PgpMsgTest { val messageInfo = findMessage(messageKey) val result = PgpDecrypt.decryptWithResult( messageInfo.armored.byteInputStream(), - PGPSecretKeyRingCollection(PRIVATE_KEYS.map { it.keyRing }), - secretKeyRingProtector + pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), + pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(PRIVATE_KEYS.map { it.keyRing }), + protector = secretKeyRingProtector ) if (result.content != null) { val s = String(result.content!!.toByteArray(), Charset.forName(messageInfo.charset)) @@ -430,7 +435,8 @@ class PgpMsgTest { val text = loadResourceAsString("compat/direct-encrypted-pgpmime-special-chars.txt") val keys = TestKeys.KEYS["rsa1"]!!.listOfKeysWithPassPhrase val decryptResult = PgpDecrypt.decryptWithResult( - text.toInputStream(), + srcInputStream = text.toInputStream(), + pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), protector = TestKeys.genRingProtector(keys) ) @@ -454,6 +460,7 @@ class PgpMsgTest { val decryptResult = PgpDecrypt.decryptWithResult( text.toInputStream(), + pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), protector = TestKeys.genRingProtector(keys) ) diff --git a/docker-mailserver/docker-compose.yml b/docker-mailserver/docker-compose.yml index 7842e6b6e5..a40e6be29b 100644 --- a/docker-mailserver/docker-compose.yml +++ b/docker-mailserver/docker-compose.yml @@ -1,7 +1,7 @@ version: '2' services: mail: - image: flowcrypt/flowcrypt-email-server:0.0.13 + image: flowcrypt/flowcrypt-email-server:0.0.14 hostname: ${HOSTNAME} domainname: ${DOMAINNAME} container_name: ${CONTAINER_NAME} diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/dovecot.list.index.log b/docker-mailserver/maildata_source/flowcrypt.test/default/dovecot.list.index.log index 9f53f77a7432f21fe67c55b301a9d075dce1c8eb..9d65c6acc04040fc4840ac6a95c85b18b56f232d 100644 GIT binary patch literal 1180 zcmbVLu}T9$5PdPHt`T)>u}GO8NS9(sWs$_4UXEY_&z z)LAQ!z6GsI_4-xO>zLwLAMRU^z;&=hpJClo>C8TNz+wp=c;Cuc8JnS&f9aC*slvM2 S0ZV#x6nFmfvGqRRh_wQ?xu81$ delta 127 zcmbQk`GaXfz~l%P9kB~c3=D72tW0cZXlPMjU=VO%U}2cTFxijAXyOAFu?$X3*#}@* ZDP{%+h5|-RX&pw8W*MNdSfwj~S^#FFA?E-9 diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/Drafts/dbox-Mails/dovecot.index.log b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/Drafts/dbox-Mails/dovecot.index.log index 702e657c95c7dc6115265c90d92e55f39a3d753f..13172e77bf54a03c46885d89eabfae4a39445e71 100644 GIT binary patch delta 12 Tcmeys^nqzZ4kJr-=H^5IB2WbW delta 12 Tcmeys^nqzZ4kOFkGbX zp2H<=Y7yF?CQ{l8T1cceQkt|%o3>F9samOul2rWzMQKSRilUHKX+-|e(okBGkfy(H z=6ic{yEC`9yXT8|zUOaec4qdy-}mQz?|a{yZ9BIqm;CdupPEM9ttg6$x>#0}ZJ=k) z{MLgY$}A3cg8nS(MRWpXGHkVi`A|DLUQiDR;rPBM94{~O!V$hJgsD5a?jEcx*56fX zt~A>DcGzm)vP(G^_ZCpkr-z`72ko$+&MqwPR}EhsYcy3uH-sv@g5?zqTfIRybzR+i zWO5dt3c9{;m!fQsZ&l7=`evpVFeRd*QXjsF>#4j6^;%SU&EaN!si2m_O0c}x?rJ98 zLjBx>dLb&6*?RWXbj|gs7t@6(Gt0&M!cx1So~$o7)x&_`5J8~c8kFu|Zp00`8;wiH z;&8LNUp4hrEOftsKieA_i~6N;`v&P7;dUKrH*U3Jy;kn#FSS#M zx1tP&tA!S>E-dqIWhHtW^0TCJ(ASh)!dvWW*#Q*kv6 zU3j*qLtw2AuC8M^ewVe0aU~nOaeDwWP57VG7e zUF(iBp6kN`xHjfhk6B8oM16Cc&`N#dJ{pHw%V4vYbA)MVO}Q|Mg+3K`7R*Cm9VktpCDv zOxM&sBTuF^2G-DBJwyL*8%+OAxJM)7`mrs-^~yB;X9rT+(M;bG7}~Du0>;kpWEh^W z>*+c_J{XSHX6XEfwg|^7(r}y!gJx-=kB%Fj?pc|36nnRhW%3$_!^FF<_%Y>yD2PJSR?zVPC@7+ zE zE6q83aP2h)k;l4JZMCYkd6HQ*Y&Ppn#`$LEKS-DC+QP-$RYpc!-?Me!N}pWe-eZh& zKJmObM$!`(5LUr33YLg*Mmq+Hi`;Y3OVrek%*uGodT|bl1yH-z#sbE}+Dc13P!3Z= z0yMj!m;jmgOHiqF;v@Nd9$!atdOIjxM`exf7mF36?75!i_~o+Z3)|J;MA@2IvAn=@ zDrKXRF0qPIW-NU?Q}!>$a*JIkxbj~u^o^62D5UY)HkUEfkqhs_qAy=&0;-TM6& zu5P%#gI-7dc5Tb`Y(u24%%2!RRAQy9cV z5Y+N9MN0GKN9RElmq#pml?Qgg@HS&?|F{g=19!3^1L(=r^xWk5A?V4b;%XSa={drS z?Vf2`FocHVij+9Wpt$yqKeNl>e$`f|OKmodqG0I-BR%{y(D?JM9VFFpp*T3I<|L)<^8IYz}6|4 zaP!m6#z5G9hrr}Qz6BjRs6E)u96d5MF)l4ZUd_!n=2cB=Rp)CUL363z%(47li~HC5 zQ`u`$>)K}60uKRa$7H+UJ22Fim$n8sD8{|(b&+irA^|dtf?vRBKk9njQwjO~24iez zV>~xGF*7rE1jC-Dl@<{SA&m3tt z$+0lkU~C}PlJ2DT^Zg0dyHI%vP&rh`@KtMTvnvg(zb;`BwAu)o?HiY>4}|5L)LrKl z>&vuWw{mk%L%Del_M$y!&6yA@!^TV;@+SN5TDe^uUQpP5>G<1HH}KPniVBu0A5HN1 z>&#;f=jFAX`9Z8lsXX3v-eL_KYcsG^v5kuQW((W1dZ)u@jkh+>cPk zPC&GEfyMg{a{+*>lc`b$;qO-y{C$r3yEl!$tMio`)T!xNm6SIu59PDog69)osH~Yk zLSP-;@UdV-z48%~vk*;oyk52rG-pfqS)(~RqIGZ_d0=<2xLhzvXN^uCgR#LphE3zE zh3T8^BQ}{pK=%jc>m<*+2;(m^U$4RE9=%QSb!K>;X08bc#Hn;2+PcbA+i@`o>t*Wb zx|+&Ur=b62d1@H0hXtl+Z7Gs!0N{A;z&w4Gd3xr|BTwBAo>GkFOADU~s6N$IxAU>2 z$?ucrNN&kj`SFnD9A(FvvMnmxw{0hi|0;{Yd`oFn-yP-~3oETE(m#}iax;JHp+gas zWO{0LVro{KJ$Za0IzK)(8-F-_VtO((CZNo{sII%aPISxwR5)Wn@LM@~%N zaeO8^JbvQn^ogUhC!>QC6Ne{GOiUe`h`(F&n3+3ny?x@)Y;+wz`7W(j8uz-# z>`l{m*MV|aSbAiAcP-uXok%tYuv>UCW@A{Y0~UJH@xk z8jGYKO@6tK+GCe!j0rn2vKx53*?Y8BM1se@U4z&P`E25)iVAirPZI;V(72bz-_dkQ{k6OX$Fdm9dSDWo+j6~I?ppmCsrqxfac5}JZUT%i*sjzlBT&y=jrBQE~`Q>VP zG5%C)i1ETN5mnd|a`g0Ng&dv!@va4Glm z3Z}o$&v}yRPvKh9zxU(&j{YsQmlijyevYjo&Lfpls$b_>>*=zZt6`-NYS~G>*NRcz zxyFIT&Uwnn&tr)Y>YqDcdBV2sz|b(`uV{!H3e69_Kr0!RU)0^Q@B4|2t6OqOYvE(9 zUwF}(y}8wd8R~7Nx)=`Lo{scx#NyaK7C|hT7(zP_Y-~VC*tE#td@ipjSAZwdJ`zuF z$DW5actpOqJWq1;5b7A}_n80ZGGBk01P_= z%h2F7`_ipPf5`p&lSDt)(<2$@kd$sCTpmH)kT1|Nt8z^6hY}Zm4tXC)Tf;0~!a|ws zqI-}f+j8DVp+jhJmaM$MvLeUUFXA35e;<>MZFzHstYEqj6-nt}G+9A#ehAxQ2-p@! zw{;6Et}?yf@I2p6mzCYXZO1bmud|8<9zP7;10frDSb^kq-NmqUcUc> zOv!aSi24@x<^L9+sr*Asls)X*onT5B9z@%Q(>KR9(&lx0bA7$Ad}F==#BvAhV&IFC zZfLF(lr>AZhE{Y-mR2;vz$gkcwDn*ePt0+gevWy<6N`VfV>bGGV+Mv24&uJJ>yDew%soBc@h3|*`}q5NqqB+6_EFukp1X<7@ta=||3spZ)2p z<7X3obpVf`M~{kkmYL#6359TSGDlY?=c-j?@wTg#RpSsVF1AzkhJM!mM7`7w+Zy7^ zVX&02B%NPn0}}o0bR(?crxPn*OYs(bSR?*H+cg~nI|=A|3{Fu-U|0C2>(NOI(fNvQ zX*BEYdZ~_BR}z&Q$?PSrOU93@;oGpN{{J%PN;IeF7{*(K&o%>zm<6mJaad~SNE_4CP*O-$2 z5H63R4(B5wgV@HEV59aQGvi;Ow!OCO#L9zjE&M!S=CMEV|bPA})E z|HA$MZ>9tf`5xD2;BqhHx5!lb9{(SKIlA`{_3#ctSW!OCRPu71zyHVhYvn6U zB~K)!(+5$H@cqxw36y7JqEwjYZKlM_KThQ(M_b<+Z_dcKqm{YT1-aY-zf!RS$E;{! ziCjO&D{EdcG_=qumhpBDY|`-(x#=zvx7ymiR>GRYf`)BlezIn}M31)- zjVYhHBRGRaf~+y6JO1}WX#<(>bVxQL%XZ$&*VEn}DkNVdE5rMy$OBQ4Za9SPM7E75 z@cNu6*+y=5(7R`Cu@Cm%i|-DeyD}RW8OxFDB;RMnxrUu9iAz?z_+GyLeM~8~Ga4?G z$*Ur;GXyXWa$d2iCK^;s-l&j)%ey~uPhkB_HZI?1xwwGs%s(;Tzs^+Rk`=qK`MR5# z?qpmZ1s!gjFtMr_t6Bn?{9I}I1gsRcX=#Xz~Ma)~9%-=cL) z!jH;u`#HcTEQn#TpVon}>zAT89=5V(A@!=xhE{r zy2hSO`MJQiPYa;Vlh%yw`=MYz0(yU-%uBX|iwQ-7M+*0H{0Hp^^=zBHuTe z`jQ0rJsZoBMi9Wq{(OYmlg&;#*77}@a?Oxks!m^Idnhh?5S8SEN+*vtBS(6xf37ZOi-_;bG4U0=ylQ z9<|yX)}L|E*B+bR>(8i^TV4$o7gzSOWd}$Uv)qG9V*{1--UTFoL;5mF9;>)F>C?zO zT$ykCEGa$8D@@7$kx!G$u;~t8cbq9bn{4{;pbj?=M&!d%@w$b?ESNs`p9v$uJwwR4 zj5_t{86MQhreE@**rx9|i}H_7c@ENY=;f%9{2O=!<+}U6dVLzmzq_?Q4YKplTv|L% zG}{u1Y~w+E8uHtuZ1(YKwp0hY{rYD~Kv3u%2UMgEWUVhaeBBt+(dV%6BZr;CX2@BW z3PgR9x=uRqH>?A+HplLqgeCG1HpQ>Eb*xsHcC?CsF#wrJSapy0#cp&Aup%AU{4rpi z{mcl&V#Q_EuaBDTB-UF7(E$Tk_vk>%7!a+sZYO2&MykdKKba;!CAEb$aU6{h7-s1 zA^Wa@*Oa;I?fdPu{}x_|SwQOFX8S+cvX3Mgyo-_|%WVInX8S37`8P7BP4$1$=d|ip z$$xh)!vC^9$lL@e|5>>RGM7oNEmP{_Xmi?Vy?BU)0JuLHGS(&jk?ntl^_ArRk#9d4 F{6F>47;FFl delta 4621 zcmbVPeN0=|6@Smz1Ums@gM+a#m?Ud!5*t5%Vu%UG2F8a&DCyd1Mflm6Ku3XKsw!2w zIvrA@(JHgfKWVBgiQ2X4lt|FDYPMBd{;1StYouz@)~RZwA+1xpB~vqX|4f^*bKVEO zj+oZHBM#@D`*D8veBAr4Z~uy4JI%ZKDxTZS2O+7_OnlL#wWx=U`0N#p~cD-9TCIm5K=V#*9wT>Ai-x z)%lVgw`8Z);Gh|XVFSUb*2Kzo>@8N_-)n=L+Zv>iCg7{ux3*}MEEWH)x8}7uqEhjEzXH10J1fOkhH@v6LLGSMDIEbq~)#cu$YPt+MoYe()o9*yM zjk~lTTq9a-V5qj~O%%mjwZn$@8H2nzAuWwT+}H>ivl<+aC4x(HmKGx!9zw1z3iWW& z(q*`=E|>Nkf%xub__)rA`!YM5p|0M;pv!#`s~dLi(8H89D1mcu&YHkXQpRw`t^pb~ z{t@jGJu2nH*)Xs<15*!gHMG$z$u{}aW;!%FnMx+mtCArnm>T72R1zF)G)BsdOxxwr z>(Xe*?9$8Q0;bGOq9Djz2Ub=3Vm(uKZK8%VK6O=gQ4zmyRzk&o0bkUj}F7 z-Kuj^iXu?d*`5mq0=|IY^?QYIpd%ziqS0_5)X_7ykQL`<7V^v8COS8F4*kY2Cnd46VU$%|M|q;|OPAi^Ij$btPpZa9 zT5i56VqY1leX3*!**>++?CG8!Cs!epl-jWFZh*qKn#ORu-9PvPqoSE zIKF@aH>i{L&N?)`wD9Ep4o%OANAqyzQQ!9b>@zv<;>_{a>@9^6Pt`>ITP4L4pIJA!_dv?@G8CGB#VHd4usRc&Ln>t)(9 z#;jze!>DS!WuNi(rba$o#)2x%OmAnky*pS6AW+Te2>dwK`pIT3Ydh%HUB)SJypwVIH{ z;JoMI+~VAE&k?zV%arll{8VlUH&bQjxDzPripLVsdTbC`Wx?%IWP>6x6B1!jazpra zUc>A?hVInCMx`5G=k3DRwV>v^7RWSmULv-!o~+ z#j{a0T8>T`3pp$Z;TRJI& zG1z@DBRTU4K_HR%10vmKkRE{XolXr^cJ82*9YpEu$$W$EmVYrQ)f=m67v66x6fzw1 zBGT`c~z9J+~`J7`dLXyxI&i-Ps){J>c`H$TRg zk{Y>{E02hK@$)9zmfami@5q)N&=yj;OU& znUa0Dz@Vi6IW2z0plI>oWQq_rQnC-9GS;6*>kr}M<&u0qVjljctF*Y1xvb0Y^9wFt zv@;aw6oSz5fOT5>O+&F&F4+J23M#vzaef@xpnL#qihN6{wNDg@8{oc)ybso+4Sgfn zB2p!_dyxO4tggckEs$wY*lCpsOC zM1^o>Dk6r!+ux`QhTv9g&x2nR0BXDa2Yi#^puZy=jYdj8O@n?RfWU_aM^u)7;JvFn K_sKPS*#8Gi{rl$t diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/dovecot.index.log b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/dovecot.index.log index aabe25693035edbd49ded4b0653e8212ba788dbe..bc9ecb43538ca48cd1de14bccd70c85f82c621fd 100644 GIT binary patch delta 1646 zcmZ8hO-Phs5T4!E)qadmSIsip&vjQ<*S0iUt+ed_zaS(QlwfZiEG#^92wlji!}cR@ zgtt6+=olFh6;Y=m3L-pgAdwf5eyD>7iG`YH#`N8m{oZ+J-uY(co#&bFeoyY)gIsi( z_w0oE6TMJ=v4AL@PG?*qr<=l*9(|aqHX{uIGuGf+c-o8KzWzn{Rr6D6QiW?g8;r*n zFiw4?e*@cQ_nX1ex&mygO>_L=wk0xWC!;S|Fzr`SwB3R-#>>n|JS{0dQ#6ZV*| z^&yjNj14^^FF79e<@eZ&Xn+;2mOgli{4AT;SjcjijYTZ8Y+MdID=T1UWhKjZtgK?` z@KVgOpO@9J^Wv}!^HRbx!%Hd4EH44-CF&?6DrdtTUMg7Tc&TKW<^`9^^0JO)YZVdy zX>>gi|LHQ{8lCEOiO_)7kX%q2fD6yX%!@#UCnzoKZw#1wg#~_eWgvn!%J!$v-1H^l zlOMH@I7KSEkFKR7?7Joj>)K%p;M8qKitA<90C2YDvKka;sM`)&W9bMwzEREvoI@rR z3sqfbT;y7BVx(9$DMsxZjlVHe?8N1bYqx)}o0;}kF;}L8L2ojS8?FAba3dsNM`p08 zr5u<0rFpIbXy`%n${+B~$Hl>ALsG+v19Vp$x;L>y!uv9APR9~MvzwJE)T~VT(xOb6 z-=a)$wklJi31v!Gn=+-lU76CiO_?&heSs+*%9Mef%9PA5Wy*M$GUfRmFokGxuMlMi zecz`{d2&FR;v80{M2{$ZT}QR!$z#ft{^QD&>nF^KwH2Nk8#+Ir7&{3@RAYOK>CH%G zT&@L^N?#{Zu-ntx-g*9$VvCdiv1J-AVhwDExlJ5VS_=OfGg4CKX%-fR@=C#*qo-uX zu{~~fN8930KWi#jKzk0gIODaJj#TLu0TQmg$)&8&LjvSfi=?g1ON%IdNtp?3y+tw; z&t^0)Oc*meFSlh;N8U$UBy2b@ES&m!BrLY`GHRUI8_{|9x8{Py<;TudZ|TUD<#GC#3;uP; I<;$`4FGN%?m;e9( delta 743 zcmYk)ze^io7{Kwzc-2#@Mx!>hQPXh67=ML8CA2D$wo^qMG6XD=Ze0or4i2IRI*7Q) z`3E>SC^$%QaOjXx!9s`r2@WC(2Xz$e_sP>zL*9JvF7Ny1KIHDd9?Tuzr)zI74ugmE zV(0Hh5#RT>lOoZgcp~$MpL>FxfmpCN;QSr=k&iz@(N_;6&S1qxk`-BTr1#Nzfpa$# zTo0$3hceY^>mqJ65u9gc*1kzZqBYEBCG$jnGM+FtxmZUF5s`X&M_syKE7CxVOy)Ml zWpWceqEG2Gi<c>EuG0UAm~pF3NG(n`=?CookFM0xV6Zhhwzd*8&oNccB~?$n!#vYeJw8>>302P(RZoI@QqL?^ z&jwY`DOJx6RZo(8R!@=g6S7J9>aBd|fVYHvsKy@d>{iX`jrt*0ZRCPIIs`99* t!mO$MoT;4GrrI5=swTwCo9fFOQ{^X2bv9|LQo&SLQ>I#eXDauD$REd?UzPv> diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.29 b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.29 index 58ed0a3f92..2bd89f3a4b 100644 --- a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.29 +++ b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.29 @@ -1,67 +1,44 @@ -2 M1e C61a9cced -N 0000000000000AB7 +2 M1e C61b36802 +N 000000000000054D Return-Path: Delivered-To: default@flowcrypt.test Received: from mail.flowcrypt.test by mail.flowcrypt.test with LMTP - id 6c37Fu3MqWFABQAAc/RpdQ + id F6uPOgJos2GyAwAAc/RpdQ (envelope-from ) - for ; Fri, 03 Dec 2021 07:53:17 +0000 + for ; Fri, 10 Dec 2021 14:45:22 +0000 Received: from localhost (localhost [127.0.0.1]) - by mail.flowcrypt.test (Postfix) with ESMTP id 5AAA0445C2 - for ; Fri, 3 Dec 2021 07:53:17 +0000 (UTC) -Date: Fri, 3 Dec 2021 09:53:14 +0200 (GMT+02:00) + by mail.flowcrypt.test (Postfix) with ESMTP id EC1CC6C1E67 + for ; Fri, 10 Dec 2021 14:45:22 +0000 (UTC) +Date: Fri, 10 Dec 2021 16:44:37 +0200 (GMT+02:00) From: denbond7@flowcrypt.test To: default@flowcrypt.test -Message-ID: <433031.2.1638517996358@localhost> -Subject: Message with Pub key(has no suitable encryption subkeys) +Message-ID: <36760296.1.1639147477268@flowcrypt.test> +Subject: Encrypted + NOT signed Mime-Version: 1.0 Content-Type: multipart/mixed; - boundary="----=_Part_0_64286997.1638517994213" + boundary="----=_Part_0_143475953.1639147477209" -------=_Part_0_64286997.1638517994213 +------=_Part_0_143475953.1639147477209 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit -This message has an attached pub key that has no suitable encryption subkeys -------=_Part_0_64286997.1638517994213 -Content-Type: application/pgp-keys; - name=0x58DF2107B952BA3721A6081AA06BBF82A207B21E.asc -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; - filename=0x58DF2107B952BA3721A6081AA06BBF82A207B21E.asc -Content-ID: - ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: FlowCrypt 1.2.5_dev_125__2021_12_03 Gmail Encryption -Comment: Seamlessly send and receive encrypted email +-----BEGIN PGP MESSAGE----- +Version: PGPainless -mQGNBGGoseUBDAC+rKhZ8nrDsrKDRh3RfSPywgPk8hnOFPioamZFrn/cySgXAh82 -9gWewD0YezSlnOFd15rf86UovHo0Sk5pVyaeAV04s8Nfc2sZZZDayFr232/mcK6L -IM9I5UxirEzSFSHPdV+zCjr9v/6Yn5m0agc16g6McmHGmSnOLyMjy9Hg9gUCGpMg -ZYXSab8NGEaYy6Z5ChaBjS/l5ZyezBU55/+7cHkIAHYUxmDdY1po+y2U5CTna/Ab -XDnlXCfhtnTDpKI8q72DDINgF9qEyJzWOX3uiwoyWnLUpzmeFGWPR0UsbP4e3UdJ -rqNzbFXNLNJSN/EQ/2TGs1wbyQ20csUoEiuA+Y14vn+Kc1zjo4YRIB861pf7yude -BsNOCy+37Jad71DL7FLYsBp7/fhG8u+9JCA1evDBh7FvXJKma/1tJkD92lWXWVUc -qRRZdO84AQXpgXEsJX7DCwlNy/bBmwDXgK8pdIWfDEcB417eMxC3QiehzIVjsg2Z -DeqgGVBqBZ/4GEcAEQEAAbQkbm9fZW5jcnlwdGlvbl9zdWJrZXlzQGZsb3djcnlw -dC50ZXN0iQHUBBMBCAA+FiEEWN8hB7lSujchpggaoGu/gqIHsh4FAmGoseUCGwMF -CQPCZwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQoGu/gqIHsh4HeAv/eHWD -eaKLHy0W+p34vl7lobZ6ndpZekCdP8ve29Mtdu46CS7W5N2u5lTEcd6ir+tq8WB0 -6MqZ/Kr6o1HsVDrsrDeH4pQxN6FzuIY4uiPbySsIBvy6ZLSxjO7U1dayfA2a9BIG -nJd2W9fYIsyqokUXdX+0m+SoYIVglLUvEJZbZNKI4oNepRU73gyKMbU9HQN9mvPR -fCpigPh+xPoiafgwF1cPDl2drGcBZOE5H7LTcyIFKqH8sFMDiZRB7Werq/uFEx5v -k2iu0D9a/cZGE+UVtoVok0rAFGi2QtRixDcfe+wq60UfjCRBObFlBUgvl1HISlWE -0C5P6HClHqqzhbr8ZbkTvNqeR3ae2Nbiy1ImV8uLdRNZFrtOgvtFa6gjszsGE0FX -wRtJP9ayy02yPrpMzMkv34ApEy5+07wORTbaCsaWdzKsYOJIxlmx3eBATrgNjVSo -Rt0qgcuC6CEmV+jmAWurIFndYlp/AJYyJZ9JYm8JlBJhltkcDSxyhZrUYof4 -=0YiW ------END PGP PUBLIC KEY BLOCK----- +hF4D16Pe22XLHvsSAQdApkbDtf6GMhbUdIG8lbA1xVidfOw1xw90yYMKSeUd1lMw +HIPCm32G4OnJFEgSodLZGIjLXAR98YlPANHx8CI12avC5FzWQrbhegmdhnHzw/Ti +hF4DTxRYvSK3u1MSAQdAur1cw4tCsoeoQm4vzslmw+Nr57fIj0rkhhzVnaM/IBYw +MGUnTXLXmjvVnGKb5XZHmpkybOFMtXrZKvddQfJ+uY5BAevGDCCLeJySGceMbDta +0k0B7jC+C2ZeZdJzFcvzhotQDWSM2YOvRNKA0BkMyVsJabUKY1xExidzBQnK5HSp +Ru9HZjZJZTsBnbji9GwvfvgMXlc9LxP53hLdW6lszA== +=xJjg +-----END PGP MESSAGE----- -------=_Part_0_64286997.1638517994213-- +------=_Part_0_143475953.1639147477209--  -R61a9cced -Vaf2 -Ga16d0d17edcca9614005000073f46975 +R61b36802 +V571 +G892aa93a0268b361b203000073f46975 diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.31 b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.31 new file mode 100644 index 0000000000..454af1b80e --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.31 @@ -0,0 +1,42 @@ +2 M1e C61b368df +N 00000000000004CC +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id Mv2+B99os2GuBwAAc/RpdQ + (envelope-from ) + for ; Fri, 10 Dec 2021 14:49:03 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 1C4DA6C1E68 + for ; Fri, 10 Dec 2021 14:49:03 +0000 (UTC) +Date: Fri, 10 Dec 2021 16:49:00 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <124374216.1.1639147740952@flowcrypt.test> +Subject: NOT encrypted + signed(Inband) +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_176969482.1639147740896" + +------=_Part_0_176969482.1639147740896 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCV2WKHzbNaPa+cYT2skMYCAZ4l6sUJxZnpeaoqChmdeUmJeiqZCfl5O +pUJuanFxYnqqXkcpC4MYFwMbK1Pi5ow7DIqcAjBDxBRZDqZoXGM8bWneeT7xCkz4 +7ENGhitGLy5tuiSTY85ues+ItWT7wT2CITKucV8OHVkQ9ePp+xSG/2W/Nm2fzvZ0 ++k4VL8PMqSYF12u0TkrKFsRfvRAooudkzgQA +=c6F0 +-----END PGP MESSAGE----- + +------=_Part_0_176969482.1639147740896-- + + +R61b368df +V4ee +G195bd507df68b361ae07000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.32 b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.32 new file mode 100644 index 0000000000..4628cade32 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.32 @@ -0,0 +1,47 @@ +2 M1e C61b3691f +N 0000000000000601 +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id 7exvFh9ps2HaCAAAc/RpdQ + (envelope-from ) + for ; Fri, 10 Dec 2021 14:50:07 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 593256C1E68 + for ; Fri, 10 Dec 2021 14:50:07 +0000 (UTC) +Date: Fri, 10 Dec 2021 16:50:05 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <80534408.1.1639147805211@flowcrypt.test> +Subject: Encrypted + signed(Inband) +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_85360913.1639147805127" + +------=_Part_0_85360913.1639147805127 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdA3AUBbNBYHs7uBkHYPB2MScrOjyjr8H3uUHD/oV66NRUw +QwHSwqj/w5Zh1TIyCNPrL+5CHKw6AWoxf/tueiN7k18lxhrrrK2G4YcmW2IxhAD0 +hF4D16Pe22XLHvsSAQdADdHH+j+A9Vl8dYDlQLewJrBsDqoLXtL3C9qvSVBXo0Aw +zxk+hWPctb9Zuu9kexEZao2sA7CkyQIVuoX++toxpuUH2cnM2tMx2wdOsqk/b80u +0sASASXoL13FL1aRfUmJti8FXjwK7pu7sR7EOXq1dqVfuDRWT1PICa3cJRvTZbe1 +jsePedNvt74GsllnaoZykqcWoEfiEL0CvU796P60+CBpsxQ304rO9G41P1a9CtvR +OTAwOd+ZcfypPoNGQuw90TY/678yq03RROZMiZvHa96UqYPHjdo5q/7RjZVVde7k +JGplAW7C9+93vjJ8tl328hYItBpPF26dQB+AHMIz/AND0MwbnUEdJyPs9AGoVeak +xjaRjpUqh3BDc+mdxXlztNVdmRFQ +=YZEj +-----END PGP MESSAGE----- + +------=_Part_0_85360913.1639147805127-- + + +R61b3691f +V628 +G79aa80161f69b361da08000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.33 b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.33 new file mode 100644 index 0000000000..fda31d5979 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.33 @@ -0,0 +1,48 @@ +2 M1e C61b4823b +N 0000000000000666 +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id UYGVDjuCtGHuDQAAc/RpdQ + (envelope-from ) + for ; Sat, 11 Dec 2021 10:49:31 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 382AC7E0A60 + for ; Sat, 11 Dec 2021 10:49:31 +0000 (UTC) +Date: Sat, 11 Dec 2021 12:49:28 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <83587077.1.1639219768957@flowcrypt.test> +Subject: Encrypted + signed(inband) + bad signature +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_10768010.1639219768882" + +------=_Part_0_10768010.1639219768882 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdAtdnv+F2LD9GVA09dGxdtNXp9XOUNildn0KoRRyfS71Yw +oz40WsLIOFiq24WAnkZaig3mh3ZIZPH30CpNG6D50xJgH87vhlHr8KMc/UKCD8HT +hF4D16Pe22XLHvsSAQdAdmfEzaR46pX8T/DSVrKmGPlxKWaS/GYPCJbHwa1/8hsw +QpKP7zTwoRGg+OC01wgviQjaHehQ5PHCcgF92js19ipqeK0nZ6NumYBhuReeTn0j +0sBPATC6XlUcftJVv3oydls4C8Mpu+KK+fFvsgaZY5QeoLttl07GfRQMqPhpb6wb +5sEKrS0QTpxzAth07Ow22cETz+BYbxkVmbube82CBNwkiv8jF05expxtLdAUTSc4 +p9/hKUSFAXP/a4x5ce7ImZ8IeBftDfD1UjCvL/vPqhGfuPg/ObAPAIk4vs6K8yGW +0ub67smJCF6x3rTeYWJHtZA2w3aYX332klhyWWyyvq4EhfkViNCbch0gkBvrqxd0 +hIoSRW4Tg/SzbTNbwvoojwB4Qn/NKj6tG+/NCXsNoCaAW24oCpJC+J5CUUbHVH3O +Ru2kYMZ0/G0F3zplBJ+UdNl3edCVuOsYKosqA251SpbBhw== +=52uO +-----END PGP MESSAGE----- + +------=_Part_0_10768010.1639219768882-- + + +R61b4823b +V68e +G9916ac0e3b82b461ee0d000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.34 b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.34 new file mode 100644 index 0000000000..163bb04c2f --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.34 @@ -0,0 +1,43 @@ +2 M1e C61b483d4 +N 0000000000000529 +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id DceBDNSDtGElFQAAc/RpdQ + (envelope-from ) + for ; Sat, 11 Dec 2021 10:56:20 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 2FF697E0A63 + for ; Sat, 11 Dec 2021 10:56:20 +0000 (UTC) +Date: Sat, 11 Dec 2021 12:56:17 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <106293212.1.1639220177972@flowcrypt.test> +Subject: NOT encrypted + signed(inband) + bad signature +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_141207675.1639220177900" + +------=_Part_0_141207675.1639220177900 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCX2jaFz8aOWw08ZT6cnMYCAZ4l6sUKiQlFqemlOYpFCbmpxcWJ6qkJJ +RmKJQnlisUJxZnpeaopCeWZJBlBZeVF+XrpCQVFmWWJJqkJ2aqWeQnBqXkpqkUJi +XgpELZBZlKqQkpmWllqUmlei11HKwiDGxcDGypS4pfkigyKnAMwNYoosHXsObGz8 +luG6RyfyAkx4oz8jw8yK2S9W5S19cGL2MsGt7+3eVS0MPiv4Zp367xdLbDUKb0xn ++O+T+pZxU/QMpfK1GqsbxbL2eXkEq9kvZjlr4FvM3tH7kBEA +=BWVd +-----END PGP MESSAGE----- + +------=_Part_0_141207675.1639220177900-- + + +R61b483d4 +V54c +G01c0920cd483b4612515000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.35 b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.35 new file mode 100644 index 0000000000..c3acda2d89 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.35 @@ -0,0 +1,59 @@ +2 M1e C61b48f10 +N 00000000000007CE +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id U5V7IRCPtGGABQAAc/RpdQ + (envelope-from ) + for ; Sat, 11 Dec 2021 11:44:16 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 85B8C7E0A66 + for ; Sat, 11 Dec 2021 11:44:16 +0000 (UTC) +Date: Sat, 11 Dec 2021 13:44:14 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <18216133.1.1639223054277@flowcrypt.test> +Subject: Encrypted + signed partially(inband) +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_233169424.1639223054262" + +------=_Part_0_233169424.1639223054262 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdAk9cJSvMdCEy720HDusXhkyPPueKN/lCJs7a+9ZipNkMw +t7kWnNV1GPawCh2AO4tsQAglt05gXfMVp6KZuobhOzAo8ejsFZ8l6NrmD9GkSKgk +hF4D16Pe22XLHvsSAQdAYZljKw41PYIeGNnPxbXXj+fMEVZ7r95/jGx24PiL2nsw +2mxZJ0IFqejwD1EtWWHGdCvQJq9hRE3xGUqG5KutLvFP70rZr7ohNzEZW3g8hIl7 +0sAOAZdOkq7hFd+2edSp6QoBo08lCtGPZ99uWjZMJ2O0xlrzXQHHfiKo29jLE4dd +QSLDkAEe6NFeGxFFtETWipOL/a7spfrSuGhC6irfR6kVVlvloMDGJQqdMyaJx/6r +JA68fo+lcMeN198b471AMPnMfzuhh5UnudeKfTsP4G/phi+PFPdVCyvbCPVCfzC/ +1SwnbFOfc3HzjDqy61i1L44qDuEIXe2DKQqRvKOcWcUjiHM5/v+oGaqTrzINmvMA +XoGVOoniX+yu/7XfbhKbybw= +=SzXS +-----END PGP MESSAGE----- + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4D16Pe22XLHvsSAQdALlp3UOL9wBsSRF3uIEH5imchVNuITE2KqoJdMtKRq1Ew ++1jecnPqy2r3gsk2ixXt53R/oqyleCaCa05WwQH2jvOlJBLYDSaG0nvPTXGYhFD1 +hF4DTxRYvSK3u1MSAQdAxmUBg1MOvPSKFfVE5UraFUX5hzEIOo/IBxoGt6mfTC4w +DihowFXP5XlePFtr3z7M/R00Wkmw/TAa+fukqjLTFrYIuacQW1gTiEYfOOif8V4d +0k0BBHpU9I+AK/yYkkSdhW3C4JowbvOYvOFFtq5z+2/4jrZGgGmiydLBQ+ASCJTW +5LoxisOo1ZWXU5GyhEsUfGWomTmIqdHPr6QOxEZmDw== +=jl09 +-----END PGP MESSAGE----- + +------=_Part_0_233169424.1639223054262-- + + +R61b48f10 +V801 +Gd1688c21108fb4618005000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.36 b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.36 new file mode 100644 index 0000000000..9f186e92c0 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.36 @@ -0,0 +1,44 @@ +2 M1e C61b48fc7 +N 00000000000004D3 +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id bfJgJ8ePtGHDCAAAc/RpdQ + (envelope-from ) + for ; Sat, 11 Dec 2021 11:47:19 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 9DF3F7E0A69 + for ; Sat, 11 Dec 2021 11:47:19 +0000 (UTC) +Date: Sat, 11 Dec 2021 13:47:17 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <134516345.1.1639223237410@flowcrypt.test> +Subject: NOT encrypted + signed partially(inband) +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_104860116.1639223237396" + +------=_Part_0_104860116.1639223237396 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +Some plain text + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCV2WKHzbNaPa+cYT0smMYCAf15OpUJxZnpeaopCbmpxcWJ6akcpC4MY +FwMbK1Pilt7tDIqcAjBdYoosB1M0rjGetjTvPJ94BSZ8iZmR4cTMG9aGhvM/T7z3 +ceaf7VPS4l55x0m3eXiIXqm71HX8sQcjw7/JfNKsbvpM+sH6siuTFmrfPrjCsp+J +VTNI6HmdjMpMVgA= +=4Gih +-----END PGP MESSAGE----- + +------=_Part_0_104860116.1639223237396-- + + +R61b48fc7 +V4f7 +G317c7727c78fb461c308000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.37 b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.37 new file mode 100644 index 0000000000..4c03f69d4a --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.37 @@ -0,0 +1,61 @@ +2 M1e C61b6e8eb +N 0000000000000891 +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id hynLJ+votmFNBwAAc/RpdQ + (envelope-from ) + for ; Mon, 13 Dec 2021 06:32:11 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 9F6B67E0E3C + for ; Mon, 13 Dec 2021 06:32:11 +0000 (UTC) +Date: Sat, 11 Dec 2021 14:47:14 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <110314482.1.1639226834163@flowcrypt.test> +Subject: Encrypted + signed mixed(inband) +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_150365359.1639226834147" + +------=_Part_0_150365359.1639226834147 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdAyDv4lT7yZwY+k7XTngGbM9R3TSIDfJ05jjPtP1tgVhww +Ow986yKDq8RwNwRuOP+Zetgzv3Rueds53oH6WubsfFbkfqDddSuxbivSPMaJrsEa +hF4D16Pe22XLHvsSAQdAm0JxdCnyvGhOwCeljYCmXnnR6bd7sfxTpHbiBN5eiUYw +vXWpjLvybfnbIwMFOkYJY7xLi0nbiMG4GYKTUzy1UZYezPlig0CN65zXmQtwSX+I +0sAXAXZTOnpBBAC7adCCn98X8ym6EhabfV/Kxtk54zNP4/E2tEs88G3eKRHAcFYA +dsSRpd6fbQ+Od+2MxRr29gKdH/IMk+zuhg4K45HEu24039/1KyV31g+L35A9764A +yxGwyMw816TcSK4Rfx3ZdRc4gxRy1chCLf9QDlTowDiaiAk14ntfqqUOZTUj+OcV +80bEHI8VxTs1KPgqHvt0dOkSQBJzLk/4OlqOhoRBTJq2TBaP2iBlO4/MMKlhG4NG +ubaIKDKh/tfhMteAfWE52yiz3htm980akzc= +=rudy +-----END PGP MESSAGE----- + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdArBX9SbPgfhP9wqWOBFvkfDKBxszXMVfDrmKr31dNOh8w +tOprLXmSEJw6YwEIqAXByU/olv90UG7sEmIkI7J6AEmyFOkSDokJPAQrpU9Umcum +hF4DdhH7TgaiP74SAQdANFfZyN86QhSBkh5ywThUC/nNmQlkIUJ2pEuCF7IEKAIw +4xVCdmdRlEltVVP4K7OnGme3nQEmnANDXdZ69HQJYUSMsgFWB3HkFJ/iqM4b3TNe +0sAXATT2v+7RWASJS/tLN1a2XEMy+ybwNremGO0IPo8ji9EQOcFaD029OvMdq2C+ +AHXxBqmi1hcnn2CuLVyAOWh5bj0VJSKuMsgx1yDMpYItfuhTLs0dQ1JA93dJCfi2 +7r6ueKx5eDv5y6hr3thNn+ctOF0r7CDOZWtE5oznOErmmg05Q+nGMJzN85kGV6mj +1cmYEq6/sVjYf6J+iYFVkywdY7ne+FBHjJ0cX4JEmvy4SCfO51cM+cGzFtup+a6P +afd0d2jaJS9rkgbmS4VMtGIlfrCMIOhl6ws= +=1cM4 +-----END PGP MESSAGE----- +------=_Part_0_150365359.1639226834147-- + + +R61b6e8eb +V8c6 +G411be127ebe8b6614d07000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.38 b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.38 new file mode 100644 index 0000000000..2ff30ba582 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.38 @@ -0,0 +1,51 @@ +2 M1e C61b6ea94 +N 00000000000005F3 +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id Q6lDHJTqtmGyDgAAc/RpdQ + (envelope-from ) + for ; Mon, 13 Dec 2021 06:39:16 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 708E07E22DC + for ; Mon, 13 Dec 2021 06:39:16 +0000 (UTC) +Date: Sat, 11 Dec 2021 14:54:18 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <178316538.1.1639227258998@flowcrypt.test> +Subject: NOT encrypted + signed mixed(inband) +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_254081431.1639227258976" + +------=_Part_0_254081431.1639227258976 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCV2WKHzbNaPa+cYT8snMYBAcGZ6XmqKQnlmSYZCokJBUWZuYlGlQnZq +ZUcpC4MYFwMbK1Pi1uf+DIqcAjC9YoosB1M0rjGetjTvPJ94BSZsw8vwV2r5jx3K +D09YX2YxmXdpntcL7iO8J4vT5asfPUv6f+iMRDojwyG9s+lHxOMUJ60VP6tl/sjr +Kedlni+bmO2MptWmXQj0YQMA +=usCN +-----END PGP MESSAGE----- + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCXWaL/vvdiErcGMpxWSGEAgODM9LzVFoTyzJEOhJCNVoTg1OT8vRSE7 +tbKjlIVBjIuBjZUpcevzDwyKnAIwzWKKLHfMHwmFMAmaprieNocJp/Uy/A/MjTzK +N9UkpXLTg0dXFFasM5wQxT93ufHj+o9hhzuO97YxMlwwsG+6lNHn4xkilcwbmmhx +/ernRzJH7rFaPLM7d/zlHj4A +=Yz2p +-----END PGP MESSAGE----- +------=_Part_0_254081431.1639227258976-- + + +R61b6ea94 +V61e +G410d551c94eab661b20e000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/Junk/dbox-Mails/dovecot.index.log b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/Junk/dbox-Mails/dovecot.index.log index 75524163a0764b6e19e3a4d1f8e7f81e6498c344..194df4c091ec555cbd31e2ddea0504ad12bb6a89 100644 GIT binary patch delta 12 Tcmeys^nqzZ4kJr-=H^5IB2WbW delta 12 Tcmeys^nqzZ4kOFkGbz;uDcp?LCZM&HQ>OwuAO uEI{30&;X?w87D_GUD6KmXUIq?(sOcl2Gc-_!GM{8K?0~s7^+ePN&^6}lruK~ delta 85 zcmZ3(eT7|&k%N&z;A&Swe0)kGBLf2i2w!2|C|1YF31l(M0rG_>8j7G6Dc9pA}>P diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/Sent/dbox-Mails/dovecot.index.log b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/Sent/dbox-Mails/dovecot.index.log index 533f0ed155134c33d1419ccdc8cbb2b0ba56158d..f00458d8557de7510f31648592a28463590cedd8 100644 GIT binary patch delta 24 gcmeBRJHWQ#3=?y8=H|)gnJgz?U@~Eu!pgt^0CpP)KmY&$ delta 15 XcmX@W*1@*n3={L)Gb<;bXR-tUHVX#T diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/Trash/dbox-Mails/dovecot.index.cache b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/Trash/dbox-Mails/dovecot.index.cache index 4534e445b421010c52b76bec7da92167c0c77608..c689f609ac93cf437aa71cce717c9d587acab6fd 100644 GIT binary patch literal 856 zcmbVK-EPw`6n3`(qx?RC6%cAQ8aZi~v=OkMHl2#rZCZ*1SDh2Pt*17r90yje#vOut zE_sPP3y;Dz9H*gTyMr(K;`8HtKF24e%@TV21Je)^n;))0D7 zQO5g-P2L8<8HEqDQR z57y+0Y8wMLv;ip6=r-6M@SY9=I#h8FccplaErL5d!ZxujY&l-T@raAJh)oEt9P|fZ zd4yEU2;G72o&oP`0YFzKGY>N!he^!b-O)7p5Xr?{nTn?h_HQn?p}Vl|03Q~9pQkAu z^IEUt;TM+GAf)BAEEAqpyY6=LhTf|(0?8b@ho`_tOBV%Mc+Ml`VL#5#=L~P*K#XI~ z%DUDkz&|q`B)Z}e&8F(c0Za8JT%@jZM_keWp}u!b-TSY90Q_rf8!MEqVKk-V6fu~X zDS5=jd(KcQK5}zDS)?MOQzT||ZiWe4q)KLy$|Oe6@a>1MZ*M57DCyMO>j~SQfH_!&-)&Kwi literal 3332 zcmdT`TW{P%6n090c7e7$@Q5^8B*Z0lXFR^sP|{r|O3Uu1yRJy2N?Y%Gl9+mJV|$Zs zo>l_!0Q>_GzknaY1FuL(JitFGXMEXab7`BT0&%3{IcIL3Io~;F&cfvd;rj32J-qev z_YZ}V7T*$tS3#amzy6bV{k>2QKvRjAK%N4>4a}(#g&7Mo(V4`|LZfkz`LUa1H&{4K zCUM5RPiiPmqAVIl!E)V=%fnIDBW;+KgX*4mlN5S28I~?>5 zbfq<(e04zf?YT_>;iqT4(AQ{U9Vbj9YqAL0r zQ;chZun2Scx;ObEpw%QAS*XdvNs4ZIEF46kr+>B`MEm*qrHrN7r?8IOh0|-mcYwiE zIki}tx;sob9tO?m(2iZC8|aSr@5kP=yZgKp(m%?EQMV*X6RkQnv8h zoZf)%JHXcqRp^ZeU$S9lAxV<>9DbMgfcZR5PGljEZMy)*k-ybu=jQW%t3U<05;?wG zz|X^Xt!zYau1CP&p{%J1J{QrdYr*ID=aJjdQmL@r~rh2RpQIR688xvx~yo} zD2$?;)Ksy0CM*fH6l#$&4*wM_Wn#)2)=Y^UKDMcz4@>T^$FQ8GuNj#8ezuE7ewzB> z4tm5Uh$TssTmaW!0nC?$ql__D2&LR0R900*F%;dPc}$+>&y^qYSpDcE8#Gy-C?TU4 zca>1P({D8!aObneD9^2@$0n5(L)8qN<5?Zw!18fC&k{o?=c1mQEg@M&Jr)=52*H+2 zELk}*7s0V}s^YH7HDH3ArqgeJX}}=QIX_-~;GTz{oRb#kXkm_ay+pd*Xb8NmnoirX z+m7gLZP4B!yx!5d4uFOM}RpJeATc z84t5@!ip{y?y(?>nGi=YmBzjo6jGFUED?5~Lm2rZCh^iW6$X9?WoV_qzET?cam=#P z$h>aiv5bKK`@EYxKWNJO+8MJYq@vC+E7KyeD3oZ% mGt=U%9yyv9`Mb6We6d1&wZS$T^-Y5xF$>N9!( diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/Trash/dbox-Mails/dovecot.index.log b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/Trash/dbox-Mails/dovecot.index.log index 90cffb560f53efe5e0982f3a767f5ced7d9f82a0..9317dd9be4f5c330dd674840ae0db3dce2e8ff8b 100644 GIT binary patch delta 315 zcmaDMbVGbY3MY$c=H|r71&kuBYz#m!*_K`148&sLWngG%Xy{R3U=RplP+@48u_+NO z4wA!)C+jgAv4NDxvQ5roG2@c~8_2)_q8J%~vSO1LFtIS&PZner69S872!icsW?SlA?gXF~knQabK--ytYzLqw@l=pW3P22$X#vs#4nUW1a3lBzKt4N~ zyaq(R735}+eh>z+k&j2Ki>P0wV_pNG}Kg0ASQL A1poj5 delta 12 Tcmca1{z7O&3Mb3kGb11Sc9{w*8*GZ{rSK^!2sHU9&cRsfQclg~2Bi%Ws|3=E7w zS_z21sDpJ)W@ZZ1EC327{7Op%DPaK-Kp+UA;3PYUHMy2aUK}n2WN-lS3LXXquguMp LH!}tDAe#gL8p0Q$ delta 171 zcmbQhHi2z|jW7!X1A_(>11W~(d@&pSGZ{stK^!2sSMmW&ivmf3$!8hm#Rb582q6Zf z0wlq@CNnbyY6dVeFifB2n+TExnG6D)5Q^b}6odg1XPI2fBrnbim0<$XY#>n}0knVe KW~M+MWRn1D!xcXO diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/dovecot.list.index.log b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/dovecot.list.index.log index 9fbdd733c108e3a37ce976a4c5af92ad66da0bfc..d8e8314540090e7d28e104a5cb5b4b1cbd453a5c 100644 GIT binary patch literal 1896 zcmbW2t4;$!6oyZ4u%col;gS?ul5!E16^I6nLRA*m2SAf1g&+_hkO)LWLQ;VMG!6rf zM`#EEMBf1ZGqYzq?GBk)PBPu?&bfT^pPAiUp-%5tXPpue6)`RI#3EGX8kjqgxMtlj;Ms8n zw=MV#jZcb!>xijIu7rW>iml-WIW@bFq3vL302J|>VPNI*F)YOZyw0i>SBRhUC7S4$ z=&%{jhcdr_`5C=~f1=ySV$RaL>s!-1){OZ>8PrCap$mZ!pSgFU8_Qtp=IdRbD!*T>^jZ=WpYoxofr z_5=p;5DoEK8=Jv*?qzRqy&6U+L({=9v=|0fE+4}R7l-lwT*nXw)?3W=?%9qf#owpf z5X_gK)BCf7j|k#Zx?w4axxO3w52kml8S{rSj2#T4KNv!FV^CW+pAHHKdsc_;Jkc*; CXAuG6qX7B1;I|RNFg@*-gh^5b9;Nc``yBl`?5PTZ{EC}-GRX|^Yi&q zDQAos#56@?UJgy)+`-=%1C2kXTrNL0CZEjW8^0H(j7hdP*Z3zf`E)PW%r=wI-{m4# zjNv{`vE!PIyvd2(6R|5JI5A*GMQ$QTB)O-$4EkEzI*MIP5d) z;Ms$Q4#+?8$6`p1cVjTs_ra?9`CV-uvfTaq7#t%u z|24$^YQ=|HX}tckr6R9D5$=>qn(=Z?NxVxi_i~3=?Rg$RXuTV_+N^uJ?oR#yy(15D)7P z40VMeOYIIe0rK9!wcM&jsCLDsU2N^<@JJ~Az1>l}88idoZBoVd<ZfI9`@cg9*hLAo*8*tm9 zjSz-S2Zrh4Hm6mUPYA;y2FIX2aUHjK2BTJu2(#D*ncK4PVwc~jr z{#Xpl4h+jZFvRjk4m59}+O0V-6!2(54rzbOQo9ib$6)QyvRXWZYIlZ47>F6A`8&8s zer>$!=q(!xbC%vx23Xry0gW11()?q6k>?5Y7TedYK75fc7p^zTR~CJKUT)}k diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/dovecot.list.index.log.2 b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/dovecot.list.index.log.2 index e07944ced9fa72fd20b00c4075c13107cfae4985..4ec3c2d147aa08207f79608bdc0ae44b940f29c2 100644 GIT binary patch literal 8336 zcmbVRO=w(I6uwPIJ8DeFpK8=-U)yL$=%TtBu!}6ZC?XofMHdxP5Q*R-i%^0F8JcJ! zT{LLGO~8Uf%_5-aEJtyXg^O;4EK~vtifb2H6cP0M-kUQy@6OFV_vOH4GJW@)^WE<| z_uTuYM~*h#UmG`OYR6*c z+*`=~jhDL#l4ac&5D$MRao7vQnm>&&qYx{8wSx-zy z`b}WaWPYrMIDhX63=i`>lE8ncj&+^-dx^15Ed0&X?lBDFPsPxBau~zi128a;n7^0! zOnBoQ&6~x;t^W?z|AB{j5rV_Navgm9eo+VHpZHTTG@cs9;Lzhj7*cs74VpKLhw}jp%L+rP zcFeM%AI)0~Gh;qOz%apV z^@`W~y@EATrC0QzkH6MQtY6kzlz^vT_YBT zTgdmlr}?@2_Iaps_CLtvu+;T;k^2`f_om97+AF!n?Le$O6)UxNHD6qd<}y~h^c$lC zOx7Q(U7bhvxA^I2p*!O^E?K{My#0=Uga2}d``#k5$Jet%{3$g>b#0V(Hq5?R(bE*lJOqtP5%c zJo%oAaYMgefajkNz+ly<)CR(qYQw^?8^Cbo_&%o{wH^z@qf8ECed0JC@L<*FDLTPY zd7H+i;<{I#jmAFaD%xGUQE12gMEt23)&m&U55SPh8#&OtS=x027{+mF!W#1aRzD1eOrycWKj%$j zu(T82$bsg~(yo>b^RS~ZRMC#_)ii3y_dDUi((VkMU^3srJdKU|f~Vao8V~%3c(Z!u zPoEarku%~?#jqa0Fp7;E!eD79ypaRVo5e#nfMHExNY##cs2Po)xbhBoh-pVZwCLPY zc;o!9adzJJw7ZDn72ZumIy@K_| zoZ?4r#QeKC^Q>X5K5vUC9QZF){Y`nPpN#Jy)H?+OUC!a&>|@}MSc0LWVp)7k%`-pW z%>{$S_p_Kwllc~JwMo3wcs0^hn01e}wENObJ%yp8IJGeFHxU}O08E3_kL z#Gi^GL&5nN_?vVHLn?3NK=WqtFcrYCfQw>P49r8##B`sJVc@g7*!wSgTKuapRQWxp z(FXwhD^m&ok2H$+R6q9uE?ctx)IP7*NC3;5?X-%+uwdgJdDG-{q<2!_~N8S^X#P3FfibN-*G&zG)uOLysUG)eeZ-lu0b zihaucLHwy0nrJRQhK&O-r1FOJCEhF^E(I`TXgI<{747&APos9HFoXw7yC$7rGT*{H z0kLxJx?c?%(pP_0dwPKS-Z8&x&Hw;H%(6f literal 8192 zcmbW6KZsma6vkiNi5ZQFqi%H7m`sr(MT&@xV2VK^SR@)HR;Czng+)XHZXoCuD?6f) z6n2ViG2%nFaM8jd{$a7Om_}H{BE_I91lc0O79tS>`hEA!d2`;KJMY}P2j=g)=iJ}@ zzH{GuyR&EJc=qS&mF`TIWq07Q)XuV_{VUx&@t(1#c*&NRmshf^*;>SBynnxwWv#uV zV|;04O*fXuP^iUPPd`=+xC<})@Q}Pl@wIzyW(~=EPx3C_T`*vLuZ_|jjQO(2pJ3oT z60LEql7aI|plme5hXIC@5Ccq(Ay>65hUN%>TJBeQ)Lf!D*00pzz~~_6bb4F5HBkI< zc!%+&ZZ{Njigzy_EheXCVo33hz006?_uwHq zSl%6E5<r8&DwXJCyKeL8Tn%w+E}2^a17wcpJ1?hUUVag*3HtP z6JS_V47pm5#lYTW&^zuWti$ai%e#A-gplzT^EY5#_q@9RlaN25o8{g5Q^nlWEaiN4 zE5NWdg&|fql4#v59p*6D*I^zP644>WJN7Pv-f=IXMwE9gCLv_J#e5aa*FEp%aM3`1 zvUi6%Zfd6)`C}P20}QKE7%cBZHs=9s)e`d-Zzww_;AY9yU)Gb5m3D$1Ns4Cr8jbeij|%dmi)eWjIdmCuKaplko2WdF(n0ez#Ti z?rWS7k?(XHVvN+Xbklo6>sH6in)iZ80z%qJX%+Nj%8TH;O{-pbH(t6s-@=$^_$%H$Ikr$ z=HBq;ZsVMY{1yJ)ldHMw*3VWIYxGtZ>0T;I&KgtUj16(#r7`b05sT?P?zk6?2Mr8?WuS*{K=% zh1p`b5n$-zJLFIFPpobP(Yjd-4Gi{mAeS)2?gyUdJ236veH&fmy89pA@0>*a)LLX- z!;@cYX&1HFHzBUUE^5((S>*X#v$*KV8gq=ndv|YUdB$rVgT2n{rsP?@euzm38E<)f z4b0E)ulh1j%qhM8?dv;kZj?;ASH2x!ID?Zn){xxmq8mZ9Zk7()80_n?sTfkc<9V7v z?|2OoFD&mKWD-KgTg<0$V*Bfpv#(%$xu<&g4xgQFDf{yrU_bI|ZSJBLnXlo=uXPxW znaV}ILR<@~R!V<<`exCe>?y# zivg!_7wk`zEp@Q^^PwWG9B(l%L8E_uey-A=$52F=Q@s1?QsEu<6Zugi%DW!}3~N&u zVs)boS~p9FtpLM`xv>r@-tpYZpm!)+>R@??>0HF>)b?^JXY_XeS6%yDd(M^uvTBUA%1(syes_Qg+A}pG0=mp5j5ZP zA?$oF5%TVbfOp*^V}=~bQmamH&LfN*$Nw8jUY*{|li!?Vyv5u=@h`l7o5k;*$alJ> r^a!u<5-B}`E$Kp-W$pYjbbkA7aoi)EQ}XK8N*&MPr0lOXYiHU2ju}OD diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Drafts/dbox-Mails/dovecot.index.log b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Drafts/dbox-Mails/dovecot.index.log index 3e51a572fca7f6c8669751f0276973ebaf5685d2..fe6782230a820c81f68e40bd6c85d7d492ae9b95 100644 GIT binary patch delta 12 TcmZo*ZeZR}!^l$iVp}2r8p8y& delta 12 TcmZo*ZeZR}!^raX%*sRn91#Tj diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/INBOX/dbox-Mails/dovecot.index.cache b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/INBOX/dbox-Mails/dovecot.index.cache index 30672ca87e2b1d111cb9bf27f7bff323764dd756..6adef98865ed2c3dd7953605d84954015f5b15a2 100644 GIT binary patch delta 114 zcmaDL_&{*O1lEAM7uyoMffz)?*x2|J=5;54#6dI+!_*=3CqHDB=Vbty!~g}8SOPZ3 Iu(dD&0EA#U?*IS* delta 114 zcmaDL_&{*O1lE9#GbS-0GY-B1(R3; KHpj5FFaZFt12(z< diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/INBOX/dbox-Mails/dovecot.index.log b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/INBOX/dbox-Mails/dovecot.index.log index 70c889806622ecedae064a86b8c73b945d876c6f..43603bcba65dd60ce568f3425d0e2622bcd115dd 100644 GIT binary patch delta 12 TcmX@Xae`xm3kwTV#^yu-9BTv{ delta 12 TcmX@Xae`xm3kyrfnU#qEADaaG diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Junk/dbox-Mails/dovecot.index.log b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Junk/dbox-Mails/dovecot.index.log index d4bea6f2968528d0b58e865aa55c9d63bc669e81..cc2712859c4708c76300faf598bcd8bac90b791e 100644 GIT binary patch delta 12 TcmZo*ZeZR}!^l$iVp}2r8p8y& delta 12 TcmZo*ZeZR}!^raX%*sRn91#Tj diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/dovecot.index b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/dovecot.index index 9982556eac7a81079dd6b13381dfa23484801484..4f2227d5dc12287aa26c69c7d1540017726bdd25 100644 GIT binary patch delta 34 qcmZo*ZD5@cz{!-cIk92JrbOw9iQ*FrBAER8H=f$W$a0gJfdK&4h71P) delta 34 qcmZo*ZD5@c!1?yf%0z~^m5I_56U8SML@-^Lvhma=MwVz!1_l7@CJdMW diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/dovecot.index.cache b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/dovecot.index.cache index 9bf2a1d81390b9732ded74c46248d7f6f41046d5..15bd2aecf928953e97edd6288588563ef24f71e4 100644 GIT binary patch literal 21040 zcmeHPZHy$xS?)ClIiIaKAr2TwLTdwLFLyoHRn=YHJvkqD-rYN|bNiv)b?mcj?e)y` z>`pv8GntuPdrbsOVxdSElnC-2nfRA~Adrw^p+o_MM36vyC=jqBWFe4(6p-KtL;|5m z@VwpCGriN@JF_!$`y;y6)m4AYOjp(W)boB-?abL3t?;X|LK`lt^3;@t>SlsLMLc+qqBBU4r=>BMcw!J1Fchg zDJbmM+TA_B9$mC{4m!0mu4=n}t59lI4*F-EZhNoX-D?NYt)Q_V)SIn9Yc*SBB*}i(&dEESx&V>c??jM2QU^ zG7pOS^>*!|E=>JetF3dBGu`xx_-DKN1yh)&K6hhz6K6%!JP$K~Y`b4T!Ow*UwUVrc zMyc7TIBB!tVfDFpqNaBfcIfDLqNrbXJXxY- zpNPJy{iLcNK`l^zR9&kc7xj&<->CTQioP2Sm3~2QHUi!6cK!0sE)2TJp3(8Wx1d-U zkh$4z@M3pXpKaCsT4Pq9n=SA7?M^_q_Bw{&Dc5SV=k=APn_-!CN;N#P9o_8RQ_s%N z&BFHE4(PWU+w@Bff0wS%rgpPdDbU^X`s`(g`?d_6k|8W!HZ0GThVR(Yuw3T3HZPaU zw&)M&mD%XUCBG9$YgQM+bi+Gyv;BV2+p4vCkoCr1XvpD${#&dM6F|%k{Q^(p> zv?mj5%$1&P3l6059@s3)^#;LvFgMv<#~BbN+C}}kpe8m|70B}@PX6*_@?=FOPfwnlo6NOc6Xap_I_O9) zz5d(@eVA-{o>%=wrShtj`=0WCsWI_rDb_Oqyx{M4nZaU^9-1@$t z(;~?=-$!%N&*Rq5piSfHNpGwv>1{E`bZtyaD3X3p85B##Na(v6HcWyrmIsU=P zcvTdw>D$-2^AR$%9S0!gJ)CmxdZsxVuaaMxvU!vNKRul&vTW(0I*~KzL}}WlCHsQo zuIt$Yf>V8XI3c@tL3Xb~c3(T0?5xw}Qtq0rWqAeOGjF&hrN>8;9r;Kp*=+=VySy_k z?i|Z5Ay7jpY3E>7TQ*hQ%8Q}byBWX2`fggY^z z2xd9V8t&6NnKG;Gw(5Z%G{UHSko0Z){$Dg3b$p-fnybL|cpNHit}`p85J&KA3$5)I zBshE7F8LlSo7`}uUokA^aHHguEu+K(pO=^jY}4;UIOW|+DNo?tMsGcVhs$Atxv->x z!5$?F7}s*pl%~1!C6&-3?6rWsIVelArB8r8S!CwavG)PACtGjByo3WUoPy}-ZQ*b! z*b(q$`L`B+GtC$I*lX>T^yh=4_VkCw$DPQ*o!@HJkyh*0nuyKJ0%HbV+DQag%ope3 z)4SgMg1mO!U6AvO1;lJZBv#78^h!a+uuH6JSf*(izGu0H%>wRl%i&d-fy5}l`nbPhvz%f4h`_a#lF{um^9p51i{2a=d9B2ZIBE^A2EfT@DF!f9+dCwrB zzS?G{EI+6wFv;=_$ny7a{pRTQ2opuy#J{O?%cE#dHn+fUMZC7aBA_}5Rhpia4xZur zS^PpV;FK)WN-gx-cWa$at+7q~q6h7Evpqf8aw|)}4VA44$K7$IbZlj`MBNvIUP9Ez z-Gpq<{qvpM-^cYAl-{5?Vm!V%ad>7GIWJl)k}dj9YKXo^SfL||y)OifgN}YVCj?J% z^JEPE349NxQ+OPS!Iw%^UU41QkY1%?c+7STIC{1rs+Q}!vRdKQ^lZ(RF~#~7MfGE9 zg+f7zPt)<7=4Lb06KQJi!66EHQ(S#^?Z(=r<)!6CeLrY-pat|AI^3;Q`${1qY?yd) zjJ_X_Kl+Mhxf^s1EXD}@-Gm0|y;UiW@U^S0pn+GX%`Rvm^+MYbaQUO?0Su%@z1Bdq z|41Bu;HQ(Cq4$Ws(rP!m&2qC&$%4MZyF}_P@wsHsz7||>-n_Y5N04jz=9ByT*X(vf zdI!tS(%!9Qd(A5ik`B$i|9J4<@qdJ)m%n%Cwu_tJQJmx9K2F0U!sT+aaZz{lC-xdq zdWhLY6UfXCLrjz(%JpBl;7oX&j2W;FYUxJ~^_AtseE&+3G;#gEeQDYMV|4UE+{^Yk zHh1>I9ByBhc9FYx!!F2`B@_ls0jP`unXt%CnwE#K)2MNZr-sO~+}v%!{4do&bq57~ z<6zfsbc3?4rZI_oBWOc8#5vz{I_CAR-&I;CmizC7I%hD~tMa8EigZh%8)kwt6Tq{V zy=v9=rKlP~ncNBKRt&cka3heV3bKeGDmM}5jvZU2EKC)gJjS0$HsX9=Rp1+am7si} zgi`2bnUzxS`{6E9>m|kwugZ{HW{zigl2;Aiv@Kpi>KQ&z-wHq4T*-%~n2)@!-`b(f zW^Dm5whjOL2wYN@6wU8<{uutlL380_zx$+r2G=pKrS;Y3UT{&j_0@7$(HbjSW|3#7 zKkkyg;-0{;yOF*U7-R$*q{9-pQ0`8qjXWZ+t*mY>FU$|{+W7vCkfx3x#h~>xRFdWv zw}i{ETq7j$xU=S9BqieNXA->j(nHVsk3*L6dV#bop9(4$b(xT*EDE@;cBYEDJF;Zb zloqoo`Wo_@%^h5N)`&UDOTcVOM`4jg2g^}l#D>SG90 z+RO%lhl)z54(G`8S+)3^=H?5pJ?DQC@{DcC^jf1(o^Y!BlhZA7#AUOM$w}54w-FVDevbR?q)o{XuWw7t)93!T>VGRSPe+!kt$f!h zt|7~nE3&YJc&Ruy>>pt4T7BhqoLr3)%5_kl6YwrpKV^8WBk(Q*j7{dSkeK2QJK1rj zn+bXT3gr1P$Yn_G8Oi|0v{IrHi?oVhlM5#AtqJ5)SQB^!;~vLBj>IDXR%vn%3qc63 z9#SV3GMLg$i!)P)X08S4`+OJlmDNq1CTLIzMH$b_@#Sbq#0$sr3z!90*7m~8bFZhS zH|V;D^YRZ9a{T-4uli3zjzeWiU1)1gJ{an_( zOv-U1lHp{!QVKa{JP_uyi$xOQ`iM|==$v%3ZJ!|FpI^fI>Q}LNbqD<;75X&FHI!#m z@TH>a2b8>jR@HR-ag<+G&uI-g9jj5LHB@kra-(#-73DiD{hsI4_qSDjTYdf`s*d0D za?X4HMBV>uRX-5EEm~(h$(r_T|2ABsJcwf~Q>M80bonSB$FOo8i_^-q7{`ufdiIER zgNgA;*@47CJs%E>lp{WxTWXZB_>fjxYnqOd#79+)cT3f8sQO=2O%>te*VXkPK0I~* zF;(A>&(ho(-yVT$qkH36naq*k1q-W-6v1OWT~DTHFC4ea3Eq1Xa|cb!5VTb zSRpoTtmW!H7pssg3`QSnxWgGsQ)Z^_yNIz#VJ*p-BjD_|!pDbI{dP6}KR>`jzowoK z;%r~>$jhoG9-0hilI*1PnuHPTB-e&->#@+CAwvR#$#|Ng!!i3vf}`JEi*WYhUBTIg z-@Ql%L*K?ivd2T%?i6t*Y}dg`0fjS8iD#^w$_T$^;_UK>IIBf`27)X3m5}6o+69}* zZ!xdEq;OSLc>ARR+|fQ`ItFp~7Yc9xplafW$#93obK}PDO$;aYv4s2<4KBjl+5GlK z0(b7mUiYbQUq&Bj&vm?SE3WC;sC&Bp{CmIeQ~6~S`hHv|_jb{}*FOGws!)^8(z{fl zb1H*-w&?lby-BVkQPak*-X85}@7M7gz_6WrX6A=w7udDU#c&tb_4U=|@MLMlSYKSb zdCO3HyH&8Ew+k%!EV&Ep$;X~poZk$8Vt#dHb8%(U*u1qC{rJk_QyVwdSD#$l2%oR5 zFRiXGZQcqm))%iYt}m|4FGkOvHhNDr6G`Y#K<2bAl)wbmLgrl_OqMUMDatyUm+VTZ=npiQna&-AntY}y)H$BXT>p-%& zeRw;7C0c+neY-Wwp0Kg*@HBmWB&t2+>S57GIuCoZuvjRWU^*@acNIgEvRiX}q&%Bq zYFuD3>~z3FpJYc&b9NNWlZbVc2T@|beqY%uhpK+BvQLDn>GtC&uc+sPc1>(&e_B1K zb`al95U+ywJYK$s<%~@){YTy)+D5YcqO#kln|}iv1C{naxHt{`W0Qqdgv)Shej9TU zAHaf*9{iC2$7+UA?P<_<8vkj(O(&&V^Xv74IW-FahH2rR3&G%&hno$sh5KaVorx=v&&Egk9LG4f)0gEIhp z!u=KGOXwinzx7iQ?tgH4xOYyM_pu|Da!S#v&=58p!7?`D{vygJjmZ0V75e~&D@`Pl z6z2MyE^{S8&qZQ}b+spo@y{{zMIkEqX+&o?383*!4|Ayb0$ zhyN7}82LGaGXQ#O>I^j!2l4&izH+*Dj)lz}MK=AoVLs-u!GQraae$iEkYOdKH)2jN z)6U7Z^Yy!hd;A>*6WeW~HA}#K*a2sJuCFUR$9DdI6A*Abq_{A~{cq;r{u%Xo`a3;z mP#$bDu9w)l1W+U(Pv@h+K5uLWU>|aQS-AmI^7(Sc7&Gn%!-G}+HO`Xn6#`;hPcClH6!7z(3F9vNlVbDc?K)8W|L6)N< z55t zWH~2R@^Z)TliQ)J|8tcP#bR+bB82ynh>GIEt9-M(5Dv;*_>^;GPCg7@Eg)e^2#evPx7JMGqE?@@e29|);z)wIAun|Q2fLY*v;1civ za2I$G*lmf+q6UZSV5NDAj?JWiXysp8y|A@{0MsghhEcr`wOXqWb)ulenn$A)E8C#OilR}9wS$T%)&d%( zSUxmHt)8GVYIP&5waTC{YPH*;wR+pBwYnA4TFv)pt#Z9ut3+IDET!Ct(Nw%-zsaLrheM*Iy(jM-}cg|*NY=xbf4*A>JUo$dS5!5f!RY6B;+a_nKQ-1Xa9ASf#DPoYEtvvq1_`qO)M&jE_p8oQuWXXx}$wF*VzsU$!6F2N# ziWoNE9PUzawM#i2``<3zxdic{r<#;5ev~F@yJ3@b zyjzjB8>CDbKBo%h@ro*R>6zxFhn<_8*n8V1XX1#OXotbclrtG}cJdg^lb#=DX~`3{ diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.27 b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.27 index 6d23aba770..f44829fd2b 100644 --- a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.27 +++ b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.27 @@ -1,58 +1,35 @@ -2 M1e C61a9cced -N 0000000000000928 -Date: Fri, 3 Dec 2021 09:53:14 +0200 (GMT+02:00) +2 M1e C61b36802 +N 00000000000003BD +Date: Fri, 10 Dec 2021 16:44:37 +0200 (GMT+02:00) From: denbond7@flowcrypt.test To: default@flowcrypt.test -Message-ID: <433031.2.1638517996358@localhost> -Subject: Message with Pub key(has no suitable encryption subkeys) +Message-ID: <36760296.1.1639147477268@flowcrypt.test> +Subject: Encrypted + NOT signed MIME-Version: 1.0 Content-Type: multipart/mixed; - boundary="----=_Part_0_64286997.1638517994213" -User-Agent: FlowCrypt_Android_1.2.5_dev_125__2021_12_03 + boundary="----=_Part_0_143475953.1639147477209" +User-Agent: FlowCrypt_Android_1.2.5_dev_125__2021_12_10 -------=_Part_0_64286997.1638517994213 +------=_Part_0_143475953.1639147477209 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit -This message has an attached pub key that has no suitable encryption subkeys -------=_Part_0_64286997.1638517994213 -Content-Type: application/pgp-keys; - name=0x58DF2107B952BA3721A6081AA06BBF82A207B21E.asc -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; - filename=0x58DF2107B952BA3721A6081AA06BBF82A207B21E.asc -Content-ID: - ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: FlowCrypt 1.2.5_dev_125__2021_12_03 Gmail Encryption -Comment: Seamlessly send and receive encrypted email +-----BEGIN PGP MESSAGE----- +Version: PGPainless -mQGNBGGoseUBDAC+rKhZ8nrDsrKDRh3RfSPywgPk8hnOFPioamZFrn/cySgXAh82 -9gWewD0YezSlnOFd15rf86UovHo0Sk5pVyaeAV04s8Nfc2sZZZDayFr232/mcK6L -IM9I5UxirEzSFSHPdV+zCjr9v/6Yn5m0agc16g6McmHGmSnOLyMjy9Hg9gUCGpMg -ZYXSab8NGEaYy6Z5ChaBjS/l5ZyezBU55/+7cHkIAHYUxmDdY1po+y2U5CTna/Ab -XDnlXCfhtnTDpKI8q72DDINgF9qEyJzWOX3uiwoyWnLUpzmeFGWPR0UsbP4e3UdJ -rqNzbFXNLNJSN/EQ/2TGs1wbyQ20csUoEiuA+Y14vn+Kc1zjo4YRIB861pf7yude -BsNOCy+37Jad71DL7FLYsBp7/fhG8u+9JCA1evDBh7FvXJKma/1tJkD92lWXWVUc -qRRZdO84AQXpgXEsJX7DCwlNy/bBmwDXgK8pdIWfDEcB417eMxC3QiehzIVjsg2Z -DeqgGVBqBZ/4GEcAEQEAAbQkbm9fZW5jcnlwdGlvbl9zdWJrZXlzQGZsb3djcnlw -dC50ZXN0iQHUBBMBCAA+FiEEWN8hB7lSujchpggaoGu/gqIHsh4FAmGoseUCGwMF -CQPCZwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQoGu/gqIHsh4HeAv/eHWD -eaKLHy0W+p34vl7lobZ6ndpZekCdP8ve29Mtdu46CS7W5N2u5lTEcd6ir+tq8WB0 -6MqZ/Kr6o1HsVDrsrDeH4pQxN6FzuIY4uiPbySsIBvy6ZLSxjO7U1dayfA2a9BIG -nJd2W9fYIsyqokUXdX+0m+SoYIVglLUvEJZbZNKI4oNepRU73gyKMbU9HQN9mvPR -fCpigPh+xPoiafgwF1cPDl2drGcBZOE5H7LTcyIFKqH8sFMDiZRB7Werq/uFEx5v -k2iu0D9a/cZGE+UVtoVok0rAFGi2QtRixDcfe+wq60UfjCRBObFlBUgvl1HISlWE -0C5P6HClHqqzhbr8ZbkTvNqeR3ae2Nbiy1ImV8uLdRNZFrtOgvtFa6gjszsGE0FX -wRtJP9ayy02yPrpMzMkv34ApEy5+07wORTbaCsaWdzKsYOJIxlmx3eBATrgNjVSo -Rt0qgcuC6CEmV+jmAWurIFndYlp/AJYyJZ9JYm8JlBJhltkcDSxyhZrUYof4 -=0YiW ------END PGP PUBLIC KEY BLOCK----- +hF4D16Pe22XLHvsSAQdApkbDtf6GMhbUdIG8lbA1xVidfOw1xw90yYMKSeUd1lMw +HIPCm32G4OnJFEgSodLZGIjLXAR98YlPANHx8CI12avC5FzWQrbhegmdhnHzw/Ti +hF4DTxRYvSK3u1MSAQdAur1cw4tCsoeoQm4vzslmw+Nr57fIj0rkhhzVnaM/IBYw +MGUnTXLXmjvVnGKb5XZHmpkybOFMtXrZKvddQfJ+uY5BAevGDCCLeJySGceMbDta +0k0B7jC+C2ZeZdJzFcvzhotQDWSM2YOvRNKA0BkMyVsJabUKY1xExidzBQnK5HSp +Ru9HZjZJZTsBnbji9GwvfvgMXlc9LxP53hLdW6lszA== +=xJjg +-----END PGP MESSAGE----- -------=_Part_0_64286997.1638517994213-- +------=_Part_0_143475953.1639147477209--  -R61a9ccea -V95a -G98fc3814edcca9612c05000073f46975 +R61b367d5 +V3d8 +Gb04310380268b3619e03000073f46975 diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.29 b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.29 new file mode 100644 index 0000000000..8e7e249bd0 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.29 @@ -0,0 +1,33 @@ +2 M1e C61b368df +N 000000000000033C +Date: Fri, 10 Dec 2021 16:49:00 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <124374216.1.1639147740952@flowcrypt.test> +Subject: NOT encrypted + signed(Inband) +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_176969482.1639147740896" +User-Agent: FlowCrypt_Android_1.2.5_dev_125__2021_12_10 + +------=_Part_0_176969482.1639147740896 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCV2WKHzbNaPa+cYT2skMYCAZ4l6sUJxZnpeaoqChmdeUmJeiqZCfl5O +pUJuanFxYnqqXkcpC4MYFwMbK1Pi5ow7DIqcAjBDxBRZDqZoXGM8bWneeT7xCkz4 +7ENGhitGLy5tuiSTY85ues+ItWT7wT2CITKucV8OHVkQ9ePp+xSG/2W/Nm2fzvZ0 ++k4VL8PMqSYF12u0TkrKFsRfvRAooudkzgQA +=c6F0 +-----END PGP MESSAGE----- + +------=_Part_0_176969482.1639147740896-- + + +R61b368dc +V355 +Ge8d44b06df68b3619e07000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.30 b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.30 new file mode 100644 index 0000000000..dcd3d85943 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.30 @@ -0,0 +1,38 @@ +2 M1e C61b3691f +N 0000000000000471 +Date: Fri, 10 Dec 2021 16:50:05 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <80534408.1.1639147805211@flowcrypt.test> +Subject: Encrypted + signed(Inband) +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_85360913.1639147805127" +User-Agent: FlowCrypt_Android_1.2.5_dev_125__2021_12_10 + +------=_Part_0_85360913.1639147805127 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdA3AUBbNBYHs7uBkHYPB2MScrOjyjr8H3uUHD/oV66NRUw +QwHSwqj/w5Zh1TIyCNPrL+5CHKw6AWoxf/tueiN7k18lxhrrrK2G4YcmW2IxhAD0 +hF4D16Pe22XLHvsSAQdADdHH+j+A9Vl8dYDlQLewJrBsDqoLXtL3C9qvSVBXo0Aw +zxk+hWPctb9Zuu9kexEZao2sA7CkyQIVuoX++toxpuUH2cnM2tMx2wdOsqk/b80u +0sASASXoL13FL1aRfUmJti8FXjwK7pu7sR7EOXq1dqVfuDRWT1PICa3cJRvTZbe1 +jsePedNvt74GsllnaoZykqcWoEfiEL0CvU796P60+CBpsxQ304rO9G41P1a9CtvR +OTAwOd+ZcfypPoNGQuw90TY/678yq03RROZMiZvHa96UqYPHjdo5q/7RjZVVde7k +JGplAW7C9+93vjJ8tl328hYItBpPF26dQB+AHMIz/AND0MwbnUEdJyPs9AGoVeak +xjaRjpUqh3BDc+mdxXlztNVdmRFQ +=YZEj +-----END PGP MESSAGE----- + +------=_Part_0_85360913.1639147805127-- + + +R61b3691d +V48f +Gf064b8151f69b361ce08000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.31 b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.31 new file mode 100644 index 0000000000..088ea01539 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.31 @@ -0,0 +1,39 @@ +2 M1e C61b4823b +N 00000000000004D6 +Date: Sat, 11 Dec 2021 12:49:28 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <83587077.1.1639219768957@flowcrypt.test> +Subject: Encrypted + signed(inband) + bad signature +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_10768010.1639219768882" +User-Agent: FlowCrypt_Android_1.2.5_dev_125__2021_12_11 + +------=_Part_0_10768010.1639219768882 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdAtdnv+F2LD9GVA09dGxdtNXp9XOUNildn0KoRRyfS71Yw +oz40WsLIOFiq24WAnkZaig3mh3ZIZPH30CpNG6D50xJgH87vhlHr8KMc/UKCD8HT +hF4D16Pe22XLHvsSAQdAdmfEzaR46pX8T/DSVrKmGPlxKWaS/GYPCJbHwa1/8hsw +QpKP7zTwoRGg+OC01wgviQjaHehQ5PHCcgF92js19ipqeK0nZ6NumYBhuReeTn0j +0sBPATC6XlUcftJVv3oydls4C8Mpu+KK+fFvsgaZY5QeoLttl07GfRQMqPhpb6wb +5sEKrS0QTpxzAth07Ow22cETz+BYbxkVmbube82CBNwkiv8jF05expxtLdAUTSc4 +p9/hKUSFAXP/a4x5ce7ImZ8IeBftDfD1UjCvL/vPqhGfuPg/ObAPAIk4vs6K8yGW +0ub67smJCF6x3rTeYWJHtZA2w3aYX332klhyWWyyvq4EhfkViNCbch0gkBvrqxd0 +hIoSRW4Tg/SzbTNbwvoojwB4Qn/NKj6tG+/NCXsNoCaAW24oCpJC+J5CUUbHVH3O +Ru2kYMZ0/G0F3zplBJ+UdNl3edCVuOsYKosqA251SpbBhw== +=52uO +-----END PGP MESSAGE----- + +------=_Part_0_10768010.1639219768882-- + + +R61b48238 +V4f5 +G8086ac0b3b82b461d80d000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.32 b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.32 new file mode 100644 index 0000000000..d804160bc5 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.32 @@ -0,0 +1,34 @@ +2 M1e C61b483d4 +N 0000000000000399 +Date: Sat, 11 Dec 2021 12:56:17 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <106293212.1.1639220177972@flowcrypt.test> +Subject: NOT encrypted + signed(inband) + bad signature +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_141207675.1639220177900" +User-Agent: FlowCrypt_Android_1.2.5_dev_125__2021_12_11 + +------=_Part_0_141207675.1639220177900 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCX2jaFz8aOWw08ZT6cnMYCAZ4l6sUKiQlFqemlOYpFCbmpxcWJ6qkJJ +RmKJQnlisUJxZnpeaopCeWZJBlBZeVF+XrpCQVFmWWJJqkJ2aqWeQnBqXkpqkUJi +XgpELZBZlKqQkpmWllqUmlei11HKwiDGxcDGypS4pfkigyKnAMwNYoosHXsObGz8 +luG6RyfyAkx4oz8jw8yK2S9W5S19cGL2MsGt7+3eVS0MPiv4Zp367xdLbDUKb0xn ++O+T+pZxU/QMpfK1GqsbxbL2eXkEq9kvZjlr4FvM3tH7kBEA +=BWVd +-----END PGP MESSAGE----- + +------=_Part_0_141207675.1639220177900-- + + +R61b483d1 +V3b3 +G60ad600ad483b4611015000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.33 b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.33 new file mode 100644 index 0000000000..b025d5f22d --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.33 @@ -0,0 +1,50 @@ +2 M1e C61b48f10 +N 000000000000063E +Date: Sat, 11 Dec 2021 13:44:14 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <18216133.1.1639223054277@flowcrypt.test> +Subject: Encrypted + signed partially(inband) +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_233169424.1639223054262" +User-Agent: FlowCrypt_Android_1.2.5_dev_125__2021_12_11 + +------=_Part_0_233169424.1639223054262 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdAk9cJSvMdCEy720HDusXhkyPPueKN/lCJs7a+9ZipNkMw +t7kWnNV1GPawCh2AO4tsQAglt05gXfMVp6KZuobhOzAo8ejsFZ8l6NrmD9GkSKgk +hF4D16Pe22XLHvsSAQdAYZljKw41PYIeGNnPxbXXj+fMEVZ7r95/jGx24PiL2nsw +2mxZJ0IFqejwD1EtWWHGdCvQJq9hRE3xGUqG5KutLvFP70rZr7ohNzEZW3g8hIl7 +0sAOAZdOkq7hFd+2edSp6QoBo08lCtGPZ99uWjZMJ2O0xlrzXQHHfiKo29jLE4dd +QSLDkAEe6NFeGxFFtETWipOL/a7spfrSuGhC6irfR6kVVlvloMDGJQqdMyaJx/6r +JA68fo+lcMeN198b471AMPnMfzuhh5UnudeKfTsP4G/phi+PFPdVCyvbCPVCfzC/ +1SwnbFOfc3HzjDqy61i1L44qDuEIXe2DKQqRvKOcWcUjiHM5/v+oGaqTrzINmvMA +XoGVOoniX+yu/7XfbhKbybw= +=SzXS +-----END PGP MESSAGE----- + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4D16Pe22XLHvsSAQdALlp3UOL9wBsSRF3uIEH5imchVNuITE2KqoJdMtKRq1Ew ++1jecnPqy2r3gsk2ixXt53R/oqyleCaCa05WwQH2jvOlJBLYDSaG0nvPTXGYhFD1 +hF4DTxRYvSK3u1MSAQdAxmUBg1MOvPSKFfVE5UraFUX5hzEIOo/IBxoGt6mfTC4w +DihowFXP5XlePFtr3z7M/R00Wkmw/TAa+fukqjLTFrYIuacQW1gTiEYfOOif8V4d +0k0BBHpU9I+AK/yYkkSdhW3C4JowbvOYvOFFtq5z+2/4jrZGgGmiydLBQ+ASCJTW +5LoxisOo1ZWXU5GyhEsUfGWomTmIqdHPr6QOxEZmDw== +=jl09 +-----END PGP MESSAGE----- + +------=_Part_0_233169424.1639223054262-- + + +R61b48f0e +V668 +Gc848661f108fb4616c05000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.34 b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.34 new file mode 100644 index 0000000000..c24e8c0090 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.34 @@ -0,0 +1,35 @@ +2 M1e C61b48fc7 +N 0000000000000343 +Date: Sat, 11 Dec 2021 13:47:17 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <134516345.1.1639223237410@flowcrypt.test> +Subject: NOT encrypted + signed partially(inband) +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_104860116.1639223237396" +User-Agent: FlowCrypt_Android_1.2.5_dev_125__2021_12_11 + +------=_Part_0_104860116.1639223237396 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +Some plain text + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCV2WKHzbNaPa+cYT0smMYCAf15OpUJxZnpeaopCbmpxcWJ6akcpC4MY +FwMbK1Pilt7tDIqcAjBdYoosB1M0rjGetjTvPJ94BSZ8iZmR4cTMG9aGhvM/T7z3 +ceaf7VPS4l55x0m3eXiIXqm71HX8sQcjw7/JfNKsbvpM+sH6siuTFmrfPrjCsp+J +VTNI6HmdjMpMVgA= +=4Gih +-----END PGP MESSAGE----- + +------=_Part_0_104860116.1639223237396-- + + +R61b48fc5 +V35e +G50b4e024c78fb461b008000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.35 b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.35 new file mode 100644 index 0000000000..6d16a46524 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.35 @@ -0,0 +1,52 @@ +2 M1e C61b6e8eb +N 0000000000000701 +Date: Sat, 11 Dec 2021 14:47:14 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <110314482.1.1639226834163@flowcrypt.test> +Subject: Encrypted + signed mixed(inband) +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_150365359.1639226834147" +User-Agent: FlowCrypt_Android_1.2.5_dev_125__2021_12_13 + +------=_Part_0_150365359.1639226834147 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdAyDv4lT7yZwY+k7XTngGbM9R3TSIDfJ05jjPtP1tgVhww +Ow986yKDq8RwNwRuOP+Zetgzv3Rueds53oH6WubsfFbkfqDddSuxbivSPMaJrsEa +hF4D16Pe22XLHvsSAQdAm0JxdCnyvGhOwCeljYCmXnnR6bd7sfxTpHbiBN5eiUYw +vXWpjLvybfnbIwMFOkYJY7xLi0nbiMG4GYKTUzy1UZYezPlig0CN65zXmQtwSX+I +0sAXAXZTOnpBBAC7adCCn98X8ym6EhabfV/Kxtk54zNP4/E2tEs88G3eKRHAcFYA +dsSRpd6fbQ+Od+2MxRr29gKdH/IMk+zuhg4K45HEu24039/1KyV31g+L35A9764A +yxGwyMw816TcSK4Rfx3ZdRc4gxRy1chCLf9QDlTowDiaiAk14ntfqqUOZTUj+OcV +80bEHI8VxTs1KPgqHvt0dOkSQBJzLk/4OlqOhoRBTJq2TBaP2iBlO4/MMKlhG4NG +ubaIKDKh/tfhMteAfWE52yiz3htm980akzc= +=rudy +-----END PGP MESSAGE----- + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdArBX9SbPgfhP9wqWOBFvkfDKBxszXMVfDrmKr31dNOh8w +tOprLXmSEJw6YwEIqAXByU/olv90UG7sEmIkI7J6AEmyFOkSDokJPAQrpU9Umcum +hF4DdhH7TgaiP74SAQdANFfZyN86QhSBkh5ywThUC/nNmQlkIUJ2pEuCF7IEKAIw +4xVCdmdRlEltVVP4K7OnGme3nQEmnANDXdZ69HQJYUSMsgFWB3HkFJ/iqM4b3TNe +0sAXATT2v+7RWASJS/tLN1a2XEMy+ybwNremGO0IPo8ji9EQOcFaD029OvMdq2C+ +AHXxBqmi1hcnn2CuLVyAOWh5bj0VJSKuMsgx1yDMpYItfuhTLs0dQ1JA93dJCfi2 +7r6ueKx5eDv5y6hr3thNn+ctOF0r7CDOZWtE5oznOErmmg05Q+nGMJzN85kGV6mj +1cmYEq6/sVjYf6J+iYFVkywdY7ne+FBHjJ0cX4JEmvy4SCfO51cM+cGzFtup+a6P +afd0d2jaJS9rkgbmS4VMtGIlfrCMIOhl6ws= +=1cM4 +-----END PGP MESSAGE----- +------=_Part_0_150365359.1639226834147-- + + +R61b49dd2 +V72d +G80269d25ebe8b6613507000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.36 b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.36 new file mode 100644 index 0000000000..f621fac22a --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.36 @@ -0,0 +1,42 @@ +2 M1e C61b6ea94 +N 0000000000000463 +Date: Sat, 11 Dec 2021 14:54:18 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <178316538.1.1639227258998@flowcrypt.test> +Subject: NOT encrypted + signed mixed(inband) +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_254081431.1639227258976" +User-Agent: FlowCrypt_Android_1.2.5_dev_125__2021_12_13 + +------=_Part_0_254081431.1639227258976 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCV2WKHzbNaPa+cYT8snMYBAcGZ6XmqKQnlmSYZCokJBUWZuYlGlQnZq +ZUcpC4MYFwMbK1Pi1uf+DIqcAjC9YoosB1M0rjGetjTvPJ94BSZsw8vwV2r5jx3K +D09YX2YxmXdpntcL7iO8J4vT5asfPUv6f+iMRDojwyG9s+lHxOMUJ60VP6tl/sjr +Kedlni+bmO2MptWmXQj0YQMA +=usCN +-----END PGP MESSAGE----- + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCXWaL/vvdiErcGMpxWSGEAgODM9LzVFoTyzJEOhJCNVoTg1OT8vRSE7 +tbKjlIVBjIuBjZUpcevzDwyKnAIwzWKKLHfMHwmFMAmaprieNocJp/Uy/A/MjTzK +N9UkpXLTg0dXFFasM5wQxT93ufHj+o9hhzuO97YxMlwwsG+6lNHn4xkilcwbmmhx +/ernRzJH7rFaPLM7d/zlHj4A +=Yz2p +-----END PGP MESSAGE----- +------=_Part_0_254081431.1639227258976-- + + +R61b49f7a +V485 +G18a1fe1a94eab6619d0e000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Trash/dbox-Mails/dovecot.index.cache b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Trash/dbox-Mails/dovecot.index.cache index 148f42249341b397a440c73ba0c10aaea17e8b22..38d134a828f9e5cf2b73a659d28d451ac7340386 100644 GIT binary patch literal 880 zcmb7B%Wl&^6rHpMN_hRk$VDhou^Bt5omjlu#EAk;Q`KS7RhW1t$)LoJ#^chkDmx_h zELrjc{Xn?mx)Fs99P8-ZJJ)kxQ`#<}-uJKX-vUvAt%;Kk^eN;M)Q$MG6&&2xxlyS1iW_x4=RZFs+xfMn1Yw2ruL5};>zHoK(S z#=u+J0NlP3^Z;}RsPAYD6CX1^q1jx$p3IYvkz6g6rFg2!=nlkvpw6k$ri%NxBgIo} z6Wrzzc8FtR+x6?NPdvO!971rV+aH4E6H+ZBv<>&30AZauIx<=4it#v!nfF&obhr2q zuA*1KVl33>X-cQu?6rOT+_vk4G~K3c!M9$Gx7YY1-^(((SLC}7`WSefhi!;tpDn4=ROh}c{`IWPrtx^$zCl+*RjT5#?mCPcQNseYrS_iFGu7$Mshe7Ul vP6qwl=pC6S!SUg#IUMAEKM2G9ZUB#vyEkItyMs4DYnTU$-$NcVE)n_#(;({R literal 3836 zcmdUy&2QsG6u{lGz;1xu6Gx;`koc_K8IQkdfo|fKbjb&aSG22@f)h_$vx#kNr``0F z190Jg;K%_X@fUFCzzq)E_y_nCkl>9SXVbJ@(Uz^mQ(or7^X2)y_h!6wb4jRu`^{(D zpu$xCx-AGVKz=g$@>gE<=aL}6FO%hI`W&Pa&|A}TB@9v)q@pv9n1zO;LFz|toUXE< zACIGydGD1_6o+Zp4+raIH;M*+-%b56SdI20an`B~&3fS|@Z5O3UZ&yL)E*7)H5x&$ zbF3@%(fEsFa`Z_o@0i*>+8dQiH(-7Vl&4&(ZVK~n#{LST7;Qu`lCew>HZ4pos-kx> z#keF0&qG_@uXvx$I2>B2%7Sr%);t#U!obr%+#7^P+4`lFCF%RnkM9eY7eTi{`95%| zvm|l%nOLh@XpL$f@l173R6MsQ%HEzU%DSwJ)HJ9q^0;u`r9M-$=jK4FN z^H>l4$G{ntZapC=f~Ns-c-68Ae?NhAJkwT>5Vq*24f8>T?WrOEoR!8huwLI+k@) z14EsAN2q-|!?m**e&l;_Dj+va-TuK4t}PO3ZM9bGwYn`KCmg<+phFfXz_@gg*gKhg z_5A~2dI#qG?)F3Xhf6AF_V*=4xN$<3PDHOAh5sw(y@9)*2p-(w zr3BnE&&90I{6pqV>)k_^zh87PPT(VAAoxQ!l6s*xev(Vlc+^ivG0Ur1aL5K>#Dpk} zs5J7uL7od^kHx}1R0u*R#3=9lFb_){&g8=*Fi|pFE>_Cw}d|=TY1)yjM zg9<~#j7^CkaTatuc_XXvhcuy8&7iRRH%*ZI73euzi#2_~TX#oeIoj14O2)o+> oNdE@{AO$ubL^Cq*GGwF_=@#S{80(g1rsM#{K=uM9fB+H_05QNwdH?_b delta 12 Tcmew$xkF@w2^Y)TGb Date: Mon, 13 Dec 2021 11:02:36 +0200 Subject: [PATCH 02/12] Renamed PgpDecrypt to PgpDecryptAndOrVerify.| #1097 --- ...ssageDetailsActivityPassphraseInRamTest.kt | 7 ++- .../response/model/DecryptErrorDetails.kt | 6 +-- .../jetpack/viewmodel/MsgDetailsViewModel.kt | 4 +- .../email/security/KeysStorageImpl.kt | 4 +- .../flowcrypt/email/security/SecurityUtils.kt | 6 ++- ...PgpDecrypt.kt => PgpDecryptAndOrVerify.kt} | 2 +- .../flowcrypt/email/security/pgp/PgpMsg.kt | 8 ++-- .../AttachmentDownloadManagerService.kt | 6 +-- .../AttachmentNotificationManager.kt | 4 +- .../fragment/MessageDetailsFragment.kt | 16 +++---- .../util/exception/DecryptionException.kt | 4 +- ...ptTest.kt => PgpDecryptAndOrVerifyTest.kt} | 46 +++++++++---------- .../email/security/pgp/PgpMsgTest.kt | 26 +++++------ 13 files changed, 72 insertions(+), 67 deletions(-) rename FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/{PgpDecrypt.kt => PgpDecryptAndOrVerify.kt} (99%) rename FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/{PgpDecryptTest.kt => PgpDecryptAndOrVerifyTest.kt} (79%) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityPassphraseInRamTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityPassphraseInRamTest.kt index 77a22fbde6..6639026aef 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityPassphraseInRamTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityPassphraseInRamTest.kt @@ -29,7 +29,7 @@ import com.flowcrypt.email.rules.AddPrivateKeyToDatabaseRule import com.flowcrypt.email.rules.ClearAppSettingsRule import com.flowcrypt.email.rules.RetryRule import com.flowcrypt.email.rules.ScreenshotTestRule -import com.flowcrypt.email.security.pgp.PgpDecrypt +import com.flowcrypt.email.security.pgp.PgpDecryptAndOrVerify import com.flowcrypt.email.ui.activity.base.BaseMessageDetailsActivityTest import com.flowcrypt.email.util.GeneralUtil import com.flowcrypt.email.util.PrivateKeysManager @@ -78,7 +78,10 @@ class MessageDetailsActivityPassphraseInRamTest : BaseMessageDetailsActivityTest val decryptErrorMsgBlock = incomingMsgInfo.msgBlocks?.get(1) as DecryptErrorMsgBlock val decryptError = decryptErrorMsgBlock.decryptErr!! - assertEquals(PgpDecrypt.DecryptionErrorType.NEED_PASSPHRASE, decryptError.details?.type) + assertEquals( + PgpDecryptAndOrVerify.DecryptionErrorType.NEED_PASSPHRASE, + decryptError.details?.type + ) //check error message val errorMsg = getResString( diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/DecryptErrorDetails.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/DecryptErrorDetails.kt index b4ecf782a4..fd26313048 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/DecryptErrorDetails.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/DecryptErrorDetails.kt @@ -7,7 +7,7 @@ package com.flowcrypt.email.api.retrofit.response.model import android.os.Parcel import android.os.Parcelable -import com.flowcrypt.email.security.pgp.PgpDecrypt +import com.flowcrypt.email.security.pgp.PgpDecryptAndOrVerify import com.google.gson.annotations.Expose /** @@ -17,11 +17,11 @@ import com.google.gson.annotations.Expose * E-mail: DenBond7@gmail.com */ data class DecryptErrorDetails( - @Expose val type: PgpDecrypt.DecryptionErrorType?, + @Expose val type: PgpDecryptAndOrVerify.DecryptionErrorType?, @Expose val message: String? ) : Parcelable { constructor(source: Parcel) : this( - source.readParcelable(PgpDecrypt.DecryptionErrorType::class.java.classLoader), + source.readParcelable(PgpDecryptAndOrVerify.DecryptionErrorType::class.java.classLoader), source.readString() ) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/MsgDetailsViewModel.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/MsgDetailsViewModel.kt index f78ce564dc..ec2858400f 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/MsgDetailsViewModel.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/viewmodel/MsgDetailsViewModel.kt @@ -41,7 +41,7 @@ import com.flowcrypt.email.jetpack.workmanager.sync.UpdateMsgsSeenStateWorker import com.flowcrypt.email.model.MessageEncryptionType import com.flowcrypt.email.security.KeyStoreCryptoManager import com.flowcrypt.email.security.KeysStorageImpl -import com.flowcrypt.email.security.pgp.PgpDecrypt +import com.flowcrypt.email.security.pgp.PgpDecryptAndOrVerify import com.flowcrypt.email.security.pgp.PgpKey import com.flowcrypt.email.security.pgp.PgpMsg import com.flowcrypt.email.ui.activity.SearchMessagesActivity @@ -429,7 +429,7 @@ class MsgDetailsViewModel( } is DecryptErrorMsgBlock -> { - if (block.decryptErr?.details?.type == PgpDecrypt.DecryptionErrorType.NEED_PASSPHRASE) { + if (block.decryptErr?.details?.type == PgpDecryptAndOrVerify.DecryptionErrorType.NEED_PASSPHRASE) { val fingerprints = block.decryptErr.fingerprints ?: emptyList() if (fingerprints.isEmpty()) { ExceptionUtil.handleError(IllegalStateException("Fingerprints were not provided")) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/KeysStorageImpl.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/KeysStorageImpl.kt index 7b11bd8e46..9bb327c317 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/KeysStorageImpl.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/KeysStorageImpl.kt @@ -15,7 +15,7 @@ import com.flowcrypt.email.database.entity.KeyEntity import com.flowcrypt.email.extensions.org.bouncycastle.openpgp.toPgpKeyDetails import com.flowcrypt.email.model.KeysStorage import com.flowcrypt.email.security.model.PgpKeyDetails -import com.flowcrypt.email.security.pgp.PgpDecrypt +import com.flowcrypt.email.security.pgp.PgpDecryptAndOrVerify import com.flowcrypt.email.security.pgp.PgpKey import com.flowcrypt.email.util.exception.DecryptionException import org.bouncycastle.openpgp.PGPException @@ -176,7 +176,7 @@ class KeysStorageImpl private constructor(context: Context) : KeysStorage { if (passphrase == null || passphrase.isEmpty) { if (throwException) { throw DecryptionException( - decryptionErrorType = PgpDecrypt.DecryptionErrorType.NEED_PASSPHRASE, + decryptionErrorType = PgpDecryptAndOrVerify.DecryptionErrorType.NEED_PASSPHRASE, e = PGPException("flowcrypt: need passphrase"), fingerprints = listOf(fingerprint) ) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/SecurityUtils.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/SecurityUtils.kt index 91d75180be..58b2ba8463 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/SecurityUtils.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/SecurityUtils.kt @@ -13,7 +13,7 @@ import com.flowcrypt.email.database.FlowCryptRoomDatabase import com.flowcrypt.email.database.entity.AccountEntity import com.flowcrypt.email.extensions.org.bouncycastle.openpgp.toPgpKeyDetails import com.flowcrypt.email.security.model.PgpKeyDetails -import com.flowcrypt.email.security.pgp.PgpDecrypt +import com.flowcrypt.email.security.pgp.PgpDecryptAndOrVerify import com.flowcrypt.email.security.pgp.PgpKey import com.flowcrypt.email.security.pgp.PgpPwd import com.flowcrypt.email.util.exception.DifferentPassPhrasesException @@ -181,7 +181,9 @@ class SecurityUtils { * If yes - it can mean the file is encrypted */ fun isEncryptedData(fileName: String?): Boolean { - return PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find(fileName ?: "") != null + return PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find( + fileName ?: "" + ) != null } } } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecrypt.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerify.kt similarity index 99% rename from FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecrypt.kt rename to FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerify.kt index a926f82179..3d22c25b95 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecrypt.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerify.kt @@ -33,7 +33,7 @@ import java.io.OutputStream * Time: 2:10 PM * E-mail: DenBond7@gmail.com */ -object PgpDecrypt { +object PgpDecryptAndOrVerify { val DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN = "(?i)(\\.pgp$)|(\\.gpg$)|(\\.[a-zA-Z0-9]{3,4}\\.asc$)".toRegex() diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt index a3117e94d0..5d17998a49 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt @@ -982,7 +982,7 @@ object PgpMsg { protector: SecretKeyRingProtector ): MsgBlock { // encrypted public key attached - val decryptionResult = PgpDecrypt.decryptWithResult( + val decryptionResult = PgpDecryptAndOrVerify.decryptWithResult( srcInputStream = msgBlock.content?.toInputStream()!!, pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, @@ -1003,7 +1003,7 @@ object PgpMsg { pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): DecryptedAndOrSignedContentMsgBlock { - val decryptionResult = PgpDecrypt.decryptWithResult( + val decryptionResult = PgpDecryptAndOrVerify.decryptWithResult( srcInputStream = msgBlock.content?.toInputStream()!!, pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, @@ -1039,8 +1039,8 @@ object PgpMsg { ) } } else { - if (PgpDecrypt.DecryptionErrorType.NO_MDC == decryptionResult.exception.decryptionErrorType) { - val resultWithIgnoredMDCErrors = PgpDecrypt.decryptWithResult( + if (PgpDecryptAndOrVerify.DecryptionErrorType.NO_MDC == decryptionResult.exception.decryptionErrorType) { + val resultWithIgnoredMDCErrors = PgpDecryptAndOrVerify.decryptWithResult( srcInputStream = msgBlock.content?.toInputStream()!!, pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentDownloadManagerService.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentDownloadManagerService.kt index 053eb3fab3..9a1d84e252 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentDownloadManagerService.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentDownloadManagerService.kt @@ -38,7 +38,7 @@ import com.flowcrypt.email.extensions.kotlin.toHex import com.flowcrypt.email.jetpack.viewmodel.AccountViewModel import com.flowcrypt.email.security.KeysStorageImpl import com.flowcrypt.email.security.SecurityUtils -import com.flowcrypt.email.security.pgp.PgpDecrypt +import com.flowcrypt.email.security.pgp.PgpDecryptAndOrVerify import com.flowcrypt.email.util.FileAndDirectoryUtils import com.flowcrypt.email.util.GeneralUtil import com.flowcrypt.email.util.LogsUtil @@ -534,7 +534,7 @@ class AttachmentDownloadManagerService : Service() { @RequiresApi(Build.VERSION_CODES.Q) private fun storeFileUsingScopedStorage(context: Context, attFile: File): Uri { val resolver = context.contentResolver - val fileExtension = FilenameUtils.getExtension(att.name).toLowerCase(Locale.getDefault()) + val fileExtension = FilenameUtils.getExtension(att.name).lowercase(Locale.getDefault()) val mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension) val contentValues = ContentValues().apply { @@ -673,7 +673,7 @@ class AttachmentDownloadManagerService : Service() { val protector = KeysStorageImpl.getInstance(context).getSecretKeyRingProtector() try { - val result = PgpDecrypt.decrypt( + val result = PgpDecryptAndOrVerify.decrypt( srcInputStream = inputStream, destOutputStream = decryptedFile.outputStream(), pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentNotificationManager.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentNotificationManager.kt index c4d7d3c1d2..4be2863203 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentNotificationManager.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentNotificationManager.kt @@ -17,7 +17,7 @@ import androidx.core.app.NotificationCompat import com.flowcrypt.email.BuildConfig import com.flowcrypt.email.R import com.flowcrypt.email.api.email.model.AttachmentInfo -import com.flowcrypt.email.security.pgp.PgpDecrypt +import com.flowcrypt.email.security.pgp.PgpDecryptAndOrVerify import com.flowcrypt.email.ui.notifications.CustomNotificationManager import com.flowcrypt.email.ui.notifications.NotificationChannelManager import com.flowcrypt.email.util.GeneralUtil @@ -150,7 +150,7 @@ class AttachmentNotificationManager(context: Context) : CustomNotificationManage } if (e is DecryptionException) { - if (e.decryptionErrorType == PgpDecrypt.DecryptionErrorType.NEED_PASSPHRASE) { + if (e.decryptionErrorType == PgpDecryptAndOrVerify.DecryptionErrorType.NEED_PASSPHRASE) { contentText.clear() contentText.append(context.getString(R.string.provide_passphrase_to_decrypt_file)) val fingerprint = e.fingerprints.firstOrNull() diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MessageDetailsFragment.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MessageDetailsFragment.kt index 0fbc1e79ef..40383877e4 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MessageDetailsFragment.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MessageDetailsFragment.kt @@ -76,7 +76,7 @@ import com.flowcrypt.email.model.MessageEncryptionType import com.flowcrypt.email.model.MessageType import com.flowcrypt.email.security.SecurityUtils import com.flowcrypt.email.security.model.PgpKeyDetails -import com.flowcrypt.email.security.pgp.PgpDecrypt +import com.flowcrypt.email.security.pgp.PgpDecryptAndOrVerify import com.flowcrypt.email.service.attachment.AttachmentDownloadManagerService import com.flowcrypt.email.ui.activity.CreateMessageActivity import com.flowcrypt.email.ui.activity.ImportPrivateKeyActivity @@ -144,7 +144,7 @@ class MessageDetailsFragment : BaseFragment(), ProgressBehaviour, View.OnClickLi if (block.type == MsgBlock.Type.DECRYPT_ERROR) { val decryptErrorMsgBlock = block as? DecryptErrorMsgBlock ?: continue val decryptErrorDetails = decryptErrorMsgBlock.decryptErr?.details ?: continue - if (decryptErrorDetails.type == PgpDecrypt.DecryptionErrorType.NEED_PASSPHRASE) { + if (decryptErrorDetails.type == PgpDecryptAndOrVerify.DecryptionErrorType.NEED_PASSPHRASE) { val fingerprints = decryptErrorMsgBlock.decryptErr.fingerprints ?: continue showNeedPassphraseDialog( fingerprints, @@ -1156,13 +1156,13 @@ class MessageDetailsFragment : BaseFragment(), ProgressBehaviour, View.OnClickLi val decryptError = block.decryptErr ?: return View(context) when (decryptError.details?.type) { - PgpDecrypt.DecryptionErrorType.KEY_MISMATCH -> return generateMissingPrivateKeyLayout( + PgpDecryptAndOrVerify.DecryptionErrorType.KEY_MISMATCH -> return generateMissingPrivateKeyLayout( clipLargeText( block.content ), layoutInflater ) - PgpDecrypt.DecryptionErrorType.FORMAT -> { + PgpDecryptAndOrVerify.DecryptionErrorType.FORMAT -> { val formatErrorMsg = (getString( R.string.decrypt_error_message_badly_formatted, getString(R.string.app_name) @@ -1171,7 +1171,7 @@ class MessageDetailsFragment : BaseFragment(), ProgressBehaviour, View.OnClickLi return getView(clipLargeText(block.content), formatErrorMsg, layoutInflater) } - PgpDecrypt.DecryptionErrorType.OTHER -> { + PgpDecryptAndOrVerify.DecryptionErrorType.OTHER -> { val otherErrorMsg = getString(R.string.decrypt_error_could_not_open_message, getString(R.string.app_name)) + "\n\n" + getString( @@ -1185,7 +1185,7 @@ class MessageDetailsFragment : BaseFragment(), ProgressBehaviour, View.OnClickLi else -> { var btText: String? = null var onClickListener: View.OnClickListener? = null - if (decryptError.details?.type == PgpDecrypt.DecryptionErrorType.NEED_PASSPHRASE) { + if (decryptError.details?.type == PgpDecryptAndOrVerify.DecryptionErrorType.NEED_PASSPHRASE) { btText = getString(R.string.fix) onClickListener = View.OnClickListener { val fingerprints = decryptError.fingerprints ?: return@OnClickListener @@ -1194,8 +1194,8 @@ class MessageDetailsFragment : BaseFragment(), ProgressBehaviour, View.OnClickLi } val detailedMessage = when (decryptError.details?.type) { - PgpDecrypt.DecryptionErrorType.NO_MDC -> getString(R.string.decrypt_error_message_no_mdc) - PgpDecrypt.DecryptionErrorType.BAD_MDC -> getString(R.string.decrypt_error_message_bad_mdc) + PgpDecryptAndOrVerify.DecryptionErrorType.NO_MDC -> getString(R.string.decrypt_error_message_no_mdc) + PgpDecryptAndOrVerify.DecryptionErrorType.BAD_MDC -> getString(R.string.decrypt_error_message_bad_mdc) else -> decryptError.details?.message } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/util/exception/DecryptionException.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/util/exception/DecryptionException.kt index 05753face1..9f4c7a9e71 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/util/exception/DecryptionException.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/util/exception/DecryptionException.kt @@ -7,7 +7,7 @@ package com.flowcrypt.email.util.exception import com.flowcrypt.email.api.retrofit.response.model.DecryptError import com.flowcrypt.email.api.retrofit.response.model.DecryptErrorDetails -import com.flowcrypt.email.security.pgp.PgpDecrypt +import com.flowcrypt.email.security.pgp.PgpDecryptAndOrVerify /** * @author Denis Bondarenko @@ -16,7 +16,7 @@ import com.flowcrypt.email.security.pgp.PgpDecrypt * E-mail: DenBond7@gmail.com */ class DecryptionException( - val decryptionErrorType: PgpDecrypt.DecryptionErrorType, + val decryptionErrorType: PgpDecryptAndOrVerify.DecryptionErrorType, val e: Exception, val fingerprints: List = emptyList() ) : FlowCryptException(e) { diff --git a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptTest.kt b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerifyTest.kt similarity index 79% rename from FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptTest.kt rename to FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerifyTest.kt index 82b7f72c5e..8db6bdcc86 100644 --- a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptTest.kt +++ b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerifyTest.kt @@ -27,7 +27,7 @@ import org.pgpainless.key.util.KeyRingUtils import org.pgpainless.util.Passphrase import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream -import java.util.* +import java.util.UUID /** * @author Denis Bondarenko @@ -35,7 +35,7 @@ import java.util.* * Time: 9:28 AM * E-mail: DenBond7@gmail.com */ -class PgpDecryptTest { +class PgpDecryptAndOrVerifyTest { @get:Rule val temporaryFolder: TemporaryFolder = TemporaryFolder() @@ -79,7 +79,7 @@ class PgpDecryptTest { .simpleEcKeyRing("random@flowcrypt.test", "qwerty") val exception = Assert.assertThrows(DecryptionException::class.java) { - PgpDecrypt.decrypt( + PgpDecryptAndOrVerify.decrypt( srcInputStream = ByteArrayInputStream(encryptedBytes), destOutputStream = outputStreamWithDecryptedData, pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(listOf(randomKey)), @@ -92,7 +92,7 @@ class PgpDecryptTest { Assert.assertEquals( exception.decryptionErrorType, - PgpDecrypt.DecryptionErrorType.KEY_MISMATCH + PgpDecryptAndOrVerify.DecryptionErrorType.KEY_MISMATCH ) } @@ -116,7 +116,7 @@ class PgpDecryptTest { val encryptedBytes = outputStreamForEncryptedSource.toByteArray() val outputStreamWithDecryptedData = ByteArrayOutputStream() val exception = Assert.assertThrows(DecryptionException::class.java) { - PgpDecrypt.decrypt( + PgpDecryptAndOrVerify.decrypt( srcInputStream = ByteArrayInputStream(encryptedBytes), destOutputStream = outputStreamWithDecryptedData, pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(listOf(receiverPGPSecretKeyRing)), @@ -129,7 +129,7 @@ class PgpDecryptTest { Assert.assertEquals( exception.decryptionErrorType, - PgpDecrypt.DecryptionErrorType.WRONG_PASSPHRASE + PgpDecryptAndOrVerify.DecryptionErrorType.WRONG_PASSPHRASE ) } @@ -160,22 +160,22 @@ class PgpDecryptTest { @Test fun testPatternToDetectEncryptedAtts() { //"(?i)(\\.pgp$)|(\\.gpg$)|(\\.[a-zA-Z0-9]{3,4}\\.asc$)" - assertNotNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("file.pgp")) - assertNotNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("file.PgP")) - assertNotNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("file.gpg")) - assertNotNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("file.gPg")) - assertNotNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.fs12.asc")) - assertNotNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.fs12.ASC")) - assertNotNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.s12.asc")) - assertNotNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.ft2.ASC")) - assertNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("filepgp")) - assertNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("filePgP")) - assertNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("filegpg")) - assertNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("filegPg")) - assertNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.fs12asc")) - assertNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.fs12ASC")) - assertNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.s12asc")) - assertNull(PgpDecrypt.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.ft2ASC")) + assertNotNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("file.pgp")) + assertNotNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("file.PgP")) + assertNotNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("file.gpg")) + assertNotNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("file.gPg")) + assertNotNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.fs12.asc")) + assertNotNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.fs12.ASC")) + assertNotNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.s12.asc")) + assertNotNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.ft2.ASC")) + assertNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("filepgp")) + assertNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("filePgP")) + assertNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("filegpg")) + assertNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("filegPg")) + assertNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.fs12asc")) + assertNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.fs12ASC")) + assertNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.s12asc")) + assertNull(PgpDecryptAndOrVerify.DETECT_SEPARATE_ENCRYPTED_ATTACHMENTS_PATTERN.find("d.ft2ASC")) } private fun testDecryptFileSuccess(shouldSrcBeArmored: Boolean) { @@ -196,7 +196,7 @@ class PgpDecryptTest { val encryptedBytes = outputStreamForEncryptedSource.toByteArray() val outputStreamWithDecryptedData = ByteArrayOutputStream() - PgpDecrypt.decrypt( + PgpDecryptAndOrVerify.decrypt( srcInputStream = ByteArrayInputStream(encryptedBytes), destOutputStream = outputStreamWithDecryptedData, pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(listOf(receiverPGPSecretKeyRing)), diff --git a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt index da4218142d..83dbd02fdc 100644 --- a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt +++ b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt @@ -173,7 +173,7 @@ class PgpMsgTest { assertTrue("Error not returned", r.exception != null) assertTrue( "Missing MDC not detected", - r.exception?.decryptionErrorType == PgpDecrypt.DecryptionErrorType.NO_MDC + r.exception?.decryptionErrorType == PgpDecryptAndOrVerify.DecryptionErrorType.NO_MDC ) } @@ -184,7 +184,7 @@ class PgpMsgTest { assertTrue("Error not returned", r.exception != null) assertTrue( "Bad MDC not detected", - r.exception?.decryptionErrorType == PgpDecrypt.DecryptionErrorType.BAD_MDC + r.exception?.decryptionErrorType == PgpDecryptAndOrVerify.DecryptionErrorType.BAD_MDC ) } @@ -215,7 +215,7 @@ class PgpMsgTest { fun wrongArmorChecksumTest() { val r = processMessage("decrypt - issue 1347 - wrong checksum") assertTrue("Error not returned", r.exception != null) - assertEquals(PgpDecrypt.DecryptionErrorType.FORMAT, r.exception?.decryptionErrorType) + assertEquals(PgpDecryptAndOrVerify.DecryptionErrorType.FORMAT, r.exception?.decryptionErrorType) } @Test @@ -225,7 +225,7 @@ class PgpMsgTest { val privateKeysWithWrongPassPhrases = PRIVATE_KEYS.map { TestKeys.KeyWithPassPhrase(keyRing = it.keyRing, passphrase = wrongPassphrase) } - val r = PgpDecrypt.decryptWithResult( + val r = PgpDecryptAndOrVerify.decryptWithResult( srcInputStream = messageInfo.armored.byteInputStream(), pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(privateKeysWithWrongPassPhrases.map { it.keyRing }), @@ -235,14 +235,14 @@ class PgpMsgTest { assertTrue("Error not returned", r.exception != null) assertTrue( "Wrong passphrase not detected", - r.exception?.decryptionErrorType == PgpDecrypt.DecryptionErrorType.WRONG_PASSPHRASE + r.exception?.decryptionErrorType == PgpDecryptAndOrVerify.DecryptionErrorType.WRONG_PASSPHRASE ) } @Test fun missingPassphraseTest() { val messageInfo = findMessage("decrypt - without a subject") - val r = PgpDecrypt.decryptWithResult( + val r = PgpDecryptAndOrVerify.decryptWithResult( srcInputStream = messageInfo.armored.byteInputStream(), pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(PRIVATE_KEYS.map { it.keyRing }), @@ -252,7 +252,7 @@ class PgpMsgTest { assertTrue("Error returned", r.exception != null) assertTrue( "Missing passphrase not detected", - r.exception?.decryptionErrorType == PgpDecrypt.DecryptionErrorType.WRONG_PASSPHRASE + r.exception?.decryptionErrorType == PgpDecryptAndOrVerify.DecryptionErrorType.WRONG_PASSPHRASE ) } @@ -260,7 +260,7 @@ class PgpMsgTest { fun wrongKeyTest() { val messageInfo = findMessage("decrypt - without a subject") val wrongKey = listOf(PRIVATE_KEYS[1]) - val r = PgpDecrypt.decryptWithResult( + val r = PgpDecryptAndOrVerify.decryptWithResult( messageInfo.armored.byteInputStream(), pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(wrongKey.map { it.keyRing }), @@ -270,7 +270,7 @@ class PgpMsgTest { assertTrue("Error not returned", r.exception != null) assertTrue( "Key mismatch not detected", - r.exception?.decryptionErrorType == PgpDecrypt.DecryptionErrorType.KEY_MISMATCH + r.exception?.decryptionErrorType == PgpDecryptAndOrVerify.DecryptionErrorType.KEY_MISMATCH ) } @@ -290,9 +290,9 @@ class PgpMsgTest { ) } - private fun processMessage(messageKey: String): PgpDecrypt.DecryptionResult { + private fun processMessage(messageKey: String): PgpDecryptAndOrVerify.DecryptionResult { val messageInfo = findMessage(messageKey) - val result = PgpDecrypt.decryptWithResult( + val result = PgpDecryptAndOrVerify.decryptWithResult( messageInfo.armored.byteInputStream(), pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(PRIVATE_KEYS.map { it.keyRing }), @@ -434,7 +434,7 @@ class PgpMsgTest { fun testParseDecryptMsgUnescapedSpecialCharactersInEncryptedPgpMime() { val text = loadResourceAsString("compat/direct-encrypted-pgpmime-special-chars.txt") val keys = TestKeys.KEYS["rsa1"]!!.listOfKeysWithPassPhrase - val decryptResult = PgpDecrypt.decryptWithResult( + val decryptResult = PgpDecryptAndOrVerify.decryptWithResult( srcInputStream = text.toInputStream(), pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), @@ -458,7 +458,7 @@ class PgpMsgTest { val text = loadResourceAsString("compat/direct-encrypted-text-special-chars.txt") val keys = TestKeys.KEYS["rsa1"]!!.listOfKeysWithPassPhrase - val decryptResult = PgpDecrypt.decryptWithResult( + val decryptResult = PgpDecryptAndOrVerify.decryptWithResult( text.toInputStream(), pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), From a2440d7ea8c23ca5945a973df0aa0be1d7d4927f Mon Sep 17 00:00:00 2001 From: DenBond7 Date: Mon, 13 Dec 2021 11:03:26 +0200 Subject: [PATCH 03/12] Renamed PgpEncrypt to PgpEncryptAndOrSign.| #1097 --- .../main/java/com/flowcrypt/email/api/email/EmailUtil.kt | 4 ++-- .../workmanager/ForwardedAttachmentsDownloaderWorker.kt | 4 ++-- .../security/pgp/{PgpEncrypt.kt => PgpEncryptAndOrSign.kt} | 2 +- .../service/PrepareOutgoingMessagesJobIntentService.kt | 4 ++-- .../email/security/pgp/PgpDecryptAndOrVerifyTest.kt | 6 +++--- .../pgp/{PgpEncryptTest.kt => PgpEncryptAndOrSignTest.kt} | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) rename FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/{PgpEncrypt.kt => PgpEncryptAndOrSign.kt} (99%) rename FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/{PgpEncryptTest.kt => PgpEncryptAndOrSignTest.kt} (98%) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/EmailUtil.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/EmailUtil.kt index 3da0232165..186bca656b 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/EmailUtil.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/EmailUtil.kt @@ -30,7 +30,7 @@ import com.flowcrypt.email.security.KeyStoreCryptoManager import com.flowcrypt.email.security.KeysStorageImpl import com.flowcrypt.email.security.SecurityUtils import com.flowcrypt.email.security.model.PgpKeyDetails -import com.flowcrypt.email.security.pgp.PgpEncrypt +import com.flowcrypt.email.security.pgp.PgpEncryptAndOrSign import com.flowcrypt.email.util.GeneralUtil import com.flowcrypt.email.util.SharedPreferencesHelper import com.flowcrypt.email.util.exception.ExceptionUtil @@ -1123,7 +1123,7 @@ class EmailUtil { protector: SecretKeyRingProtector? = null ): String { return if (info.encryptionType == MessageEncryptionType.ENCRYPTED) { - PgpEncrypt.encryptAndOrSignMsg( + PgpEncryptAndOrSign.encryptAndOrSignMsg( msg = info.msg ?: "", pubKeys = pubKeys ?: emptyList(), prvKeys = prvKeys, diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/workmanager/ForwardedAttachmentsDownloaderWorker.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/workmanager/ForwardedAttachmentsDownloaderWorker.kt index 4768de94d3..4de474f16a 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/workmanager/ForwardedAttachmentsDownloaderWorker.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/jetpack/workmanager/ForwardedAttachmentsDownloaderWorker.kt @@ -28,7 +28,7 @@ import com.flowcrypt.email.database.entity.MessageEntity import com.flowcrypt.email.extensions.kotlin.toHex import com.flowcrypt.email.jetpack.viewmodel.AccountViewModel import com.flowcrypt.email.security.SecurityUtils -import com.flowcrypt.email.security.pgp.PgpEncrypt +import com.flowcrypt.email.security.pgp.PgpEncryptAndOrSign import com.flowcrypt.email.ui.notifications.ErrorNotificationManager import com.flowcrypt.email.util.FileAndDirectoryUtils import com.flowcrypt.email.util.GeneralUtil @@ -295,7 +295,7 @@ class ForwardedAttachmentsDownloaderWorker(context: Context, params: WorkerParam withContext(Dispatchers.IO) { if (msgEntity.isEncrypted == true) { requireNotNull(pubKeys) - PgpEncrypt.encryptAndOrSign(srcInputStream, destFile.outputStream(), pubKeys) + PgpEncryptAndOrSign.encryptAndOrSign(srcInputStream, destFile.outputStream(), pubKeys) } else { FileUtils.copyInputStreamToFile(srcInputStream, destFile) } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpEncrypt.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpEncryptAndOrSign.kt similarity index 99% rename from FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpEncrypt.kt rename to FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpEncryptAndOrSign.kt index 0306ca2a97..8141d69972 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpEncrypt.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpEncryptAndOrSign.kt @@ -27,7 +27,7 @@ import java.io.OutputStream * Time: 3:28 PM * E-mail: DenBond7@gmail.com */ -object PgpEncrypt { +object PgpEncryptAndOrSign { fun encryptAndOrSignMsg( msg: String, pubKeys: List, diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/service/PrepareOutgoingMessagesJobIntentService.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/service/PrepareOutgoingMessagesJobIntentService.kt index 2001dd4235..1c4ae2c5b1 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/service/PrepareOutgoingMessagesJobIntentService.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/service/PrepareOutgoingMessagesJobIntentService.kt @@ -28,7 +28,7 @@ import com.flowcrypt.email.jobscheduler.JobIdManager import com.flowcrypt.email.model.MessageEncryptionType import com.flowcrypt.email.model.MessageType import com.flowcrypt.email.security.SecurityUtils -import com.flowcrypt.email.security.pgp.PgpEncrypt +import com.flowcrypt.email.security.pgp.PgpEncryptAndOrSign import com.flowcrypt.email.ui.notifications.ErrorNotificationManager import com.flowcrypt.email.util.FileAndDirectoryUtils import com.flowcrypt.email.util.GeneralUtil @@ -311,7 +311,7 @@ class PrepareOutgoingMessagesJobIntentService : JobIntentService() { } requireNotNull(pubKeys) - PgpEncrypt.encryptAndOrSign( + PgpEncryptAndOrSign.encryptAndOrSign( originalFileInputStream, encryptedTempFile.outputStream(), pubKeys diff --git a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerifyTest.kt b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerifyTest.kt index 8db6bdcc86..2cfe6cc99c 100644 --- a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerifyTest.kt +++ b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerifyTest.kt @@ -61,7 +61,7 @@ class PgpDecryptAndOrVerifyTest { val srcFile = temporaryFolder.createFileWithRandomData(fileSizeInBytes = FileUtils.ONE_MB) val sourceBytes = srcFile.readBytes() val outputStreamForEncryptedSource = ByteArrayOutputStream() - PgpEncrypt.encryptAndOrSign( + PgpEncryptAndOrSign.encryptAndOrSign( srcInputStream = ByteArrayInputStream(sourceBytes), destOutputStream = outputStreamForEncryptedSource, pgpPublicKeyRingCollection = PGPPublicKeyRingCollection( @@ -101,7 +101,7 @@ class PgpDecryptAndOrVerifyTest { val srcFile = temporaryFolder.createFileWithRandomData(fileSizeInBytes = FileUtils.ONE_MB) val sourceBytes = srcFile.readBytes() val outputStreamForEncryptedSource = ByteArrayOutputStream() - PgpEncrypt.encryptAndOrSign( + PgpEncryptAndOrSign.encryptAndOrSign( srcInputStream = ByteArrayInputStream(sourceBytes), destOutputStream = outputStreamForEncryptedSource, pgpPublicKeyRingCollection = PGPPublicKeyRingCollection( @@ -182,7 +182,7 @@ class PgpDecryptAndOrVerifyTest { val srcFile = temporaryFolder.createFileWithRandomData(fileSizeInBytes = FileUtils.ONE_MB) val sourceBytes = srcFile.readBytes() val outputStreamForEncryptedSource = ByteArrayOutputStream() - PgpEncrypt.encryptAndOrSign( + PgpEncryptAndOrSign.encryptAndOrSign( srcInputStream = ByteArrayInputStream(sourceBytes), destOutputStream = outputStreamForEncryptedSource, pgpPublicKeyRingCollection = PGPPublicKeyRingCollection( diff --git a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpEncryptTest.kt b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpEncryptAndOrSignTest.kt similarity index 98% rename from FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpEncryptTest.kt rename to FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpEncryptAndOrSignTest.kt index 456618520f..8cc156a562 100644 --- a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpEncryptTest.kt +++ b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpEncryptAndOrSignTest.kt @@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream * Time: 3:59 PM * E-mail: DenBond7@gmail.com */ -class PgpEncryptTest { +class PgpEncryptAndOrSignTest { @Test fun testEncryptFile() { @@ -37,7 +37,7 @@ class PgpEncryptTest { val sourceBytes = source.toByteArray() val outputStreamForEncryptedSource = ByteArrayOutputStream() - PgpEncrypt.encryptAndOrSign( + PgpEncryptAndOrSign.encryptAndOrSign( srcInputStream = ByteArrayInputStream(sourceBytes), destOutputStream = outputStreamForEncryptedSource, pgpPublicKeyRingCollection = PGPPublicKeyRingCollection( From 0e8aa3558a3a7feeb6008ce9cdce6d80905cb2e1 Mon Sep 17 00:00:00 2001 From: DenBond7 Date: Mon, 13 Dec 2021 11:05:33 +0200 Subject: [PATCH 04/12] Refactored code.| #1097 --- .../email/security/pgp/PgpDecryptAndOrVerify.kt | 2 +- .../java/com/flowcrypt/email/security/pgp/PgpMsg.kt | 6 +++--- .../com/flowcrypt/email/security/pgp/PgpMsgTest.kt | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerify.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerify.kt index 3d22c25b95..7d45e7a0c9 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerify.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerify.kt @@ -62,7 +62,7 @@ object PgpDecryptAndOrVerify { } } - fun decryptWithResult( + fun decryptAndOrVerifyWithResult( srcInputStream: InputStream, pgpPublicKeyRingCollection: PGPPublicKeyRingCollection, pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt index 5d17998a49..25a3b187ee 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt @@ -982,7 +982,7 @@ object PgpMsg { protector: SecretKeyRingProtector ): MsgBlock { // encrypted public key attached - val decryptionResult = PgpDecryptAndOrVerify.decryptWithResult( + val decryptionResult = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( srcInputStream = msgBlock.content?.toInputStream()!!, pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, @@ -1003,7 +1003,7 @@ object PgpMsg { pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): DecryptedAndOrSignedContentMsgBlock { - val decryptionResult = PgpDecryptAndOrVerify.decryptWithResult( + val decryptionResult = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( srcInputStream = msgBlock.content?.toInputStream()!!, pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, @@ -1040,7 +1040,7 @@ object PgpMsg { } } else { if (PgpDecryptAndOrVerify.DecryptionErrorType.NO_MDC == decryptionResult.exception.decryptionErrorType) { - val resultWithIgnoredMDCErrors = PgpDecryptAndOrVerify.decryptWithResult( + val resultWithIgnoredMDCErrors = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( srcInputStream = msgBlock.content?.toInputStream()!!, pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, diff --git a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt index 83dbd02fdc..194051d432 100644 --- a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt +++ b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt @@ -225,7 +225,7 @@ class PgpMsgTest { val privateKeysWithWrongPassPhrases = PRIVATE_KEYS.map { TestKeys.KeyWithPassPhrase(keyRing = it.keyRing, passphrase = wrongPassphrase) } - val r = PgpDecryptAndOrVerify.decryptWithResult( + val r = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( srcInputStream = messageInfo.armored.byteInputStream(), pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(privateKeysWithWrongPassPhrases.map { it.keyRing }), @@ -242,7 +242,7 @@ class PgpMsgTest { @Test fun missingPassphraseTest() { val messageInfo = findMessage("decrypt - without a subject") - val r = PgpDecryptAndOrVerify.decryptWithResult( + val r = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( srcInputStream = messageInfo.armored.byteInputStream(), pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(PRIVATE_KEYS.map { it.keyRing }), @@ -260,7 +260,7 @@ class PgpMsgTest { fun wrongKeyTest() { val messageInfo = findMessage("decrypt - without a subject") val wrongKey = listOf(PRIVATE_KEYS[1]) - val r = PgpDecryptAndOrVerify.decryptWithResult( + val r = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( messageInfo.armored.byteInputStream(), pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(wrongKey.map { it.keyRing }), @@ -292,7 +292,7 @@ class PgpMsgTest { private fun processMessage(messageKey: String): PgpDecryptAndOrVerify.DecryptionResult { val messageInfo = findMessage(messageKey) - val result = PgpDecryptAndOrVerify.decryptWithResult( + val result = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( messageInfo.armored.byteInputStream(), pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(PRIVATE_KEYS.map { it.keyRing }), @@ -434,7 +434,7 @@ class PgpMsgTest { fun testParseDecryptMsgUnescapedSpecialCharactersInEncryptedPgpMime() { val text = loadResourceAsString("compat/direct-encrypted-pgpmime-special-chars.txt") val keys = TestKeys.KEYS["rsa1"]!!.listOfKeysWithPassPhrase - val decryptResult = PgpDecryptAndOrVerify.decryptWithResult( + val decryptResult = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( srcInputStream = text.toInputStream(), pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), @@ -458,7 +458,7 @@ class PgpMsgTest { val text = loadResourceAsString("compat/direct-encrypted-text-special-chars.txt") val keys = TestKeys.KEYS["rsa1"]!!.listOfKeysWithPassPhrase - val decryptResult = PgpDecryptAndOrVerify.decryptWithResult( + val decryptResult = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( text.toInputStream(), pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), From cd28e9945cc54efb8ae62d9cb6c972621c666df4 Mon Sep 17 00:00:00 2001 From: DenBond7 Date: Mon, 13 Dec 2021 11:50:01 +0200 Subject: [PATCH 05/12] Added signature verification for cleartext.| #1097 --- .../retrofit/response/model/SignedMsgBlock.kt | 3 + .../flowcrypt/email/security/pgp/PgpMsg.kt | 69 +++++++++++++------ .../email/security/pgp/PgpSignature.kt | 35 ++++++++++ 3 files changed, 87 insertions(+), 20 deletions(-) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/SignedMsgBlock.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/SignedMsgBlock.kt index 7cf9e71d4b..b1899953d0 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/SignedMsgBlock.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/SignedMsgBlock.kt @@ -9,6 +9,7 @@ package com.flowcrypt.email.api.retrofit.response.model import android.os.Parcel import android.os.Parcelable import com.google.gson.annotations.Expose +import org.pgpainless.decryption_verification.OpenPgpMetadata /** * Message block which represents content with a signature. @@ -21,6 +22,8 @@ data class SignedMsgBlock( @Expose override val error: MsgBlockError? = null ) : MsgBlock { + var openPgpMetadata: OpenPgpMetadata? = null + @Expose override val type: MsgBlock.Type = when (signedType) { Type.SIGNED_MSG -> MsgBlock.Type.SIGNED_MSG diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt index 25a3b187ee..7a15526b78 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt @@ -828,31 +828,50 @@ object PgpMsg { // So, at least meanwhile, not porting this: // block.content = isContentBlock(block.type) // ? block.content.toUtfStr() : block.content.toRawBytesStr(); - if (block is DecryptedAndOrSignedContentMsgBlock) { + if (block.type in listOf( + MsgBlock.Type.SIGNED_MSG, + MsgBlock.Type.DECRYPTED_AND_OR_SIGNED_CONTENT + ) + ) { + val openPgpMetadata = when (block) { + is DecryptedAndOrSignedContentMsgBlock -> { + block.openPgpMetadata + } + + is SignedMsgBlock -> { + block.openPgpMetadata + } + + else -> null + } + if (!isEncrypted) { - isEncrypted = block.openPgpMetadata?.isEncrypted ?: false + isEncrypted = openPgpMetadata?.isEncrypted ?: false } - if (block.openPgpMetadata?.isSigned == true) { + if (openPgpMetadata?.isSigned == true) { signedBlockCount++ - block.openPgpMetadata?.let { openPgpMetadata -> - if (openPgpMetadata.invalidInbandSignatures.isNotEmpty() - || openPgpMetadata.invalidDetachedSignatures.isNotEmpty() - ) { - hasUnverifiedSignatures = true - } - if (verifiedSignatures.isEmpty()) { + + if (openPgpMetadata.invalidInbandSignatures.isNotEmpty() + || openPgpMetadata.invalidDetachedSignatures.isNotEmpty() + ) { + hasUnverifiedSignatures = true + } + + if (verifiedSignatures.isEmpty()) { + verifiedSignatures.putAll(openPgpMetadata.verifiedSignatures) + } else { + val bufferedKeysIds = verifiedSignatures.keys.map { it.keyId } + val iteratedKeysIds = openPgpMetadata.verifiedSignatures.keys.map { it.keyId } + if (bufferedKeysIds != iteratedKeysIds) { + hasMixedSignatures = true verifiedSignatures.putAll(openPgpMetadata.verifiedSignatures) - } else { - if (verifiedSignatures.keys.map { it.keyId } != openPgpMetadata.verifiedSignatures.keys.map { it.keyId }) { - hasMixedSignatures = true - //todo-denbond7 need to check it - verifiedSignatures.putAll(openPgpMetadata.verifiedSignatures) - } } } } + } + if (block is DecryptedAndOrSignedContentMsgBlock) { for (innerBlock in block.blocks) { if (canBeAddedToCombinedContent(innerBlock)) { contentBlocks.add(innerBlock) @@ -909,7 +928,9 @@ object PgpMsg { for (msgBlock in msgBlocks) { when { msgBlock is SignedMsgBlock -> { - processSignedMsgBlock(msgBlock)?.let { sequentialProcessedBlocks.add(it) } + processSignedMsgBlock(msgBlock, pgpPublicKeyRingCollection)?.let { + sequentialProcessedBlocks.add(it) + } } msgBlock.type == MsgBlock.Type.ENCRYPTED_MSG -> { @@ -1078,7 +1099,10 @@ object PgpMsg { } } - private fun processSignedMsgBlock(msgBlock: SignedMsgBlock): MsgBlock? { + private fun processSignedMsgBlock( + msgBlock: SignedMsgBlock, + pgpPublicKeyRingCollection: PGPPublicKeyRingCollection + ): MsgBlock? { return when { msgBlock.signature != null -> { when (msgBlock.type) { @@ -1114,8 +1138,13 @@ object PgpMsg { msgBlock.type == MsgBlock.Type.SIGNED_MSG -> { return try { - val cleartext = PgpSignature.extractClearText(msgBlock.content, false) - msgBlock.copy(content = cleartext) + val clearTextVerificationResult = PgpSignature.verifyClearTextSignature( + srcInputStream = requireNotNull(msgBlock.content?.toInputStream()), + pgpPublicKeyRingCollection = pgpPublicKeyRingCollection + ) + clearTextVerificationResult.exception?.let { throw it } + msgBlock.copy(content = clearTextVerificationResult.clearText) + .apply { openPgpMetadata = clearTextVerificationResult.openPgpMetadata } } catch (e: Exception) { msgBlock.copy(error = MsgBlockError("[" + e.javaClass.simpleName + "]: " + e.message)) } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpSignature.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpSignature.kt index af146f30bf..77ea6e1feb 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpSignature.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpSignature.kt @@ -6,9 +6,15 @@ package com.flowcrypt.email.security.pgp +import org.bouncycastle.openpgp.PGPPublicKeyRingCollection +import org.pgpainless.PGPainless +import org.pgpainless.decryption_verification.ConsumerOptions +import org.pgpainless.decryption_verification.OpenPgpMetadata import org.pgpainless.decryption_verification.cleartext_signatures.ClearsignedMessageUtil +import org.pgpainless.decryption_verification.cleartext_signatures.InMemoryMultiPassStrategy import org.pgpainless.decryption_verification.cleartext_signatures.MultiPassStrategy import java.io.ByteArrayInputStream +import java.io.ByteArrayOutputStream import java.io.InputStream /** @@ -40,4 +46,33 @@ object PgpSignature { } } } + + fun verifyClearTextSignature( + srcInputStream: InputStream, + pgpPublicKeyRingCollection: PGPPublicKeyRingCollection + ): ClearTextVerificationResult { + ByteArrayOutputStream().use { outStream -> + return try { + val verificationStream = PGPainless.verifyCleartextSignedMessage() + .onInputStream(srcInputStream) + .withStrategy(InMemoryMultiPassStrategy()) + .withOptions(ConsumerOptions().addVerificationCerts(pgpPublicKeyRingCollection)) + .verificationStream + + verificationStream.use { it.copyTo(outStream) } + ClearTextVerificationResult( + openPgpMetadata = verificationStream.result, + clearText = String(outStream.toByteArray()) + ) + } catch (e: Exception) { + ClearTextVerificationResult(exception = e) + } + } + } + + data class ClearTextVerificationResult( + val openPgpMetadata: OpenPgpMetadata? = null, + val clearText: String? = null, + val exception: Exception? = null + ) } From 9f80055f2f7028819295e67d844d6aedec4c6d05 Mon Sep 17 00:00:00 2001 From: DenBond7 Date: Mon, 13 Dec 2021 15:38:25 +0200 Subject: [PATCH 06/12] Modifed docker-mailserver source.| #1097 --- .../default/dovecot.list.index.log | Bin 1180 -> 1984 bytes .../INBOX/dbox-Mails/dovecot.index.cache | Bin 25708 -> 27248 bytes .../INBOX/dbox-Mails/dovecot.index.log | Bin 14076 -> 14760 bytes .../default/mailboxes/INBOX/dbox-Mails/u.39 | 47 ++++++++++++++++++ .../default/mailboxes/INBOX/dbox-Mails/u.40 | 42 ++++++++++++++++ .../Trash/dbox-Mails/dovecot.index.cache | Bin 856 -> 1932 bytes .../Trash/dbox-Mails/dovecot.index.log | Bin 3032 -> 3548 bytes .../denbond7/dovecot.list.index.log | Bin 1896 -> 3824 bytes .../Sent/dbox-Mails/dovecot.index.cache | Bin 21040 -> 22564 bytes .../Sent/dbox-Mails/dovecot.index.log | Bin 11024 -> 11636 bytes .../denbond7/mailboxes/Sent/dbox-Mails/u.37 | 38 ++++++++++++++ .../denbond7/mailboxes/Sent/dbox-Mails/u.38 | 33 ++++++++++++ .../Trash/dbox-Mails/dovecot.index.cache | Bin 880 -> 1956 bytes .../Trash/dbox-Mails/dovecot.index.log | Bin 3312 -> 3828 bytes 14 files changed, 160 insertions(+) create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.39 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.40 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.37 create mode 100644 docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.38 diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/dovecot.list.index.log b/docker-mailserver/maildata_source/flowcrypt.test/default/dovecot.list.index.log index 9d65c6acc04040fc4840ac6a95c85b18b56f232d..ae1275e43d1415318ee1f10ea9ab1686e9fc7aa8 100644 GIT binary patch delta 254 zcmbQkd4PYz9F~b5CcI1x5CEb%Cm&?eW)%PlOg_k{EtbH;z#!$dJ+Yyop+$j#LBN55 zg&}}-avh`CWC2D6-do%tl?)6VK+FWz@C1v7DK=I z0JN5 A8UO$Q delta 7 OcmX@WKZkR}92Ni!9RkGw diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/dovecot.index.cache b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/dovecot.index.cache index 642b0e0c68871e3e2a345f8be69aa0b2ff57551b..03935a3c4b2835edfdda7b5274d10f7702aada18 100644 GIT binary patch delta 493 zcmaEJg7L!@#t9;<1z8LX%o`=&hcZifZQsltmdH0bCpuBg$k@Qb)Y!;a&(O@+(!{{X z#MIc_$Z|4&u(YIaex8nkp|OHXYO;cnfsvttp{bRziIt)8WO=o033D@JLrY^*3q3<* zt)>Q(=f#^bT25vRG~~|9S12e=QpirN6o~OblQk#0;U+Coc@t z=R5@!y)pTty(hD|k;UXhYmv$NR*LEd@rKx)sidjk=jj8(lN*DCS#Ef5Pn?_+Av3u^ z-9^IC)WqDx$PDf|GoW8hjg`12E6B(Qqj}8C%ESWbu|P)K$&Rd&VwPs+mKG)m&w;d> zSxgQT5}tfnS#t7+U>=~ti!oYa8ku=XiFqlS3fc-d{5yF30qQJl)V8Fn_ zpn=490P;I5!1ApuKyi?I^~nd>gqhY@Ox`Cf#;5_d1Ei%O9c%}P={(s{!<@7G7sL*Y f$s5gt6*Yn4Fk3*Twpb!e1?kb4JW)`D87K$ +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id KrPbA9hLt2FtDgAAc/RpdQ + (envelope-from ) + for ; Mon, 13 Dec 2021 13:34:16 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 0C05F84061C + for ; Mon, 13 Dec 2021 13:34:16 +0000 (UTC) +Date: Mon, 13 Dec 2021 15:34:13 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <176319358.1.1639402453750@flowcrypt.test> +Subject: Encrypted + signed(inband) + no pub key +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_123085323.1639402453729" + +------=_Part_0_123085323.1639402453729 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdAtdnv+F2LD9GVA09dGxdtNXp9XOUNildn0KoRRyfS71Yw +oz40WsLIOFiq24WAnkZaig3mh3ZIZPH30CpNG6D50xJgH87vhlHr8KMc/UKCD8HT +hF4D16Pe22XLHvsSAQdAdmfEzaR46pX8T/DSVrKmGPlxKWaS/GYPCJbHwa1/8hsw +QpKP7zTwoRGg+OC01wgviQjaHehQ5PHCcgF92js19ipqeK0nZ6NumYBhuReeTn0j +0sBPATC6XlUcftJVv3oydls4C8Mpu+KK+fFvsgaZY5QeoLttl07GfRQMqPhpb6wb +5sEKrS0QTpxzAth07Ow22cETz+BYbxkVmbube82CBNwkiv8jF05expxtLdAUTSc4 +p9/hKUSFAXP/a4x5ce7ImZ8IeBftDfD1UjCvL/vPqhGfuPg/ObAPAIk4vs6K8yGW +0ub67smJCF6x3rTeYWJHtZA2w3aYX332klhyWWyyvq4EhfkViNCbch0gkBvrqxd0 +hIoSRW4Tg/SzbTNbwvoojwB4Qn/NKj6tG+/NCXsNoCaAW24oCpJC+J5CUUbHVH3O +Ru2kYMZ0/G0F3zplBJ+UdNl3edCVuOsYKosqA251SpbBhw== +=52uO +-----END PGP MESSAGE----- +------=_Part_0_123085323.1639402453729-- + + +R61b74bd8 +V68d +G4994f703d84bb7616d0e000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.40 b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.40 new file mode 100644 index 0000000000..af48e13dec --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/INBOX/dbox-Mails/u.40 @@ -0,0 +1,42 @@ +2 M1e C61b74c72 +N 0000000000000520 +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id 7nTaL3JMt2EwEQAAc/RpdQ + (envelope-from ) + for ; Mon, 13 Dec 2021 13:36:50 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id C0AAD84061F + for ; Mon, 13 Dec 2021 13:36:50 +0000 (UTC) +Date: Mon, 13 Dec 2021 15:36:48 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <2967984.1.1639402608568@flowcrypt.test> +Subject: NOT encrypted + signed(inband) + no pub key +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_15474263.1639402608553" + +------=_Part_0_15474263.1639402608553 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCX2jaFz8aOWw08ZT6cnMYCAZ4l6sUKiQlFqemlOYpFCbmpxcWJ6qkJJ +RmKJQnlisUJxZnpeaopCeWZJBlBZeVF+XrpCQVFmWWJJqkJ2aqWeQnBqXkpqkUJi +XgpELZBZlKqQkpmWllqUmlei11HKwiDGxcDGypS4pfkigyKnAMwNYoosHXsObGz8 +luG6RyfyAkx4oz8jw8yK2S9W5S19cGL2MsGt7+3eVS0MPiv4Zp367xdLbDUKb0xn ++O+T+pZxU/QMpfK1GqsbxbL2eXkEq9kvZjlr4FvM3tH7kBEA +=BWVd +-----END PGP MESSAGE----- +------=_Part_0_15474263.1639402608553-- + + +R61b74c72 +V542 +G71a5ec2f724cb7613011000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/Trash/dbox-Mails/dovecot.index.cache b/docker-mailserver/maildata_source/flowcrypt.test/default/mailboxes/Trash/dbox-Mails/dovecot.index.cache index c689f609ac93cf437aa71cce717c9d587acab6fd..482b07aaa38c98aecae5bfc8d729121ec87327af 100644 GIT binary patch delta 553 zcmaiv%}T>S5P)}68;c@6=ph9ui=dcR%kJi9lPI-dFN##8zChZfQYlf}6!G9iuRRzR zPrid73Z8rfZytOF&%S`0)PRc6VZWK(fgR?1mq+=Vh3se=fXqW-UaA*&pWT?P?qgEZ z_oO-n0Eo#6_?cAZchZY0?m&^^3;+^9!N%2-8@D>LNFp+V+sLqGreQ>kDAbn;W~PM+ zt`JkRDY3=NvgneE8asO_Ao@@XO*dRagrK_LMif(m2z7MZp%yR016bvkP_Zn{uoz~n zLVk?14OZ*)PR`r?i_@?Y`h&1K1AsV5%!<6pUm+?Ex<`TUt#*T!8+a-zqn7KTxao$& zzRy45`pVq*r?@QsaeccUyQ0U28P~ki6CukP(1knr^w_7oE(e}lO0)Dr31_lNuAO-;t%{94@QJobeDl~a6qqZuDRl&=^py{p*H8LH6K7s29?Q*O!{I+ zv@wm~;G7)CW(0P@3ZQ8qzzM`mlNU0oOM&eDgT>w+kS4K-2V_uO4${j7(g$|03?Bo7 z9-4avxDf8mf%{Py?neVGdU}xbfc&Tqwi9F*41hz66XaGAkkCX!bzTq$1~@^+gT3+v zi}4lQll2(QCOa_mFsgyVj!_S&TwlyWhk@aSH)?3>@Bn>n#yM{zBurH&KV;DttHGjh z14tn-cocxfau?SH_^!>A6nUmtA005A%Rd{FIw!3(mV*L^F* mel?)EvS4#Vuqe*qgSp`WE5~F7b{3%VKsQK~U{U)47%l*xc!kXX delta 7 Ocmew$`+{#n20H)_>;oeJ diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/dovecot.index.cache b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/dovecot.index.cache index 15bd2aecf928953e97edd6288588563ef24f71e4..ed153c7d92de4a68e6a02b80cedf01a89e0231f7 100644 GIT binary patch delta 572 zcmdn6gmK9R#t9;ru zxRIrqxut~(!fR$g=bBke-l!-%*;+xA(RT7eE|JNx=HjB*eR$T%N7U5B+{DNX?n96X zrpA-?oYf{9cnC}`uo2)=fcizBX>ym1nqVu`!+lVib8?}GBdf8cg@WbegSsYShS*JH S6crYjzzhi;kbwn0+YV>07iwdMl@ z2&e$D^khe7aYoh29~HFORDpbhpvmu8)L22xuags5%sJ<6geX>>ET|7o)x($H3)sgrh(@Jz1 F7yt`zFYEvS delta 7 OcmewoH6d(+fHnXRQUf3W diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.37 b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.37 new file mode 100644 index 0000000000..b9435280e5 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.37 @@ -0,0 +1,38 @@ +2 M1e C61b74bd8 +N 00000000000004D6 +Date: Mon, 13 Dec 2021 15:34:13 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <176319358.1.1639402453750@flowcrypt.test> +Subject: Encrypted + signed(inband) + no pub key +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_123085323.1639402453729" +User-Agent: FlowCrypt_Android_1.2.5_dev_125__2021_12_13 + +------=_Part_0_123085323.1639402453729 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdAtdnv+F2LD9GVA09dGxdtNXp9XOUNildn0KoRRyfS71Yw +oz40WsLIOFiq24WAnkZaig3mh3ZIZPH30CpNG6D50xJgH87vhlHr8KMc/UKCD8HT +hF4D16Pe22XLHvsSAQdAdmfEzaR46pX8T/DSVrKmGPlxKWaS/GYPCJbHwa1/8hsw +QpKP7zTwoRGg+OC01wgviQjaHehQ5PHCcgF92js19ipqeK0nZ6NumYBhuReeTn0j +0sBPATC6XlUcftJVv3oydls4C8Mpu+KK+fFvsgaZY5QeoLttl07GfRQMqPhpb6wb +5sEKrS0QTpxzAth07Ow22cETz+BYbxkVmbube82CBNwkiv8jF05expxtLdAUTSc4 +p9/hKUSFAXP/a4x5ce7ImZ8IeBftDfD1UjCvL/vPqhGfuPg/ObAPAIk4vs6K8yGW +0ub67smJCF6x3rTeYWJHtZA2w3aYX332klhyWWyyvq4EhfkViNCbch0gkBvrqxd0 +hIoSRW4Tg/SzbTNbwvoojwB4Qn/NKj6tG+/NCXsNoCaAW24oCpJC+J5CUUbHVH3O +Ru2kYMZ0/G0F3zplBJ+UdNl3edCVuOsYKosqA251SpbBhw== +=52uO +-----END PGP MESSAGE----- +------=_Part_0_123085323.1639402453729-- + + +R61b74bd5 +V4f4 +G48bd9401d84bb761590e000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.38 b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.38 new file mode 100644 index 0000000000..f50174e3e1 --- /dev/null +++ b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Sent/dbox-Mails/u.38 @@ -0,0 +1,33 @@ +2 M1e C61b74c72 +N 0000000000000390 +Date: Mon, 13 Dec 2021 15:36:48 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <2967984.1.1639402608568@flowcrypt.test> +Subject: NOT encrypted + signed(inband) + no pub key +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_15474263.1639402608553" +User-Agent: FlowCrypt_Android_1.2.5_dev_125__2021_12_13 + +------=_Part_0_15474263.1639402608553 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCX2jaFz8aOWw08ZT6cnMYCAZ4l6sUKiQlFqemlOYpFCbmpxcWJ6qkJJ +RmKJQnlisUJxZnpeaopCeWZJBlBZeVF+XrpCQVFmWWJJqkJ2aqWeQnBqXkpqkUJi +XgpELZBZlKqQkpmWllqUmlei11HKwiDGxcDGypS4pfkigyKnAMwNYoosHXsObGz8 +luG6RyfyAkx4oz8jw8yK2S9W5S19cGL2MsGt7+3eVS0MPiv4Zp367xdLbDUKb0xn ++O+T+pZxU/QMpfK1GqsbxbL2eXkEq9kvZjlr4FvM3tH7kBEA +=BWVd +-----END PGP MESSAGE----- +------=_Part_0_15474263.1639402608553-- + + +R61b74c70 +V3a9 +G9860b62d724cb7611b11000073f46975 + diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Trash/dbox-Mails/dovecot.index.cache b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Trash/dbox-Mails/dovecot.index.cache index 38d134a828f9e5cf2b73a659d28d451ac7340386..7a9ab4b674688f186ebd54fdafb019a7769285e0 100644 GIT binary patch delta 561 zcmaiv%SyvQ6ox0MR#4G}E?RLh2!hpGW+sgmEgHV#A zx?(bF!p|_+LIzjLTYaJ6;~-tN{Vb*wmqZ;i!YHQ9Qca5);gPg=T=i%?qGpJx*w7?+KKzpKy4P&D!dYs% zHQRMEcm>yN2S-KQ@3aN9A~gR8{q;IVze@zmrKC!Lm-Kj5$^e;b@i~l8&P_so0|RgB zKVD6@Xm}{KQbcE_!YJ!g#bY=N-=(?T!TXDF+GuniM72{p6?Najm7RSo+#bAefMy8Z EH`bShHUIzs delta 86 wcmZ3&|AB3S2x|c|0|VnmNns{y_sq?SAiOLCLc{n((38`d{1_Q0Z)4g80Bn;Xs{jB1 diff --git a/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Trash/dbox-Mails/dovecot.index.log b/docker-mailserver/maildata_source/flowcrypt.test/denbond7/mailboxes/Trash/dbox-Mails/dovecot.index.log index 6fdec162c91464e1d9fd8fcb2c2fecd805813869..225d95de781242fdd2d5ea9a4a30e57e1210e1da 100644 GIT binary patch delta 279 zcmew$`9*fa2OimmhK6Pa1`dG^1_lNoyN!u~L4X6u24T+07g>cTuizFoY-3=82p2E| zg@IBXtYGCm3P9x{3@Qu^z1tE&TG*j@@&qoC$s4#hCa+-Qnf!)XTnJ;Vr1Ryhk3P4V1Q2?50z`(-5g~WFN@@4qI@~uDvAkG8QAT~@7NR0zTP0xh4 pKsA#M8HE`+CmV8#v4I2xU;-OC<(W3{P3B`U698%l1Cae7000q8F%$p* delta 7 Ocmew&`$2NU2Oa Date: Mon, 13 Dec 2021 15:40:50 +0200 Subject: [PATCH 07/12] Added handling 'bad signature' case.| #1097 --- .../response/model/VerificationResult.kt | 3 +++ .../com/flowcrypt/email/security/pgp/PgpMsg.kt | 17 +++++++++++++++-- .../activity/fragment/MessageDetailsFragment.kt | 4 ++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/VerificationResult.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/VerificationResult.kt index dd217727f8..47ae0de41d 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/VerificationResult.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/VerificationResult.kt @@ -21,12 +21,14 @@ class VerificationResult( @Expose val hasMixedSignatures: Boolean, @Expose val isPartialSigned: Boolean, @Expose val hasUnverifiedSignatures: Boolean, + @Expose val hasBadSignatures: Boolean, ) : Parcelable { constructor(parcel: Parcel) : this( parcel.readByte() != 0.toByte(), parcel.readByte() != 0.toByte(), parcel.readByte() != 0.toByte(), parcel.readByte() != 0.toByte(), + parcel.readByte() != 0.toByte(), parcel.readByte() != 0.toByte() ) @@ -36,6 +38,7 @@ class VerificationResult( parcel.writeByte(if (hasMixedSignatures) 1 else 0) parcel.writeByte(if (isPartialSigned) 1 else 0) parcel.writeByte(if (hasUnverifiedSignatures) 1 else 0) + parcel.writeByte(if (hasBadSignatures) 1 else 0) } override fun describeContents(): Int { diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt index 7a15526b78..ed41c50a56 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt @@ -817,6 +817,7 @@ object PgpMsg { var hasMixedSignatures = false var hasUnverifiedSignatures = false + var hasBadSignatures = false var signedBlockCount = 0 var isPartialSigned = false val verifiedSignatures = mutableMapOf() @@ -855,7 +856,18 @@ object PgpMsg { if (openPgpMetadata.invalidInbandSignatures.isNotEmpty() || openPgpMetadata.invalidDetachedSignatures.isNotEmpty() ) { - hasUnverifiedSignatures = true + val invalidSignatureFailures = openPgpMetadata.invalidInbandSignatures + + openPgpMetadata.invalidDetachedSignatures + + hasBadSignatures = invalidSignatureFailures.any { + it.validationException.underlyingException != null + } + + hasUnverifiedSignatures = invalidSignatureFailures.any { + it.validationException.message?.startsWith( + "Missing verification certificate", true + ) ?: false + } } if (verifiedSignatures.isEmpty()) { @@ -903,7 +915,8 @@ object PgpMsg { isSigned = signedBlockCount > 0, hasMixedSignatures = hasMixedSignatures, isPartialSigned = isPartialSigned, - hasUnverifiedSignatures = hasUnverifiedSignatures + hasUnverifiedSignatures = hasUnverifiedSignatures, + hasBadSignatures = hasBadSignatures ) ) } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MessageDetailsFragment.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MessageDetailsFragment.kt index 40383877e4..801bb78d5f 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MessageDetailsFragment.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/MessageDetailsFragment.kt @@ -484,6 +484,10 @@ class MessageDetailsFragment : BaseFragment(), ProgressBehaviour, View.OnClickLi if (verificationResult.isSigned) { val badge = when { + verificationResult.hasBadSignatures -> { + PgpBadgeListAdapter.PgpBadge(PgpBadgeListAdapter.PgpBadge.Type.BAD_SIGNATURE) + } + verificationResult.hasUnverifiedSignatures -> { PgpBadgeListAdapter.PgpBadge(PgpBadgeListAdapter.PgpBadge.Type.CAN_NOT_VERIFY_SIGNATURE) } From ed5ba92b81285e2d984de578c3e207e66c581b5e Mon Sep 17 00:00:00 2001 From: DenBond7 Date: Mon, 13 Dec 2021 20:38:41 +0200 Subject: [PATCH 08/12] Fixed Junit tests.| #1097 --- .../api/retrofit/response/model/VerificationResult.kt | 2 +- .../test/java/com/flowcrypt/email/ParcelableTest.kt | 7 +++++++ .../com/flowcrypt/email/api/email/EmailUtilTest.kt | 11 ++++++++++- .../com/flowcrypt/email/security/pgp/PgpMsgTest.kt | 10 +++++----- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/VerificationResult.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/VerificationResult.kt index 47ae0de41d..2b23177036 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/VerificationResult.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/VerificationResult.kt @@ -15,7 +15,7 @@ import com.google.gson.annotations.Expose * Time: 10:09 AM * E-mail: DenBond7@gmail.com */ -class VerificationResult( +data class VerificationResult( @Expose val isEncrypted: Boolean, @Expose val isSigned: Boolean, @Expose val hasMixedSignatures: Boolean, diff --git a/FlowCrypt/src/test/java/com/flowcrypt/email/ParcelableTest.kt b/FlowCrypt/src/test/java/com/flowcrypt/email/ParcelableTest.kt index f5f964a526..a9fafeee9b 100644 --- a/FlowCrypt/src/test/java/com/flowcrypt/email/ParcelableTest.kt +++ b/FlowCrypt/src/test/java/com/flowcrypt/email/ParcelableTest.kt @@ -10,6 +10,7 @@ import android.os.Parcel import android.os.Parcelable import com.flextrade.jfixture.JFixture import com.flowcrypt.email.api.email.model.OutgoingMessageInfo +import com.flowcrypt.email.api.retrofit.response.model.DecryptedAndOrSignedContentMsgBlock import com.flowcrypt.email.api.retrofit.response.model.GenericMsgBlock import com.flowcrypt.email.api.retrofit.response.model.MsgBlock import com.flowcrypt.email.api.retrofit.response.model.OrgRules @@ -23,6 +24,7 @@ import org.junit.Assert.assertNotNull import org.junit.Before import org.junit.Test import org.junit.runner.RunWith +import org.pgpainless.decryption_verification.OpenPgpMetadata import org.robolectric.ParameterizedRobolectricTestRunner import org.robolectric.annotation.Config import javax.mail.internet.InternetAddress @@ -48,6 +50,7 @@ class ParcelableTest(val name: String, private val currentClass: Class Date: Tue, 14 Dec 2021 09:09:05 +0200 Subject: [PATCH 09/12] Fixed some UI tests.| #1097 --- .../info/encrypted_msg_big_inline_att.json | 10 +- ...idden_att_pgp_mime_modified_by_google.json | 8 + .../info/encrypted_msg_info_error_no_mdc.json | 8 + .../encrypted_msg_info_for_2_keys_text.json | 8 + .../info/encrypted_msg_info_text.json | 10 +- ...d_msg_info_text_error_badly_formatted.json | 8 + ...ypted_msg_info_text_error_one_pub_key.json | 10 +- ...rypted_msg_info_text_with_missing_key.json | 10 +- ..._msg_info_text_with_missing_key_fixed.json | 10 +- .../encrypted_msg_info_text_with_one_att.json | 10 +- .../encrypted_msg_info_text_with_pub_key.json | 8 + ...rypted_msg_inline_pub_key_parse_error.json | 10 +- ...ted_msg_need_passphrase_multiply_keys.json | 8 + ...rypted_msg_need_passphrase_single_key.json | 8 + ...ntec_encryption_server_message_format.json | 8 + .../messages/info/msg_info_8bit-utf8.json | 8 + .../messages/info/signed_msg_armored.json | 8 + .../messages/info/signed_msg_clearsign.json | 8 + .../info/signed_msg_clearsign_broken.json | 8 + .../info/standard_msg_info_plaintext.json | 10 +- ...g_info_plaintext_single_to_replyto_cc.json | 10 +- ...rd_msg_info_plaintext_to_2_recipients.json | 10 +- ...ndard_msg_info_plaintext_with_one_att.json | 10 +- ...tandard_msg_reply_all_via_gmail_alias.json | 10 +- .../info/standard_msg_reply_to_header.json | 10 +- ...at_has_no_suitable_encryption_subkeys.json | 1436 +---------------- .../ui/activity/MessageDetailsActivityTest.kt | 7 +- 27 files changed, 226 insertions(+), 1443 deletions(-) diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_big_inline_att.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_big_inline_att.json index 1439a3d8d1..ecf0da1d9c 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_big_inline_att.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_big_inline_att.json @@ -56,5 +56,13 @@ "toAddress": "default@flowcrypt.test", "uid": 17 }, + "verificationResult": { + "isEncrypted": true, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "This is an encrypted message with inline attachment" -} \ No newline at end of file +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_hidden_att_pgp_mime_modified_by_google.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_hidden_att_pgp_mime_modified_by_google.json index 8522a3d850..2ee180d234 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_hidden_att_pgp_mime_modified_by_google.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_hidden_att_pgp_mime_modified_by_google.json @@ -41,5 +41,13 @@ "uidAsHEX": "15", "isEncrypted": true }, + "verificationResult": { + "isEncrypted": true, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "Encrypted text" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_error_no_mdc.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_error_no_mdc.json index a93b313821..05115ab78c 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_error_no_mdc.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_error_no_mdc.json @@ -54,5 +54,13 @@ "uid": 24, "uidAsHEX": "18" }, + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_for_2_keys_text.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_for_2_keys_text.json index ba18fcf56c..0dafb7ed6d 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_for_2_keys_text.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_for_2_keys_text.json @@ -41,5 +41,13 @@ "uid": 18, "uidAsHEX": "12" }, + "verificationResult": { + "isEncrypted": true, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "It\u0027s an encrypted text" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text.json index 4e6e994b01..4a509ad6e5 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text.json @@ -41,5 +41,13 @@ "toAddress": "default@flowcrypt.test", "uid": 14 }, + "verificationResult": { + "isEncrypted": true, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "Simple encrypted text" -} \ No newline at end of file +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_badly_formatted.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_badly_formatted.json index 72f5c23db8..155add50b2 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_badly_formatted.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_badly_formatted.json @@ -58,5 +58,13 @@ "uid": 12, "uidAsHEX": "c" }, + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_one_pub_key.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_one_pub_key.json index 46fee35af5..8d3c0e38b9 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_one_pub_key.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_error_one_pub_key.json @@ -66,6 +66,14 @@ "uid": 10, "isEncrypted": true }, + "verificationResult": { + "isEncrypted": true, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid IE29GpAIe19wKAAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 11:50:40 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id 69234B2058E\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 11:50:40 +0000 (UTC)\r\nContent-Type: multipart/mixed;\r\n boundary\u003d\"----sinikael-?\u003d_1-16018986371740.9899334451956217\"\r\nTo: default@flowcrypt.test\r\nFrom: denbond7@flowcrypt.test\r\nSubject: only one pubkey used for encryption - possibly sender\u0027s error.\r\nDate: Mon, 05 Oct 2020 11:50:37 +0000\r\nMessage-Id: \u003c1601898637180-545631c7-a98f62fb-091da09b@flowcrypt.test\u003e\r\nMime-Version: 1.0", "text": "The message below should show a note telling the user that there was only one pubkey used for encryption - possibly sender\u0027s error.\n\nIt should also allow the user import a missing key if they have one." -} \ No newline at end of file +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key.json index 4ac393bbc1..f39752b1bf 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key.json @@ -67,5 +67,13 @@ "toAddress": "default@flowcrypt.test", "uid": 16 }, + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "" -} \ No newline at end of file +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key_fixed.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key_fixed.json index 2a2d0e9457..7d61174b7e 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key_fixed.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_missing_key_fixed.json @@ -42,5 +42,13 @@ "toAddress": "default@flowcrypt.test", "uid": 16 }, + "verificationResult": { + "isEncrypted": true, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "It\u0027s a message with a missing key." -} \ No newline at end of file +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_one_att.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_one_att.json index dfc5cd5177..b13ab12b42 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_one_att.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_one_att.json @@ -41,5 +41,13 @@ "toAddress": "default@flowcrypt.test", "uid": 12 }, + "verificationResult": { + "isEncrypted": true, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "It\u0027s an encrypted message with one encrypted attachment." -} \ No newline at end of file +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_pub_key.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_pub_key.json index 5c699954df..1b6bd4c09c 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_pub_key.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_info_text_with_pub_key.json @@ -79,5 +79,13 @@ "toAddress": "default@flowcrypt.test", "uid": 13 }, + "verificationResult": { + "isEncrypted": true, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "It\u0027s an encrypted message with my pub key" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_inline_pub_key_parse_error.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_inline_pub_key_parse_error.json index 683828fa9d..4aeea8908f 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_inline_pub_key_parse_error.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_inline_pub_key_parse_error.json @@ -10,7 +10,7 @@ "complete": false, "content": "-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: PGPainless\n\nmDMEYIucWBYJKwYBBAHaRw8BAQdAew+8mzMWyf3+Pfy49qa60uKV6e5os7de4TdZ\nceAWUq+0F2RlbmJvbmQ3QGZsb3djcnlwdC50ZXN0iHgEExYKACAFAmCLnFgCGwMF\nFgIDAQAECwkIBwUVCgkICwIeAQIZAQAKCRDDIInNavjWzm3JAQCgFgCEyD58iEa/\nunaAldoabgO4OARgi5xYEgorBgEEAZdVAQUBAQdAB1/Mrq5JGYim4KqGTSK4OESQ\nUwPgK56q0yrkiU9WgyYDAQgHiHUEGBYKAB0FAmCLnFgCGwwFFgIDAQAECwkIBwUV\nCgkICwIeAQAKCRDDIInNavjWzjMgAQCU+R1fItqdY6lt9jXUqipmXuqVaEFPwNA8\nYJ1rIwDwVQEAyUc8162KWzA2iQB5akwLwNr/pLDDtOWwhLUkrBb3mAc\u003d\n\u003dpXF6\n-----END PGP PUBLIC KEY BLOCK-----\n", "error": { - "errorMsg": "IOException: crc check failed in armored message." + "errorMsg": "[IOException]: crc check failed in armored message." }, "type": "publicKey" } @@ -50,5 +50,13 @@ "uid": 25, "uidAsHEX": "19" }, + "verificationResult": { + "isEncrypted": true, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "33333" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_multiply_keys.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_multiply_keys.json index 9f45753c6c..d80a6ad39d 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_multiply_keys.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_multiply_keys.json @@ -58,5 +58,13 @@ "uid": 18, "uidAsHEX": "12" }, + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_single_key.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_single_key.json index cc4ac27b1b..992b6babc8 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_single_key.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_need_passphrase_single_key.json @@ -56,5 +56,13 @@ "uid": 14, "uidAsHEX": "e" }, + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_symantec_encryption_server_message_format.json b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_symantec_encryption_server_message_format.json index d43d753c11..c00dc1ea7e 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_symantec_encryption_server_message_format.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/encrypted_msg_symantec_encryption_server_message_format.json @@ -42,5 +42,13 @@ "uid": 22, "uidAsHEX": "16" }, + "verificationResult": { + "isEncrypted": true, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "Some encrypted text" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/msg_info_8bit-utf8.json b/FlowCrypt/src/androidTest/assets/messages/info/msg_info_8bit-utf8.json index b20fe19c4a..f953855917 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/msg_info_8bit-utf8.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/msg_info_8bit-utf8.json @@ -43,6 +43,14 @@ "toAddress": "default@flowcrypt.test", "uid": 17 }, + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid 3yVQLfBPe1+6QAAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 16:55:12 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id B623BB20B92\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 16:55:12 +0000 (UTC)\r\nTo: default@flowcrypt.test\r\nFrom: Denis Bondarenko \u003cdenbond7@flowcrypt.test\u003e\r\nSubject: 8bit encoded utf broken\r\nAutocrypt: addr\u003ddenbond7@flowcrypt.test; keydata\u003d\r\n mQENBFyM4vkBCACr8FvuG4MAZsz90hrZ2B+oEznArD46QUbAGrPT8JU6zz27SfLmTTbTA86q\r\n +DVAZC94CZ2lqJaG7KY7eqHFqJObetA8mcUk0Oo3EshphpK0MnNv+bHFpKf/srJgKSDmpCF+\r\n JSHeZs2WAPtrdfoTO1KPy5IZexMWdnhYZy8d0xUr4rPZ7i2UyrkdV3k2O9x4aG5tD1Zo/Wkm\r\n lTv8z2BtAwAziqUQFxABQLu1fzcRkMHTMcGVXrB+73GITl03GbfeJHvFuThhofqP09o/p3Y1\r\n 8Zm+zVWL/T4zsA5P+Cp6kwnwUnQkL3Tc49a0qIJShlP4LbSbPBqFGWTHxceCkFBkMVoJABEB\r\n AAG0LWRlbmJvbmQ3QGRlbmJvbmQ3LmNvbSA8ZGVuYm9uZDdAZGVuYm9uZDcuY29tPokBPwQQ\r\n AQgAKQUCXIzjAQYLCQcIAwIJEGoVBlPxgAh0BBUICgIDFgIBAhkBAhsDAh4BAAoJEGoVBlPx\r\n gAh0L2EIAJRM22lnSHhgQ+waiCf0p739L3XKs2eDZUkxAX+4an654wnn1OjxWrG7lls2GgN1\r\n ziKHHdGgxU4PQ8PmQrgyc6F05vmYihRFaVFDQ97xF16+IvO4xiuYMuJk7ovsr5mrlI43CWE4\r\n f7GPtmJ7QYTlxeYW3s7KLqr0TKxqGG8f6qRjy/Q1ky3qnseR5Fp1GjIwijVI2rncfH0lOkNm\r\n BHj4aYugN60HNlUJbosb2vjJkz5dsqe+nY3XVKI6Iqq07I+Jvankn6jyvlMP8jNLxQMUsqrt\r\n Bki/C6ett3z+JeP2+2Nh+mp1vDW/kO7gSgRHUEPJ9w/VVIpWIOTEv+Bsz3l28h65AQ0EXIzj\r\n AAEIAJKbKexaP/2HqUAj/DxOebhKqw2ddK5HsYacv12pHVTEVjOnLQELyroZ1ikO21UK8Z/z\r\n ng9+8DlCz72SMql+/uZYpoEdgqMy9PU3zPDzGcAeOr07R56G08l+hUO/i3FMW4v2ZT6gLCIn\r\n AJ417wSvF4wg6dJzfrBFkj7o2lyTOwfD87CehQozyGza1cb+yS3ZPC8oc99a1jwSqFYecDI2\r\n 7Cgy7KWSbhSfoPcJG4KPTLDrvVn2Y+U2jxx6OiYXRai8wwlheAmIohmZNpHLaCQiTZTWRYPK\r\n vP0kb6aoN9O4fGhgMh3QAbc2BVwh299rToBieI/zow+I9OcrScejwQNI2VUAEQEAAYkBKQQY\r\n AQgAEwUCXIzjAgkQahUGU/GACHQCGwwACgkQahUGU/GACHSfcQf/euBJSXopDZxAVniN9HDQ\r\n Dga+ccwJYWZvyiDOaGSoSxW3QDhTOWbCH66GkZiOp9KLObHs54KzoOGaOJbQmhWGR4rwNdGS\r\n np8oWimyyXVEHHhir2BmT8MZrMC3WpMPmUlY2v9CMFD7hF2OfmXd1M9fuFT41aZQVDgGSdYc\r\n IQchOmUv3NQUiBJyOlp1bF1RT7Yf3UjAQANyENz19fYHKd2yh9Ltv3CYVjwRB4crQmuESxM8\r\n 7IEXDVNnYOBP0F5WaSQEesFAhjk+cVjxTUfcmM04YEFhedBStsV8kWF50ojYgF9te4yRM/zo\r\n NRi6SjWLSeEw/zIfvkggDvn1UfA2bGFk8Q\u003d\u003d\r\nMessage-ID: \u003c6e66bc34-0e1f-bb13-ccdc-8e61bdf63f6a@flowcrypt.test\u003e\r\nDate: Mon, 5 Oct 2020 19:55:12 +0300\r\nMime-Version: 1.0\r\nContent-Type: multipart/alternative;\r\n boundary\u003d\"------------FD1FA5F98C2FD885200F7353\"\r\nContent-Language: en-US", "text": "Text: Ваше оголошення" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_armored.json b/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_armored.json index a81e2f9b76..4bb902c02d 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_armored.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_armored.json @@ -42,5 +42,13 @@ "uid": 26, "uidAsHEX": "1a" }, + "verificationResult": { + "isEncrypted": false, + "isSigned": true, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "Signed text for default@flowcrypt.test" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign.json b/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign.json index 0a8b754efa..0467a70120 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign.json @@ -42,5 +42,13 @@ "uid": 28, "uidAsHEX": "1c" }, + "verificationResult": { + "isEncrypted": false, + "isSigned": true, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "Some important text that is signed" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign_broken.json b/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign_broken.json index 337c9d46c0..f26cb583ab 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign_broken.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/signed_msg_clearsign_broken.json @@ -51,5 +51,13 @@ "uid": 27, "uidAsHEX": "1b" }, + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "" } diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext.json index 0c22d1290e..f53b30b35a 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext.json @@ -43,6 +43,14 @@ "toAddress": "default@flowcrypt.test", "uid": 5 }, + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid WF4PDSLael+dCQAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 08:32:34 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id 347E7A20940\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 08:32:34 +0000 (UTC)\r\nTo: default@flowcrypt.test\r\nFrom: Denis Bondarenko \u003cdenbond7@flowcrypt.test\u003e\r\nX-Pep-Version: 2.0\r\nMessage-ID: \u003c8fcbd0f1-e33b-9b5e-51ee-79d7c639f0bc@flowcrypt.test\u003e\r\nDate: Mon, 5 Oct 2020 11:32:34 +0300\r\nMime-Version: 1.0\r\nSubject: Standard message - plaintext\r\nContent-Type: multipart/alternative;\r\n boundary\u003d\"------------D3F69D95534F587EC1BE35A3\"\r\nContent-Language: en-US", "text": "It\u0027s a standard message with plaintext" -} \ No newline at end of file +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_single_to_replyto_cc.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_single_to_replyto_cc.json index d4bcfe6688..44572b5cf8 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_single_to_replyto_cc.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_single_to_replyto_cc.json @@ -48,6 +48,14 @@ "toAddress": "default@flowcrypt.test", "uid": 5 }, + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid WF4PDSLael+dCQAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 08:32:34 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id 347E7A20940\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 08:32:34 +0000 (UTC)\r\nTo: default@flowcrypt.test\r\nFrom: Denis Bondarenko \u003cdenbond7@flowcrypt.test\u003e\r\nX-Pep-Version: 2.0\r\nMessage-ID: \u003c8fcbd0f1-e33b-9b5e-51ee-79d7c639f0bc@flowcrypt.test\u003e\r\nDate: Mon, 5 Oct 2020 11:32:34 +0300\r\nMime-Version: 1.0\r\nSubject: Standard message - plaintext\r\nContent-Type: multipart/alternative;\r\n boundary\u003d\"------------D3F69D95534F587EC1BE35A3\"\r\nContent-Language: en-US", "text": "It\u0027s a standard message with plaintext" -} \ No newline at end of file +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_to_2_recipients.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_to_2_recipients.json index 7ed5884233..defda0e4c3 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_to_2_recipients.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_to_2_recipients.json @@ -47,6 +47,14 @@ "toAddress": "default@flowcrypt.test, User ", "uid": 5 }, + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid WF4PDSLael+dCQAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 08:32:34 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id 347E7A20940\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 08:32:34 +0000 (UTC)\r\nTo: default@flowcrypt.test\r\nFrom: Denis Bondarenko \u003cdenbond7@flowcrypt.test\u003e\r\nX-Pep-Version: 2.0\r\nMessage-ID: \u003c8fcbd0f1-e33b-9b5e-51ee-79d7c639f0bc@flowcrypt.test\u003e\r\nDate: Mon, 5 Oct 2020 11:32:34 +0300\r\nMime-Version: 1.0\r\nSubject: Standard message - plaintext\r\nContent-Type: multipart/alternative;\r\n boundary\u003d\"------------D3F69D95534F587EC1BE35A3\"\r\nContent-Language: en-US", "text": "It\u0027s a standard message with plaintext" -} \ No newline at end of file +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_with_one_att.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_with_one_att.json index 561f90f3c9..c301dc4924 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_with_one_att.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_info_plaintext_with_one_att.json @@ -43,6 +43,14 @@ "toAddress": "default@flowcrypt.test", "uid": 6 }, + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test\r\n\tby mail.flowcrypt.test with LMTP\r\n\tid YISlMxbcel9GEwAAZlazJA\r\n\t(envelope-from \u003cdenbond7@flowcrypt.test\u003e)\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 05 Oct 2020 08:40:54 +0000\r\nReceived: from localhost (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id D03A0A2098A\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Mon, 5 Oct 2020 08:40:54 +0000 (UTC)\r\nTo: default@flowcrypt.test\r\nFrom: Denis Bondarenko \u003cdenbond7@flowcrypt.test\u003e\r\nX-Pep-Version: 2.0\r\nMessage-ID: \u003cfacd4f6d-9e74-977b-3f11-abbe7cd467eb@flowcrypt.test\u003e\r\nDate: Mon, 5 Oct 2020 11:40:54 +0300\r\nMime-Version: 1.0\r\nSubject: Standard message + one attachment\r\nContent-Type: multipart/mixed;\r\n boundary\u003d\"------------9575DD1DBF2C2FFA08F4568A\"\r\nContent-Language: en-US", "text": "It\u0027s a standard message with plaintext and one attachment" -} \ No newline at end of file +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_all_via_gmail_alias.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_all_via_gmail_alias.json index a2e3e731ce..445bbc1c17 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_all_via_gmail_alias.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_all_via_gmail_alias.json @@ -47,6 +47,14 @@ "type": "plainHtml" } ], + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id E24B021EE5\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Tue, 1 Oct 2019 11:25:36 +0000 (UTC)\r\nAuthentication-Results: mail.flowcrypt.test (amavisd-new); dkim\u003dpass\r\n\treason\u003d\"pass (just generated, assumed good)\" header.d\u003dflowcrypt.test\r\nDKIM-Signature: v\u003d1; a\u003drsa-sha256; c\u003drelaxed/simple; d\u003dflowcrypt.test; h\u003d\r\n\tuser-agent:message-id:reply-to:subject:subject:to:from:from:date\r\n\t:date:content-transfer-encoding:content-type:content-type\r\n\t:mime-version; s\u003ddkim; t\u003d1569929122; x\u003d1570793123; bh\u003dx1bgGo2MG/\r\n\tBhDI0wq3RU1YBrrUGERXYHxNAJggBUVNU\u003d; b\u003dHMAJby/fdCu+baav9xxlUpzo4f\r\n\toCJrkHjltgdAUnwvCA7gmFG0rOH366G57fQME7Vv0KtjodHoG3ijNotoJUw+66VS\r\n\tww9CjSWXadPriTIXN/cRzJBnNN9Lvp5qEcg93MI0kTvX5kJHZEAG7jbZZUXX3LUw\r\n\tXWKNohPwqcECOM8fI\u003d\r\nX-Virus-Scanned: Debian amavisd-new at mail.flowcrypt.test\r\nReceived: from mail.flowcrypt.test ([127.0.0.1])\r\n\tby mail.flowcrypt.test (mail.flowcrypt.test [127.0.0.1]) (amavisd-new, port 10026)\r\n\twith ESMTP id 640VPIOx-Lcz for \u003cdefault@flowcrypt.test\u003e;\r\n\tTue, 1 Oct 2019 11:25:22 +0000 (UTC)\r\nReceived: from flowcrypt.test (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTPSA id 6D12421ED6\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Tue, 1 Oct 2019 11:25:22 +0000 (UTC)\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset\u003dUS-ASCII; format\u003dflowed\r\nContent-Transfer-Encoding: 7bit\r\nDate: Tue, 01 Oct 2019 14:25:21 +0300\r\nFrom: denbond7@flowcrypt.test\r\nTo: Default \u003cdefault@flowcrypt.test\u003e\r\nSubject: Honor reply-to address\r\nReply-To: android@flowcrypt.test\r\nMail-Reply-To: android@flowcrypt.test\r\nMessage-ID: \u003c8b50eeb45d3b6cd88be8d06907b171de@flowcrypt.test\u003e\r\nX-Sender: denbond7@flowcrypt.test\r\nUser-Agent: Roundcube Webmail", "text": "Some message with some text. See details here https://github.com/FlowCrypt/flowcrypt-android/issues/602" -} \ No newline at end of file +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_to_header.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_to_header.json index f052b4e61d..22f4f3837d 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_to_header.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_reply_to_header.json @@ -53,6 +53,14 @@ "type": "plainHtml" } ], + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "origMsgHeaders": "Return-Path: \u003cdenbond7@flowcrypt.test\u003e\r\nDelivered-To: default@flowcrypt.test\r\nReceived: from mail.flowcrypt.test (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTP id E24B021EE5\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Tue, 1 Oct 2019 11:25:36 +0000 (UTC)\r\nAuthentication-Results: mail.flowcrypt.test (amavisd-new); dkim\u003dpass\r\n\treason\u003d\"pass (just generated, assumed good)\" header.d\u003dflowcrypt.test\r\nDKIM-Signature: v\u003d1; a\u003drsa-sha256; c\u003drelaxed/simple; d\u003dflowcrypt.test; h\u003d\r\n\tuser-agent:message-id:reply-to:subject:subject:to:from:from:date\r\n\t:date:content-transfer-encoding:content-type:content-type\r\n\t:mime-version; s\u003ddkim; t\u003d1569929122; x\u003d1570793123; bh\u003dx1bgGo2MG/\r\n\tBhDI0wq3RU1YBrrUGERXYHxNAJggBUVNU\u003d; b\u003dHMAJby/fdCu+baav9xxlUpzo4f\r\n\toCJrkHjltgdAUnwvCA7gmFG0rOH366G57fQME7Vv0KtjodHoG3ijNotoJUw+66VS\r\n\tww9CjSWXadPriTIXN/cRzJBnNN9Lvp5qEcg93MI0kTvX5kJHZEAG7jbZZUXX3LUw\r\n\tXWKNohPwqcECOM8fI\u003d\r\nX-Virus-Scanned: Debian amavisd-new at mail.flowcrypt.test\r\nReceived: from mail.flowcrypt.test ([127.0.0.1])\r\n\tby mail.flowcrypt.test (mail.flowcrypt.test [127.0.0.1]) (amavisd-new, port 10026)\r\n\twith ESMTP id 640VPIOx-Lcz for \u003cdefault@flowcrypt.test\u003e;\r\n\tTue, 1 Oct 2019 11:25:22 +0000 (UTC)\r\nReceived: from flowcrypt.test (localhost [127.0.0.1])\r\n\tby mail.flowcrypt.test (Postfix) with ESMTPSA id 6D12421ED6\r\n\tfor \u003cdefault@flowcrypt.test\u003e; Tue, 1 Oct 2019 11:25:22 +0000 (UTC)\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset\u003dUS-ASCII; format\u003dflowed\r\nContent-Transfer-Encoding: 7bit\r\nDate: Tue, 01 Oct 2019 14:25:21 +0300\r\nFrom: denbond7@flowcrypt.test\r\nTo: Default \u003cdefault@flowcrypt.test\u003e\r\nSubject: Honor reply-to address\r\nReply-To: android@flowcrypt.test\r\nMail-Reply-To: android@flowcrypt.test\r\nMessage-ID: \u003c8b50eeb45d3b6cd88be8d06907b171de@flowcrypt.test\u003e\r\nX-Sender: denbond7@flowcrypt.test\r\nUser-Agent: Roundcube Webmail", "text": "Some message with some text. See details here https://github.com/FlowCrypt/flowcrypt-android/issues/602" -} \ No newline at end of file +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_with_pub_key_that_has_no_suitable_encryption_subkeys.json b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_with_pub_key_that_has_no_suitable_encryption_subkeys.json index 8ea621039d..e79dcbc118 100644 --- a/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_with_pub_key_that_has_no_suitable_encryption_subkeys.json +++ b/FlowCrypt/src/androidTest/assets/messages/info/standard_msg_with_pub_key_that_has_no_suitable_encryption_subkeys.json @@ -37,1433 +37,7 @@ "no_encryption_subkeys@flowcrypt.test" ] }, - "publicKey": [ - 45, - 45, - 45, - 45, - 45, - 66, - 69, - 71, - 73, - 78, - 32, - 80, - 71, - 80, - 32, - 80, - 85, - 66, - 76, - 73, - 67, - 32, - 75, - 69, - 89, - 32, - 66, - 76, - 79, - 67, - 75, - 45, - 45, - 45, - 45, - 45, - 10, - 86, - 101, - 114, - 115, - 105, - 111, - 110, - 58, - 32, - 70, - 108, - 111, - 119, - 67, - 114, - 121, - 112, - 116, - 32, - 49, - 46, - 50, - 46, - 52, - 95, - 100, - 101, - 118, - 95, - 49, - 50, - 52, - 95, - 95, - 50, - 48, - 50, - 49, - 95, - 49, - 50, - 95, - 48, - 50, - 32, - 71, - 109, - 97, - 105, - 108, - 32, - 69, - 110, - 99, - 114, - 121, - 112, - 116, - 105, - 111, - 110, - 10, - 67, - 111, - 109, - 109, - 101, - 110, - 116, - 58, - 32, - 83, - 101, - 97, - 109, - 108, - 101, - 115, - 115, - 108, - 121, - 32, - 115, - 101, - 110, - 100, - 32, - 97, - 110, - 100, - 32, - 114, - 101, - 99, - 101, - 105, - 118, - 101, - 32, - 101, - 110, - 99, - 114, - 121, - 112, - 116, - 101, - 100, - 32, - 101, - 109, - 97, - 105, - 108, - 10, - 10, - 109, - 81, - 71, - 78, - 66, - 71, - 71, - 111, - 115, - 101, - 85, - 66, - 68, - 65, - 67, - 43, - 114, - 75, - 104, - 90, - 56, - 110, - 114, - 68, - 115, - 114, - 75, - 68, - 82, - 104, - 51, - 82, - 102, - 83, - 80, - 121, - 119, - 103, - 80, - 107, - 56, - 104, - 110, - 79, - 70, - 80, - 105, - 111, - 97, - 109, - 90, - 70, - 114, - 110, - 47, - 99, - 121, - 83, - 103, - 88, - 65, - 104, - 56, - 50, - 10, - 57, - 103, - 87, - 101, - 119, - 68, - 48, - 89, - 101, - 122, - 83, - 108, - 110, - 79, - 70, - 100, - 49, - 53, - 114, - 102, - 56, - 54, - 85, - 111, - 118, - 72, - 111, - 48, - 83, - 107, - 53, - 112, - 86, - 121, - 97, - 101, - 65, - 86, - 48, - 52, - 115, - 56, - 78, - 102, - 99, - 50, - 115, - 90, - 90, - 90, - 68, - 97, - 121, - 70, - 114, - 50, - 51, - 50, - 47, - 109, - 99, - 75, - 54, - 76, - 10, - 73, - 77, - 57, - 73, - 53, - 85, - 120, - 105, - 114, - 69, - 122, - 83, - 70, - 83, - 72, - 80, - 100, - 86, - 43, - 122, - 67, - 106, - 114, - 57, - 118, - 47, - 54, - 89, - 110, - 53, - 109, - 48, - 97, - 103, - 99, - 49, - 54, - 103, - 54, - 77, - 99, - 109, - 72, - 71, - 109, - 83, - 110, - 79, - 76, - 121, - 77, - 106, - 121, - 57, - 72, - 103, - 57, - 103, - 85, - 67, - 71, - 112, - 77, - 103, - 10, - 90, - 89, - 88, - 83, - 97, - 98, - 56, - 78, - 71, - 69, - 97, - 89, - 121, - 54, - 90, - 53, - 67, - 104, - 97, - 66, - 106, - 83, - 47, - 108, - 53, - 90, - 121, - 101, - 122, - 66, - 85, - 53, - 53, - 47, - 43, - 55, - 99, - 72, - 107, - 73, - 65, - 72, - 89, - 85, - 120, - 109, - 68, - 100, - 89, - 49, - 112, - 111, - 43, - 121, - 50, - 85, - 53, - 67, - 84, - 110, - 97, - 47, - 65, - 98, - 10, - 88, - 68, - 110, - 108, - 88, - 67, - 102, - 104, - 116, - 110, - 84, - 68, - 112, - 75, - 73, - 56, - 113, - 55, - 50, - 68, - 68, - 73, - 78, - 103, - 70, - 57, - 113, - 69, - 121, - 74, - 122, - 87, - 79, - 88, - 51, - 117, - 105, - 119, - 111, - 121, - 87, - 110, - 76, - 85, - 112, - 122, - 109, - 101, - 70, - 71, - 87, - 80, - 82, - 48, - 85, - 115, - 98, - 80, - 52, - 101, - 51, - 85, - 100, - 74, - 10, - 114, - 113, - 78, - 122, - 98, - 70, - 88, - 78, - 76, - 78, - 74, - 83, - 78, - 47, - 69, - 81, - 47, - 50, - 84, - 71, - 115, - 49, - 119, - 98, - 121, - 81, - 50, - 48, - 99, - 115, - 85, - 111, - 69, - 105, - 117, - 65, - 43, - 89, - 49, - 52, - 118, - 110, - 43, - 75, - 99, - 49, - 122, - 106, - 111, - 52, - 89, - 82, - 73, - 66, - 56, - 54, - 49, - 112, - 102, - 55, - 121, - 117, - 100, - 101, - 10, - 66, - 115, - 78, - 79, - 67, - 121, - 43, - 51, - 55, - 74, - 97, - 100, - 55, - 49, - 68, - 76, - 55, - 70, - 76, - 89, - 115, - 66, - 112, - 55, - 47, - 102, - 104, - 71, - 56, - 117, - 43, - 57, - 74, - 67, - 65, - 49, - 101, - 118, - 68, - 66, - 104, - 55, - 70, - 118, - 88, - 74, - 75, - 109, - 97, - 47, - 49, - 116, - 74, - 107, - 68, - 57, - 50, - 108, - 87, - 88, - 87, - 86, - 85, - 99, - 10, - 113, - 82, - 82, - 90, - 100, - 79, - 56, - 52, - 65, - 81, - 88, - 112, - 103, - 88, - 69, - 115, - 74, - 88, - 55, - 68, - 67, - 119, - 108, - 78, - 121, - 47, - 98, - 66, - 109, - 119, - 68, - 88, - 103, - 75, - 56, - 112, - 100, - 73, - 87, - 102, - 68, - 69, - 99, - 66, - 52, - 49, - 55, - 101, - 77, - 120, - 67, - 51, - 81, - 105, - 101, - 104, - 122, - 73, - 86, - 106, - 115, - 103, - 50, - 90, - 10, - 68, - 101, - 113, - 103, - 71, - 86, - 66, - 113, - 66, - 90, - 47, - 52, - 71, - 69, - 99, - 65, - 69, - 81, - 69, - 65, - 65, - 98, - 81, - 107, - 98, - 109, - 57, - 102, - 90, - 87, - 53, - 106, - 99, - 110, - 108, - 119, - 100, - 71, - 108, - 118, - 98, - 108, - 57, - 122, - 100, - 87, - 74, - 114, - 90, - 88, - 108, - 122, - 81, - 71, - 90, - 115, - 98, - 51, - 100, - 106, - 99, - 110, - 108, - 119, - 10, - 100, - 67, - 53, - 48, - 90, - 88, - 78, - 48, - 105, - 81, - 72, - 85, - 66, - 66, - 77, - 66, - 67, - 65, - 65, - 43, - 70, - 105, - 69, - 69, - 87, - 78, - 56, - 104, - 66, - 55, - 108, - 83, - 117, - 106, - 99, - 104, - 112, - 103, - 103, - 97, - 111, - 71, - 117, - 47, - 103, - 113, - 73, - 72, - 115, - 104, - 52, - 70, - 65, - 109, - 71, - 111, - 115, - 101, - 85, - 67, - 71, - 119, - 77, - 70, - 10, - 67, - 81, - 80, - 67, - 90, - 119, - 65, - 70, - 67, - 119, - 107, - 73, - 66, - 119, - 73, - 71, - 70, - 81, - 111, - 74, - 67, - 65, - 115, - 67, - 66, - 66, - 89, - 67, - 65, - 119, - 69, - 67, - 72, - 103, - 69, - 67, - 70, - 52, - 65, - 65, - 67, - 103, - 107, - 81, - 111, - 71, - 117, - 47, - 103, - 113, - 73, - 72, - 115, - 104, - 52, - 72, - 101, - 65, - 118, - 47, - 101, - 72, - 87, - 68, - 10, - 101, - 97, - 75, - 76, - 72, - 121, - 48, - 87, - 43, - 112, - 51, - 52, - 118, - 108, - 55, - 108, - 111, - 98, - 90, - 54, - 110, - 100, - 112, - 90, - 101, - 107, - 67, - 100, - 80, - 56, - 118, - 101, - 50, - 57, - 77, - 116, - 100, - 117, - 52, - 54, - 67, - 83, - 55, - 87, - 53, - 78, - 50, - 117, - 53, - 108, - 84, - 69, - 99, - 100, - 54, - 105, - 114, - 43, - 116, - 113, - 56, - 87, - 66, - 48, - 10, - 54, - 77, - 113, - 90, - 47, - 75, - 114, - 54, - 111, - 49, - 72, - 115, - 86, - 68, - 114, - 115, - 114, - 68, - 101, - 72, - 52, - 112, - 81, - 120, - 78, - 54, - 70, - 122, - 117, - 73, - 89, - 52, - 117, - 105, - 80, - 98, - 121, - 83, - 115, - 73, - 66, - 118, - 121, - 54, - 90, - 76, - 83, - 120, - 106, - 79, - 55, - 85, - 49, - 100, - 97, - 121, - 102, - 65, - 50, - 97, - 57, - 66, - 73, - 71, - 10, - 110, - 74, - 100, - 50, - 87, - 57, - 102, - 89, - 73, - 115, - 121, - 113, - 111, - 107, - 85, - 88, - 100, - 88, - 43, - 48, - 109, - 43, - 83, - 111, - 89, - 73, - 86, - 103, - 108, - 76, - 85, - 118, - 69, - 74, - 90, - 98, - 90, - 78, - 75, - 73, - 52, - 111, - 78, - 101, - 112, - 82, - 85, - 55, - 51, - 103, - 121, - 75, - 77, - 98, - 85, - 57, - 72, - 81, - 78, - 57, - 109, - 118, - 80, - 82, - 10, - 102, - 67, - 112, - 105, - 103, - 80, - 104, - 43, - 120, - 80, - 111, - 105, - 97, - 102, - 103, - 119, - 70, - 49, - 99, - 80, - 68, - 108, - 50, - 100, - 114, - 71, - 99, - 66, - 90, - 79, - 69, - 53, - 72, - 55, - 76, - 84, - 99, - 121, - 73, - 70, - 75, - 113, - 72, - 56, - 115, - 70, - 77, - 68, - 105, - 90, - 82, - 66, - 55, - 87, - 101, - 114, - 113, - 47, - 117, - 70, - 69, - 120, - 53, - 118, - 10, - 107, - 50, - 105, - 117, - 48, - 68, - 57, - 97, - 47, - 99, - 90, - 71, - 69, - 43, - 85, - 86, - 116, - 111, - 86, - 111, - 107, - 48, - 114, - 65, - 70, - 71, - 105, - 50, - 81, - 116, - 82, - 105, - 120, - 68, - 99, - 102, - 101, - 43, - 119, - 113, - 54, - 48, - 85, - 102, - 106, - 67, - 82, - 66, - 79, - 98, - 70, - 108, - 66, - 85, - 103, - 118, - 108, - 49, - 72, - 73, - 83, - 108, - 87, - 69, - 10, - 48, - 67, - 53, - 80, - 54, - 72, - 67, - 108, - 72, - 113, - 113, - 122, - 104, - 98, - 114, - 56, - 90, - 98, - 107, - 84, - 118, - 78, - 113, - 101, - 82, - 51, - 97, - 101, - 50, - 78, - 98, - 105, - 121, - 49, - 73, - 109, - 86, - 56, - 117, - 76, - 100, - 82, - 78, - 90, - 70, - 114, - 116, - 79, - 103, - 118, - 116, - 70, - 97, - 54, - 103, - 106, - 115, - 122, - 115, - 71, - 69, - 48, - 70, - 88, - 10, - 119, - 82, - 116, - 74, - 80, - 57, - 97, - 121, - 121, - 48, - 50, - 121, - 80, - 114, - 112, - 77, - 122, - 77, - 107, - 118, - 51, - 52, - 65, - 112, - 69, - 121, - 53, - 43, - 48, - 55, - 119, - 79, - 82, - 84, - 98, - 97, - 67, - 115, - 97, - 87, - 100, - 122, - 75, - 115, - 89, - 79, - 74, - 73, - 120, - 108, - 109, - 120, - 51, - 101, - 66, - 65, - 84, - 114, - 103, - 78, - 106, - 86, - 83, - 111, - 10, - 82, - 116, - 48, - 113, - 103, - 99, - 117, - 67, - 54, - 67, - 69, - 109, - 86, - 43, - 106, - 109, - 65, - 87, - 117, - 114, - 73, - 70, - 110, - 100, - 89, - 108, - 112, - 47, - 65, - 74, - 89, - 121, - 74, - 90, - 57, - 74, - 89, - 109, - 56, - 74, - 108, - 66, - 74, - 104, - 108, - 116, - 107, - 99, - 68, - 83, - 120, - 121, - 104, - 90, - 114, - 85, - 89, - 111, - 102, - 52, - 10, - 61, - 48, - 89, - 105, - 87, - 10, - 45, - 45, - 45, - 45, - 45, - 69, - 78, - 68, - 32, - 80, - 71, - 80, - 32, - 80, - 85, - 66, - 76, - 73, - 67, - 32, - 75, - 69, - 89, - 32, - 66, - 76, - 79, - 67, - 75, - 45, - 45, - 45, - 45, - 45, - 10 - ], + "publicKey": [], "recipient": "no_encryption_subkeys@flowcrypt.test" } ], @@ -1532,5 +106,13 @@ "uid": 29, "uidAsHEX": "1d" }, + "verificationResult": { + "isEncrypted": false, + "isSigned": false, + "hasMixedSignatures": false, + "isPartialSigned": false, + "hasUnverifiedSignatures": false, + "hasBadSignatures": false + }, "text": "This message has an attached pub key that has no suitable encryption subkeys" } diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt index 330450acf9..3c050083ab 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt @@ -24,6 +24,7 @@ import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent import androidx.test.espresso.matcher.BoundedMatcher import androidx.test.espresso.matcher.RootMatchers import androidx.test.espresso.matcher.ViewMatchers.assertThat +import androidx.test.espresso.matcher.ViewMatchers.hasSibling import androidx.test.espresso.matcher.ViewMatchers.isChecked import androidx.test.espresso.matcher.ViewMatchers.isDisplayed import androidx.test.espresso.matcher.ViewMatchers.withId @@ -46,7 +47,6 @@ import com.flowcrypt.email.matchers.CustomMatchers.Companion.withEmptyRecyclerVi import com.flowcrypt.email.model.KeyImportDetails import com.flowcrypt.email.rules.AddPrivateKeyToDatabaseRule import com.flowcrypt.email.rules.ClearAppSettingsRule -import com.flowcrypt.email.rules.RetryRule import com.flowcrypt.email.rules.ScreenshotTestRule import com.flowcrypt.email.ui.activity.base.BaseMessageDetailsActivityTest import com.flowcrypt.email.ui.adapter.MsgDetailsRecyclerViewAdapter @@ -56,6 +56,7 @@ import com.flowcrypt.email.util.PrivateKeysManager import com.flowcrypt.email.util.TestGeneralUtil import org.hamcrest.Description import org.hamcrest.Matcher +import org.hamcrest.Matchers.allOf import org.hamcrest.Matchers.anyOf import org.hamcrest.Matchers.anything import org.hamcrest.Matchers.containsString @@ -96,7 +97,7 @@ class MessageDetailsActivityTest : BaseMessageDetailsActivityTest() { .outerRule(ClearAppSettingsRule()) .around(addAccountToDatabaseRule) .around(addPrivateKeyToDatabaseRule) - .around(RetryRule.DEFAULT) + //.around(RetryRule.DEFAULT) .around(activeActivityRule) .around(ScreenshotTestRule()) @@ -620,7 +621,7 @@ class MessageDetailsActivityTest : BaseMessageDetailsActivityTest() { ) baseCheck(msgInfo) - onView(withId(R.id.textViewStatus)) + onView(allOf(withId(R.id.textViewStatus), hasSibling(withId(R.id.switchShowPublicKey)))) .check(matches(withText(getResString(R.string.cannot_be_used_for_encryption)))) onView(withId(R.id.buttonKeyAction)) .check(matches(not(isDisplayed()))) From cf7442f2028a1cd7466889e4b20fe105d6306908 Mon Sep 17 00:00:00 2001 From: DenBond7 Date: Tue, 14 Dec 2021 09:19:57 +0200 Subject: [PATCH 10/12] MessageDetailsActivityTest. Restored "retry" rule usage.| #1097 --- .../flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt index 3c050083ab..37e4801269 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt @@ -47,6 +47,7 @@ import com.flowcrypt.email.matchers.CustomMatchers.Companion.withEmptyRecyclerVi import com.flowcrypt.email.model.KeyImportDetails import com.flowcrypt.email.rules.AddPrivateKeyToDatabaseRule import com.flowcrypt.email.rules.ClearAppSettingsRule +import com.flowcrypt.email.rules.RetryRule import com.flowcrypt.email.rules.ScreenshotTestRule import com.flowcrypt.email.ui.activity.base.BaseMessageDetailsActivityTest import com.flowcrypt.email.ui.adapter.MsgDetailsRecyclerViewAdapter @@ -97,7 +98,7 @@ class MessageDetailsActivityTest : BaseMessageDetailsActivityTest() { .outerRule(ClearAppSettingsRule()) .around(addAccountToDatabaseRule) .around(addPrivateKeyToDatabaseRule) - //.around(RetryRule.DEFAULT) + .around(RetryRule.DEFAULT) .around(activeActivityRule) .around(ScreenshotTestRule()) From 3c4054f37ab29092b56f16a7fc3bdfc7105c40b3 Mon Sep 17 00:00:00 2001 From: DenBond7 Date: Tue, 14 Dec 2021 12:03:32 +0200 Subject: [PATCH 11/12] Added tests for signature verification(inband).| #1097 --- ..._verification_inband_encrypted_signed.json | 54 ++++++ ...ication_inband_encrypted_signed_mixed.json | 55 ++++++ ...ion_inband_encrypted_signed_partially.json | 54 ++++++ ...band_missing_pub_key_encrypted_signed.json | 54 ++++++ ...on_inband_missing_pub_key_only_signed.json | 54 ++++++ ...re_verification_inband_only_encrypted.json | 54 ++++++ ...ature_verification_inband_only_signed.json | 53 ++++++ ...verification_inband_only_signed_mixed.json | 55 ++++++ ...fication_inband_only_signed_partially.json | 53 ++++++ ...e_verification_inband_encrypted_signed.txt | 39 +++++ ...fication_inband_encrypted_signed_mixed.txt | 53 ++++++ ...tion_inband_encrypted_signed_partially.txt | 51 ++++++ ...nband_missing_pub_key_encrypted_signed.txt | 39 +++++ ...ion_inband_missing_pub_key_only_signed.txt | 34 ++++ ...ure_verification_inband_only_encrypted.txt | 36 ++++ ...nature_verification_inband_only_signed.txt | 34 ++++ ..._verification_inband_only_signed_mixed.txt | 43 +++++ ...ification_inband_only_signed_partially.txt | 36 ++++ .../email/matchers/CustomMatchers.kt | 6 + .../email/matchers/PgpBadgeMatcher.kt | 30 ++++ .../ui/activity/MessageDetailsActivityTest.kt | 163 +++++++++++++++++- .../email/util/PrivateKeysManager.kt | 16 ++ .../email/ui/adapter/PgpBadgeListAdapter.kt | 2 + 23 files changed, 1067 insertions(+), 1 deletion(-) create mode 100644 FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed.json create mode 100644 FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_mixed.json create mode 100644 FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_partially.json create mode 100644 FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_encrypted_signed.json create mode 100644 FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_only_signed.json create mode 100644 FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_encrypted.json create mode 100644 FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed.json create mode 100644 FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_mixed.json create mode 100644 FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_partially.json create mode 100644 FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_encrypted_signed.txt create mode 100644 FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_encrypted_signed_mixed.txt create mode 100644 FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_encrypted_signed_partially.txt create mode 100644 FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_missing_pub_key_encrypted_signed.txt create mode 100644 FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_missing_pub_key_only_signed.txt create mode 100644 FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_encrypted.txt create mode 100644 FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_signed.txt create mode 100644 FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_signed_mixed.txt create mode 100644 FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_signed_partially.txt create mode 100644 FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/PgpBadgeMatcher.kt diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed.json new file mode 100644 index 0000000000..bced61e816 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed.json @@ -0,0 +1,54 @@ +{ + "encryptionType": "ENCRYPTED", + "msgBlocks": [ + { + "complete": true, + "content": " \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003chead\u003e\n \u003cmeta name\u003d\"viewport\" content\u003d\"width\u003ddevice-width\"/\u003e\n \u003cstyle\u003e\n body { word-wrap: break-word; word-break: break-word; hyphens: auto; margin-left: 0px; padding-left: 0px; }\n body img { display: inline !important; height: auto !important; max-width: 95% !important; }\n body pre { white-space: pre-wrap !important; }\n body \u003e div.MsgBlock \u003e table { zoom: 75% } /* table layouts tend to overflow - eg emails from fb */\n \u003c/style\u003e\n \u003c/head\u003e\n \u003cbody\u003e\u003cdiv class\u003d\"MsgBlock GREEN\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #31A217;border-right: none;background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAh1BMVEXw8PD////w8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PD7MuHIAAAALXRSTlMAAAECBAcICw4QEhUZIyYqMTtGTV5kdn2Ii5mfoKOqrbG0uL6/xcnM0NTX2t1l7cN4AAAB0UlEQVR4Ae3Y3Y4SQRCG4bdHweFHRBTBH1FRFLXv//qsA8kmvbMdXhh2Q0KfknpSCQc130c67s22+e9+v/+d84fxkSPH0m/+5P9vN7vRV0vPfx7or1NB23e99KAHuoXOOc6moQsBwNN1Q9g4Wdh1uq3MA7Qn0+2ylAt7WbWpyT+Wo8roKH6v2QhZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2gjZ2AUNOLmwgQdogEJ2dnF3UJdU3WjqO/u96aYtVd/7jqvIyu76G5se6GaY7tNNcy5d7se7eWVnDz87fMkuVuS8epF6f9NPObPY5re9y4N1/vya9Gr3se2bfvl9M0mkyZdv077p+a/3z4Meby5Br4NWiV51BaiUqfLro9I3WiR61RVcffwfXI7u5zZ20EOA82Uu8x3SlrSwXQuBSvSqK0AletUVoBK96gpIwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWckIletUVIJJxITN6wtZd2EI+0NquyIJOnUpFVvRpcwmV6FVXgEr0qitAJXrVFaASveoKUIledQWoRK+6AlSiV13BP+/VVbky7Xq1AAAAAElFTkSuQmCC);\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eIt\u0027s encrypted and signed message\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003c/body\u003e\n \u003c/html\u003e", + "type": "plainHtml" + } + ], + "msgEntity": { + "cc": [], + "email": "default@flowcrypt.test", + "flags": "\\SEEN", + "folder": "INBOX", + "from": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "fromAddress": "denbond7@flowcrypt.test", + "hasAttachments": false, + "id": 453, + "isEncrypted": true, + "isSeen": true, + "msgState": "NONE", + "receivedDate": 1639147807000, + "replyTo": "denbond7@flowcrypt.test", + "replyToAddress": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "sentDate": 1639147805000, + "state": -1, + "subject": "Encrypted + signed(Inband)", + "to": [ + { + "address": "default@flowcrypt.test" + } + ], + "toAddress": "default@flowcrypt.test", + "uid": 32, + "uidAsHEX": "20" + }, + "text": "It's encrypted and signed message", + "verificationResult": { + "hasBadSignatures": false, + "hasMixedSignatures": false, + "hasUnverifiedSignatures": false, + "isEncrypted": true, + "isPartialSigned": false, + "isSigned": true + } +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_mixed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_mixed.json new file mode 100644 index 0000000000..026cd5b834 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_mixed.json @@ -0,0 +1,55 @@ +{ + "encryptionType": "ENCRYPTED", + "msgBlocks": [ + { + "complete": true, + "content": " \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003chead\u003e\n \u003cmeta name\u003d\"viewport\" content\u003d\"width\u003ddevice-width\"/\u003e\n \u003cstyle\u003e\n body { word-wrap: break-word; word-break: break-word; hyphens: auto; margin-left: 0px; padding-left: 0px; }\n body img { display: inline !important; height: auto !important; max-width: 95% !important; }\n body pre { white-space: pre-wrap !important; }\n body \u003e div.MsgBlock \u003e table { zoom: 75% } /* table layouts tend to overflow - eg emails from fb */\n \u003c/style\u003e\n \u003c/head\u003e\n \u003cbody\u003e\u003cdiv class\u003d\"MsgBlock GREEN\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #31A217;border-right: none;background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAh1BMVEXw8PD////w8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PD7MuHIAAAALXRSTlMAAAECBAcICw4QEhUZIyYqMTtGTV5kdn2Ii5mfoKOqrbG0uL6/xcnM0NTX2t1l7cN4AAAB0UlEQVR4Ae3Y3Y4SQRCG4bdHweFHRBTBH1FRFLXv//qsA8kmvbMdXhh2Q0KfknpSCQc130c67s22+e9+v/+d84fxkSPH0m/+5P9vN7vRV0vPfx7or1NB23e99KAHuoXOOc6moQsBwNN1Q9g4Wdh1uq3MA7Qn0+2ylAt7WbWpyT+Wo8roKH6v2QhZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2gjZ2AUNOLmwgQdogEJ2dnF3UJdU3WjqO/u96aYtVd/7jqvIyu76G5se6GaY7tNNcy5d7se7eWVnDz87fMkuVuS8epF6f9NPObPY5re9y4N1/vya9Gr3se2bfvl9M0mkyZdv077p+a/3z4Meby5Br4NWiV51BaiUqfLro9I3WiR61RVcffwfXI7u5zZ20EOA82Uu8x3SlrSwXQuBSvSqK0AletUVoBK96gpIwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWckIletUVIJJxITN6wtZd2EI+0NquyIJOnUpFVvRpcwmV6FVXgEr0qitAJXrVFaASveoKUIledQWoRK+6AlSiV13BP+/VVbky7Xq1AAAAAElFTkSuQmCC);\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eEncrypted + signed with the primary key\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003cdiv class\u003d\"MsgBlock GREEN\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #31A217;border-right: none;background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAh1BMVEXw8PD////w8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PD7MuHIAAAALXRSTlMAAAECBAcICw4QEhUZIyYqMTtGTV5kdn2Ii5mfoKOqrbG0uL6/xcnM0NTX2t1l7cN4AAAB0UlEQVR4Ae3Y3Y4SQRCG4bdHweFHRBTBH1FRFLXv//qsA8kmvbMdXhh2Q0KfknpSCQc130c67s22+e9+v/+d84fxkSPH0m/+5P9vN7vRV0vPfx7or1NB23e99KAHuoXOOc6moQsBwNN1Q9g4Wdh1uq3MA7Qn0+2ylAt7WbWpyT+Wo8roKH6v2QhZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2gjZ2AUNOLmwgQdogEJ2dnF3UJdU3WjqO/u96aYtVd/7jqvIyu76G5se6GaY7tNNcy5d7se7eWVnDz87fMkuVuS8epF6f9NPObPY5re9y4N1/vya9Gr3se2bfvl9M0mkyZdv077p+a/3z4Meby5Br4NWiV51BaiUqfLro9I3WiR61RVcffwfXI7u5zZ20EOA82Uu8x3SlrSwXQuBSvSqK0AletUVoBK96gpIwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWckIletUVIJJxITN6wtZd2EI+0NquyIJOnUpFVvRpcwmV6FVXgEr0qitAJXrVFaASveoKUIledQWoRK+6AlSiV13BP+/VVbky7Xq1AAAAAElFTkSuQmCC);\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eEncrypted + signed with the second key\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003c/body\u003e\n \u003c/html\u003e", + "type": "plainHtml" + } + ], + "msgEntity": { + "cc": [], + "email": "default@flowcrypt.test", + "flags": "\\SEEN", + "folder": "INBOX", + "from": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "fromAddress": "denbond7@flowcrypt.test", + "hasAttachments": false, + "id": 460, + "isEncrypted": true, + "isNew": false, + "isSeen": true, + "msgState": "NONE", + "receivedDate": 1639377131000, + "replyTo": "denbond7@flowcrypt.test", + "replyToAddress": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "sentDate": 1639226834000, + "state": -1, + "subject": "Encrypted + signed mixed(inband)", + "to": [ + { + "address": "default@flowcrypt.test" + } + ], + "toAddress": "default@flowcrypt.test", + "uid": 37, + "uidAsHEX": "25" + }, + "text": "Encrypted + signed with the primary key\nEncrypted + signed with the second key", + "verificationResult": { + "hasBadSignatures": false, + "hasMixedSignatures": true, + "hasUnverifiedSignatures": true, + "isEncrypted": true, + "isPartialSigned": false, + "isSigned": true + } +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_partially.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_partially.json new file mode 100644 index 0000000000..d56c542565 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_encrypted_signed_partially.json @@ -0,0 +1,54 @@ +{ + "encryptionType": "ENCRYPTED", + "msgBlocks": [ + { + "complete": true, + "content": " \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003chead\u003e\n \u003cmeta name\u003d\"viewport\" content\u003d\"width\u003ddevice-width\"/\u003e\n \u003cstyle\u003e\n body { word-wrap: break-word; word-break: break-word; hyphens: auto; margin-left: 0px; padding-left: 0px; }\n body img { display: inline !important; height: auto !important; max-width: 95% !important; }\n body pre { white-space: pre-wrap !important; }\n body \u003e div.MsgBlock \u003e table { zoom: 75% } /* table layouts tend to overflow - eg emails from fb */\n \u003c/style\u003e\n \u003c/head\u003e\n \u003cbody\u003e\u003cdiv class\u003d\"MsgBlock GREEN\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #31A217;border-right: none;background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAh1BMVEXw8PD////w8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PD7MuHIAAAALXRSTlMAAAECBAcICw4QEhUZIyYqMTtGTV5kdn2Ii5mfoKOqrbG0uL6/xcnM0NTX2t1l7cN4AAAB0UlEQVR4Ae3Y3Y4SQRCG4bdHweFHRBTBH1FRFLXv//qsA8kmvbMdXhh2Q0KfknpSCQc130c67s22+e9+v/+d84fxkSPH0m/+5P9vN7vRV0vPfx7or1NB23e99KAHuoXOOc6moQsBwNN1Q9g4Wdh1uq3MA7Qn0+2ylAt7WbWpyT+Wo8roKH6v2QhZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2gjZ2AUNOLmwgQdogEJ2dnF3UJdU3WjqO/u96aYtVd/7jqvIyu76G5se6GaY7tNNcy5d7se7eWVnDz87fMkuVuS8epF6f9NPObPY5re9y4N1/vya9Gr3se2bfvl9M0mkyZdv077p+a/3z4Meby5Br4NWiV51BaiUqfLro9I3WiR61RVcffwfXI7u5zZ20EOA82Uu8x3SlrSwXQuBSvSqK0AletUVoBK96gpIwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWckIletUVIJJxITN6wtZd2EI+0NquyIJOnUpFVvRpcwmV6FVXgEr0qitAJXrVFaASveoKUIledQWoRK+6AlSiV13BP+/VVbky7Xq1AAAAAElFTkSuQmCC);\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eSome encrypted and signed text\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003cdiv class\u003d\"MsgBlock GREEN\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #31A217;border-right: none;background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAh1BMVEXw8PD////w8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PD7MuHIAAAALXRSTlMAAAECBAcICw4QEhUZIyYqMTtGTV5kdn2Ii5mfoKOqrbG0uL6/xcnM0NTX2t1l7cN4AAAB0UlEQVR4Ae3Y3Y4SQRCG4bdHweFHRBTBH1FRFLXv//qsA8kmvbMdXhh2Q0KfknpSCQc130c67s22+e9+v/+d84fxkSPH0m/+5P9vN7vRV0vPfx7or1NB23e99KAHuoXOOc6moQsBwNN1Q9g4Wdh1uq3MA7Qn0+2ylAt7WbWpyT+Wo8roKH6v2QhZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2gjZ2AUNOLmwgQdogEJ2dnF3UJdU3WjqO/u96aYtVd/7jqvIyu76G5se6GaY7tNNcy5d7se7eWVnDz87fMkuVuS8epF6f9NPObPY5re9y4N1/vya9Gr3se2bfvl9M0mkyZdv077p+a/3z4Meby5Br4NWiV51BaiUqfLro9I3WiR61RVcffwfXI7u5zZ20EOA82Uu8x3SlrSwXQuBSvSqK0AletUVoBK96gpIwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWckIletUVIJJxITN6wtZd2EI+0NquyIJOnUpFVvRpcwmV6FVXgEr0qitAJXrVFaASveoKUIledQWoRK+6AlSiV13BP+/VVbky7Xq1AAAAAElFTkSuQmCC);\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eIt\u0027s encrypted only message\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003c/body\u003e\n \u003c/html\u003e", + "type": "plainHtml" + } + ], + "msgEntity": { + "cc": [], + "email": "default@flowcrypt.test", + "flags": "\\SEEN", + "folder": "INBOX", + "from": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "isEncrypted": true, + "fromAddress": "denbond7@flowcrypt.test", + "hasAttachments": false, + "id": 456, + "isSeen": true, + "msgState": "NONE", + "receivedDate": 1639223056000, + "replyTo": "denbond7@flowcrypt.test", + "replyToAddress": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "sentDate": 1639223054000, + "state": -1, + "subject": "Encrypted + signed partially(inband)", + "to": [ + { + "address": "default@flowcrypt.test" + } + ], + "toAddress": "default@flowcrypt.test", + "uid": 35, + "uidAsHEX": "23" + }, + "text": "Some encrypted and signed text\nIt\u0027s encrypted only message", + "verificationResult": { + "hasBadSignatures": false, + "hasMixedSignatures": false, + "hasUnverifiedSignatures": false, + "isEncrypted": true, + "isPartialSigned": true, + "isSigned": true + } +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_encrypted_signed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_encrypted_signed.json new file mode 100644 index 0000000000..cb57f4ab08 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_encrypted_signed.json @@ -0,0 +1,54 @@ +{ + "encryptionType": "ENCRYPTED", + "msgBlocks": [ + { + "complete": true, + "content": " \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003chead\u003e\n \u003cmeta name\u003d\"viewport\" content\u003d\"width\u003ddevice-width\"/\u003e\n \u003cstyle\u003e\n body { word-wrap: break-word; word-break: break-word; hyphens: auto; margin-left: 0px; padding-left: 0px; }\n body img { display: inline !important; height: auto !important; max-width: 95% !important; }\n body pre { white-space: pre-wrap !important; }\n body \u003e div.MsgBlock \u003e table { zoom: 75% } /* table layouts tend to overflow - eg emails from fb */\n \u003c/style\u003e\n \u003c/head\u003e\n \u003cbody\u003e\u003cdiv class\u003d\"MsgBlock GREEN\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #31A217;border-right: none;background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAh1BMVEXw8PD////w8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PD7MuHIAAAALXRSTlMAAAECBAcICw4QEhUZIyYqMTtGTV5kdn2Ii5mfoKOqrbG0uL6/xcnM0NTX2t1l7cN4AAAB0UlEQVR4Ae3Y3Y4SQRCG4bdHweFHRBTBH1FRFLXv//qsA8kmvbMdXhh2Q0KfknpSCQc130c67s22+e9+v/+d84fxkSPH0m/+5P9vN7vRV0vPfx7or1NB23e99KAHuoXOOc6moQsBwNN1Q9g4Wdh1uq3MA7Qn0+2ylAt7WbWpyT+Wo8roKH6v2QhZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2gjZ2AUNOLmwgQdogEJ2dnF3UJdU3WjqO/u96aYtVd/7jqvIyu76G5se6GaY7tNNcy5d7se7eWVnDz87fMkuVuS8epF6f9NPObPY5re9y4N1/vya9Gr3se2bfvl9M0mkyZdv077p+a/3z4Meby5Br4NWiV51BaiUqfLro9I3WiR61RVcffwfXI7u5zZ20EOA82Uu8x3SlrSwXQuBSvSqK0AletUVoBK96gpIwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWckIletUVIJJxITN6wtZd2EI+0NquyIJOnUpFVvRpcwmV6FVXgEr0qitAJXrVFaASveoKUIledQWoRK+6AlSiV13BP+/VVbky7Xq1AAAAAElFTkSuQmCC);\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eIt\u0027s an encrypted message that was signed with a wrong private key. Sender and signer are different.\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003c/body\u003e\n \u003c/html\u003e", + "type": "plainHtml" + } + ], + "msgEntity": { + "cc": [], + "email": "default@flowcrypt.test", + "flags": "\\SEEN", + "folder": "INBOX", + "from": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "fromAddress": "denbond7@flowcrypt.test", + "hasAttachments": false, + "id": 497, + "isEncrypted": true, + "isNew": false, + "isSeen": true, + "msgState": "NONE", + "receivedDate": 1639402456000, + "replyTo": "denbond7@flowcrypt.test", + "replyToAddress": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "sentDate": 1639402453000, + "subject": "Encrypted + signed(inband) + no pub key", + "to": [ + { + "address": "default@flowcrypt.test" + } + ], + "toAddress": "default@flowcrypt.test", + "uid": 39, + "uidAsHEX": "27" + }, + "text": "It\u0027s an encrypted message that was signed with a wrong private key. Sender and signer are different.", + "verificationResult": { + "hasBadSignatures": false, + "hasMixedSignatures": false, + "hasUnverifiedSignatures": true, + "isEncrypted": true, + "isPartialSigned": false, + "isSigned": true + } +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_only_signed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_only_signed.json new file mode 100644 index 0000000000..880023eac9 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_missing_pub_key_only_signed.json @@ -0,0 +1,54 @@ +{ + "encryptionType": "STANDARD", + "msgBlocks": [ + { + "complete": true, + "content": " \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003chead\u003e\n \u003cmeta name\u003d\"viewport\" content\u003d\"width\u003ddevice-width\"/\u003e\n \u003cstyle\u003e\n body { word-wrap: break-word; word-break: break-word; hyphens: auto; margin-left: 0px; padding-left: 0px; }\n body img { display: inline !important; height: auto !important; max-width: 95% !important; }\n body pre { white-space: pre-wrap !important; }\n body \u003e div.MsgBlock \u003e table { zoom: 75% } /* table layouts tend to overflow - eg emails from fb */\n \u003c/style\u003e\n \u003c/head\u003e\n \u003cbody\u003e\u003cdiv class\u003d\"MsgBlock GRAY\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #989898;border-right: none;\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eIt\u0027s a regular message that was signed with a wrong private key. Sender and signer are different.\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003c/body\u003e\n \u003c/html\u003e", + "type": "plainHtml" + } + ], + "msgEntity": { + "cc": [], + "email": "default@flowcrypt.test", + "flags": "\\SEEN", + "folder": "INBOX", + "from": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "fromAddress": "denbond7@flowcrypt.test", + "hasAttachments": false, + "id": 499, + "isEncrypted": false, + "isNew": false, + "isSeen": true, + "msgState": "NONE", + "receivedDate": 1639402610000, + "replyTo": "denbond7@flowcrypt.test", + "replyToAddress": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "sentDate": 1639402608000, + "subject": "NOT encrypted + signed(inband) + no pub key", + "to": [ + { + "address": "default@flowcrypt.test" + } + ], + "toAddress": "default@flowcrypt.test", + "uid": 40, + "uidAsHEX": "28" + }, + "text": "It's a regular message that was signed with a wrong private key. Sender and signer are different.", + "verificationResult": { + "hasBadSignatures": false, + "hasMixedSignatures": false, + "hasUnverifiedSignatures": true, + "isEncrypted": false, + "isPartialSigned": false, + "isSigned": true + } +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_encrypted.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_encrypted.json new file mode 100644 index 0000000000..dac129a54f --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_encrypted.json @@ -0,0 +1,54 @@ +{ + "encryptionType": "ENCRYPTED", + "msgBlocks": [ + { + "complete": true, + "content": " \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003chead\u003e\n \u003cmeta name\u003d\"viewport\" content\u003d\"width\u003ddevice-width\"/\u003e\n \u003cstyle\u003e\n body { word-wrap: break-word; word-break: break-word; hyphens: auto; margin-left: 0px; padding-left: 0px; }\n body img { display: inline !important; height: auto !important; max-width: 95% !important; }\n body pre { white-space: pre-wrap !important; }\n body \u003e div.MsgBlock \u003e table { zoom: 75% } /* table layouts tend to overflow - eg emails from fb */\n \u003c/style\u003e\n \u003c/head\u003e\n \u003cbody\u003e\u003cdiv class\u003d\"MsgBlock GREEN\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #31A217;border-right: none;background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAh1BMVEXw8PD////w8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PD7MuHIAAAALXRSTlMAAAECBAcICw4QEhUZIyYqMTtGTV5kdn2Ii5mfoKOqrbG0uL6/xcnM0NTX2t1l7cN4AAAB0UlEQVR4Ae3Y3Y4SQRCG4bdHweFHRBTBH1FRFLXv//qsA8kmvbMdXhh2Q0KfknpSCQc130c67s22+e9+v/+d84fxkSPH0m/+5P9vN7vRV0vPfx7or1NB23e99KAHuoXOOc6moQsBwNN1Q9g4Wdh1uq3MA7Qn0+2ylAt7WbWpyT+Wo8roKH6v2QhZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2ghZ2gjZ2AUNOLmwgQdogEJ2dnF3UJdU3WjqO/u96aYtVd/7jqvIyu76G5se6GaY7tNNcy5d7se7eWVnDz87fMkuVuS8epF6f9NPObPY5re9y4N1/vya9Gr3se2bfvl9M0mkyZdv077p+a/3z4Meby5Br4NWiV51BaiUqfLro9I3WiR61RVcffwfXI7u5zZ20EOA82Uu8x3SlrSwXQuBSvSqK0AletUVoBK96gpIwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWctDCVnLQwlZy0MJWckIletUVIJJxITN6wtZd2EI+0NquyIJOnUpFVvRpcwmV6FVXgEr0qitAJXrVFaASveoKUIledQWoRK+6AlSiV13BP+/VVbky7Xq1AAAAAElFTkSuQmCC);\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eIt\u0027s encrypted only message\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003c/body\u003e\n \u003c/html\u003e", + "type": "plainHtml" + } + ], + "msgEntity": { + "cc": [], + "email": "default@flowcrypt.test", + "flags": "\\SEEN", + "folder": "INBOX", + "from": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "fromAddress": "denbond7@flowcrypt.test", + "hasAttachments": false, + "id": 451, + "isSeen": true, + "isEncrypted": true, + "msgState": "NONE", + "receivedDate": 1639147522000, + "replyTo": "denbond7@flowcrypt.test", + "replyToAddress": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "sentDate": 1639147477000, + "state": -1, + "subject": "Encrypted + NOT signed", + "to": [ + { + "address": "default@flowcrypt.test" + } + ], + "toAddress": "default@flowcrypt.test", + "uid": 29, + "uidAsHEX": "1d" + }, + "text": "It\u0027s encrypted only message", + "verificationResult": { + "hasBadSignatures": false, + "hasMixedSignatures": false, + "hasUnverifiedSignatures": false, + "isEncrypted": true, + "isPartialSigned": false, + "isSigned": false + } +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed.json new file mode 100644 index 0000000000..615daf7ebb --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed.json @@ -0,0 +1,53 @@ +{ + "encryptionType": "STANDARD", + "msgBlocks": [ + { + "complete": true, + "content": " \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003chead\u003e\n \u003cmeta name\u003d\"viewport\" content\u003d\"width\u003ddevice-width\"/\u003e\n \u003cstyle\u003e\n body { word-wrap: break-word; word-break: break-word; hyphens: auto; margin-left: 0px; padding-left: 0px; }\n body img { display: inline !important; height: auto !important; max-width: 95% !important; }\n body pre { white-space: pre-wrap !important; }\n body \u003e div.MsgBlock \u003e table { zoom: 75% } /* table layouts tend to overflow - eg emails from fb */\n \u003c/style\u003e\n \u003c/head\u003e\n \u003cbody\u003e\u003cdiv class\u003d\"MsgBlock GRAY\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #989898;border-right: none;\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eIt\u0027s signed (Inband) only message.\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003c/body\u003e\n \u003c/html\u003e", + "type": "plainHtml" + } + ], + "msgEntity": { + "cc": [], + "email": "default@flowcrypt.test", + "flags": "\\SEEN", + "folder": "INBOX", + "from": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "fromAddress": "denbond7@flowcrypt.test", + "hasAttachments": false, + "id": 452, + "isSeen": true, + "msgState": "NONE", + "receivedDate": 1639147743000, + "replyTo": "denbond7@flowcrypt.test", + "replyToAddress": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "sentDate": 1639147740000, + "state": -1, + "subject": "NOT encrypted + signed(Inband)", + "to": [ + { + "address": "default@flowcrypt.test" + } + ], + "toAddress": "default@flowcrypt.test", + "uid": 31, + "uidAsHEX": "1f" + }, + "text": "It's signed (Inband) only message.", + "verificationResult": { + "hasBadSignatures": false, + "hasMixedSignatures": false, + "hasUnverifiedSignatures": false, + "isEncrypted": false, + "isPartialSigned": false, + "isSigned": true + } +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_mixed.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_mixed.json new file mode 100644 index 0000000000..bb71f70cf2 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_mixed.json @@ -0,0 +1,55 @@ +{ + "encryptionType": "STANDARD", + "msgBlocks": [ + { + "complete": true, + "content": " \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003chead\u003e\n \u003cmeta name\u003d\"viewport\" content\u003d\"width\u003ddevice-width\"/\u003e\n \u003cstyle\u003e\n body { word-wrap: break-word; word-break: break-word; hyphens: auto; margin-left: 0px; padding-left: 0px; }\n body img { display: inline !important; height: auto !important; max-width: 95% !important; }\n body pre { white-space: pre-wrap !important; }\n body \u003e div.MsgBlock \u003e table { zoom: 75% } /* table layouts tend to overflow - eg emails from fb */\n \u003c/style\u003e\n \u003c/head\u003e\n \u003cbody\u003e\u003cdiv class\u003d\"MsgBlock GRAY\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #989898;border-right: none;\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eSigned with a primary key\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003cdiv class\u003d\"MsgBlock GRAY\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #989898;border-right: none;\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eSigned with the second key\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003c/body\u003e\n \u003c/html\u003e", + "type": "plainHtml" + } + ], + "msgEntity": { + "cc": [], + "email": "default@flowcrypt.test", + "flags": "\\SEEN", + "folder": "INBOX", + "from": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "fromAddress": "denbond7@flowcrypt.test", + "hasAttachments": false, + "id": 462, + "isEncrypted": false, + "isNew": false, + "isSeen": true, + "msgState": "NONE", + "receivedDate": 1639377556000, + "replyTo": "denbond7@flowcrypt.test", + "replyToAddress": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "sentDate": 1639227258000, + "state": -1, + "subject": "NOT encrypted + signed mixed(inband)", + "to": [ + { + "address": "default@flowcrypt.test" + } + ], + "toAddress": "default@flowcrypt.test", + "uid": 38, + "uidAsHEX": "26" + }, + "text": "Signed with a primary key\nSigned with the second key", + "verificationResult": { + "hasBadSignatures": false, + "hasMixedSignatures": true, + "hasUnverifiedSignatures": true, + "isEncrypted": false, + "isPartialSigned": false, + "isSigned": true + } +} diff --git a/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_partially.json b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_partially.json new file mode 100644 index 0000000000..c1eb8ba5a7 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/info/signature_verification_inband_only_signed_partially.json @@ -0,0 +1,53 @@ +{ + "encryptionType": "STANDARD", + "msgBlocks": [ + { + "complete": true, + "content": " \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003chead\u003e\n \u003cmeta name\u003d\"viewport\" content\u003d\"width\u003ddevice-width\"/\u003e\n \u003cstyle\u003e\n body { word-wrap: break-word; word-break: break-word; hyphens: auto; margin-left: 0px; padding-left: 0px; }\n body img { display: inline !important; height: auto !important; max-width: 95% !important; }\n body pre { white-space: pre-wrap !important; }\n body \u003e div.MsgBlock \u003e table { zoom: 75% } /* table layouts tend to overflow - eg emails from fb */\n \u003c/style\u003e\n \u003c/head\u003e\n \u003cbody\u003e\u003cdiv class\u003d\"MsgBlock PLAIN\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: none;\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eSome plain text\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003cdiv class\u003d\"MsgBlock GRAY\" style\u003d\"background: white;padding-left: 8px;min-height: 50px;padding-top: 4px;padding-bottom: 4px;width: 100%;border: 1px solid #f0f0f0;border-left: 8px solid #989898;border-right: none;\"\u003e\u003chtml\u003e\u003chead\u003e\u003c/head\u003e\u003cbody\u003eOnly signed message\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003c/body\u003e\n \u003c/html\u003e", + "type": "plainHtml" + } + ], + "msgEntity": { + "cc": [], + "email": "default@flowcrypt.test", + "flags": "\\SEEN", + "folder": "INBOX", + "from": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "fromAddress": "denbond7@flowcrypt.test", + "hasAttachments": false, + "id": 457, + "isSeen": true, + "msgState": "NONE", + "receivedDate": 1639223239000, + "replyTo": "denbond7@flowcrypt.test", + "replyToAddress": [ + { + "address": "denbond7@flowcrypt.test" + } + ], + "sentDate": 1639223237000, + "state": -1, + "subject": "NOT encrypted + signed partially(inband)", + "to": [ + { + "address": "default@flowcrypt.test" + } + ], + "toAddress": "default@flowcrypt.test", + "uid": 36, + "uidAsHEX": "24" + }, + "text": "Some plain text\nOnly signed message", + "verificationResult": { + "hasBadSignatures": false, + "hasMixedSignatures": false, + "hasUnverifiedSignatures": false, + "isEncrypted": false, + "isPartialSigned": true, + "isSigned": true + } +} diff --git a/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_encrypted_signed.txt b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_encrypted_signed.txt new file mode 100644 index 0000000000..7db7ef8829 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_encrypted_signed.txt @@ -0,0 +1,39 @@ +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id 7exvFh9ps2HaCAAAc/RpdQ + (envelope-from ) + for ; Fri, 10 Dec 2021 14:50:07 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 593256C1E68 + for ; Fri, 10 Dec 2021 14:50:07 +0000 (UTC) +Date: Fri, 10 Dec 2021 16:50:05 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <80534408.1.1639147805211@flowcrypt.test> +Subject: Encrypted + signed(Inband) +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_85360913.1639147805127" + +------=_Part_0_85360913.1639147805127 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdA3AUBbNBYHs7uBkHYPB2MScrOjyjr8H3uUHD/oV66NRUw +QwHSwqj/w5Zh1TIyCNPrL+5CHKw6AWoxf/tueiN7k18lxhrrrK2G4YcmW2IxhAD0 +hF4D16Pe22XLHvsSAQdADdHH+j+A9Vl8dYDlQLewJrBsDqoLXtL3C9qvSVBXo0Aw +zxk+hWPctb9Zuu9kexEZao2sA7CkyQIVuoX++toxpuUH2cnM2tMx2wdOsqk/b80u +0sASASXoL13FL1aRfUmJti8FXjwK7pu7sR7EOXq1dqVfuDRWT1PICa3cJRvTZbe1 +jsePedNvt74GsllnaoZykqcWoEfiEL0CvU796P60+CBpsxQ304rO9G41P1a9CtvR +OTAwOd+ZcfypPoNGQuw90TY/678yq03RROZMiZvHa96UqYPHjdo5q/7RjZVVde7k +JGplAW7C9+93vjJ8tl328hYItBpPF26dQB+AHMIz/AND0MwbnUEdJyPs9AGoVeak +xjaRjpUqh3BDc+mdxXlztNVdmRFQ +=YZEj +-----END PGP MESSAGE----- + +------=_Part_0_85360913.1639147805127-- diff --git a/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_encrypted_signed_mixed.txt b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_encrypted_signed_mixed.txt new file mode 100644 index 0000000000..61b8b913d5 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_encrypted_signed_mixed.txt @@ -0,0 +1,53 @@ +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id hynLJ+votmFNBwAAc/RpdQ + (envelope-from ) + for ; Mon, 13 Dec 2021 06:32:11 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 9F6B67E0E3C + for ; Mon, 13 Dec 2021 06:32:11 +0000 (UTC) +Date: Sat, 11 Dec 2021 14:47:14 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <110314482.1.1639226834163@flowcrypt.test> +Subject: Encrypted + signed mixed(inband) +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_150365359.1639226834147" + +------=_Part_0_150365359.1639226834147 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdAyDv4lT7yZwY+k7XTngGbM9R3TSIDfJ05jjPtP1tgVhww +Ow986yKDq8RwNwRuOP+Zetgzv3Rueds53oH6WubsfFbkfqDddSuxbivSPMaJrsEa +hF4D16Pe22XLHvsSAQdAm0JxdCnyvGhOwCeljYCmXnnR6bd7sfxTpHbiBN5eiUYw +vXWpjLvybfnbIwMFOkYJY7xLi0nbiMG4GYKTUzy1UZYezPlig0CN65zXmQtwSX+I +0sAXAXZTOnpBBAC7adCCn98X8ym6EhabfV/Kxtk54zNP4/E2tEs88G3eKRHAcFYA +dsSRpd6fbQ+Od+2MxRr29gKdH/IMk+zuhg4K45HEu24039/1KyV31g+L35A9764A +yxGwyMw816TcSK4Rfx3ZdRc4gxRy1chCLf9QDlTowDiaiAk14ntfqqUOZTUj+OcV +80bEHI8VxTs1KPgqHvt0dOkSQBJzLk/4OlqOhoRBTJq2TBaP2iBlO4/MMKlhG4NG +ubaIKDKh/tfhMteAfWE52yiz3htm980akzc= +=rudy +-----END PGP MESSAGE----- + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdArBX9SbPgfhP9wqWOBFvkfDKBxszXMVfDrmKr31dNOh8w +tOprLXmSEJw6YwEIqAXByU/olv90UG7sEmIkI7J6AEmyFOkSDokJPAQrpU9Umcum +hF4DdhH7TgaiP74SAQdANFfZyN86QhSBkh5ywThUC/nNmQlkIUJ2pEuCF7IEKAIw +4xVCdmdRlEltVVP4K7OnGme3nQEmnANDXdZ69HQJYUSMsgFWB3HkFJ/iqM4b3TNe +0sAXATT2v+7RWASJS/tLN1a2XEMy+ybwNremGO0IPo8ji9EQOcFaD029OvMdq2C+ +AHXxBqmi1hcnn2CuLVyAOWh5bj0VJSKuMsgx1yDMpYItfuhTLs0dQ1JA93dJCfi2 +7r6ueKx5eDv5y6hr3thNn+ctOF0r7CDOZWtE5oznOErmmg05Q+nGMJzN85kGV6mj +1cmYEq6/sVjYf6J+iYFVkywdY7ne+FBHjJ0cX4JEmvy4SCfO51cM+cGzFtup+a6P +afd0d2jaJS9rkgbmS4VMtGIlfrCMIOhl6ws= +=1cM4 +-----END PGP MESSAGE----- +------=_Part_0_150365359.1639226834147-- diff --git a/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_encrypted_signed_partially.txt b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_encrypted_signed_partially.txt new file mode 100644 index 0000000000..151ddf4365 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_encrypted_signed_partially.txt @@ -0,0 +1,51 @@ +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id U5V7IRCPtGGABQAAc/RpdQ + (envelope-from ) + for ; Sat, 11 Dec 2021 11:44:16 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 85B8C7E0A66 + for ; Sat, 11 Dec 2021 11:44:16 +0000 (UTC) +Date: Sat, 11 Dec 2021 13:44:14 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <18216133.1.1639223054277@flowcrypt.test> +Subject: Encrypted + signed partially(inband) +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_233169424.1639223054262" + +------=_Part_0_233169424.1639223054262 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdAk9cJSvMdCEy720HDusXhkyPPueKN/lCJs7a+9ZipNkMw +t7kWnNV1GPawCh2AO4tsQAglt05gXfMVp6KZuobhOzAo8ejsFZ8l6NrmD9GkSKgk +hF4D16Pe22XLHvsSAQdAYZljKw41PYIeGNnPxbXXj+fMEVZ7r95/jGx24PiL2nsw +2mxZJ0IFqejwD1EtWWHGdCvQJq9hRE3xGUqG5KutLvFP70rZr7ohNzEZW3g8hIl7 +0sAOAZdOkq7hFd+2edSp6QoBo08lCtGPZ99uWjZMJ2O0xlrzXQHHfiKo29jLE4dd +QSLDkAEe6NFeGxFFtETWipOL/a7spfrSuGhC6irfR6kVVlvloMDGJQqdMyaJx/6r +JA68fo+lcMeN198b471AMPnMfzuhh5UnudeKfTsP4G/phi+PFPdVCyvbCPVCfzC/ +1SwnbFOfc3HzjDqy61i1L44qDuEIXe2DKQqRvKOcWcUjiHM5/v+oGaqTrzINmvMA +XoGVOoniX+yu/7XfbhKbybw= +=SzXS +-----END PGP MESSAGE----- + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4D16Pe22XLHvsSAQdALlp3UOL9wBsSRF3uIEH5imchVNuITE2KqoJdMtKRq1Ew ++1jecnPqy2r3gsk2ixXt53R/oqyleCaCa05WwQH2jvOlJBLYDSaG0nvPTXGYhFD1 +hF4DTxRYvSK3u1MSAQdAxmUBg1MOvPSKFfVE5UraFUX5hzEIOo/IBxoGt6mfTC4w +DihowFXP5XlePFtr3z7M/R00Wkmw/TAa+fukqjLTFrYIuacQW1gTiEYfOOif8V4d +0k0BBHpU9I+AK/yYkkSdhW3C4JowbvOYvOFFtq5z+2/4jrZGgGmiydLBQ+ASCJTW +5LoxisOo1ZWXU5GyhEsUfGWomTmIqdHPr6QOxEZmDw== +=jl09 +-----END PGP MESSAGE----- + +------=_Part_0_233169424.1639223054262-- diff --git a/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_missing_pub_key_encrypted_signed.txt b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_missing_pub_key_encrypted_signed.txt new file mode 100644 index 0000000000..faa40dba21 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_missing_pub_key_encrypted_signed.txt @@ -0,0 +1,39 @@ +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id KrPbA9hLt2FtDgAAc/RpdQ + (envelope-from ) + for ; Mon, 13 Dec 2021 13:34:16 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 0C05F84061C + for ; Mon, 13 Dec 2021 13:34:16 +0000 (UTC) +Date: Mon, 13 Dec 2021 15:34:13 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <176319358.1.1639402453750@flowcrypt.test> +Subject: Encrypted + signed(inband) + no pub key +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_123085323.1639402453729" + +------=_Part_0_123085323.1639402453729 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4DTxRYvSK3u1MSAQdAtdnv+F2LD9GVA09dGxdtNXp9XOUNildn0KoRRyfS71Yw +oz40WsLIOFiq24WAnkZaig3mh3ZIZPH30CpNG6D50xJgH87vhlHr8KMc/UKCD8HT +hF4D16Pe22XLHvsSAQdAdmfEzaR46pX8T/DSVrKmGPlxKWaS/GYPCJbHwa1/8hsw +QpKP7zTwoRGg+OC01wgviQjaHehQ5PHCcgF92js19ipqeK0nZ6NumYBhuReeTn0j +0sBPATC6XlUcftJVv3oydls4C8Mpu+KK+fFvsgaZY5QeoLttl07GfRQMqPhpb6wb +5sEKrS0QTpxzAth07Ow22cETz+BYbxkVmbube82CBNwkiv8jF05expxtLdAUTSc4 +p9/hKUSFAXP/a4x5ce7ImZ8IeBftDfD1UjCvL/vPqhGfuPg/ObAPAIk4vs6K8yGW +0ub67smJCF6x3rTeYWJHtZA2w3aYX332klhyWWyyvq4EhfkViNCbch0gkBvrqxd0 +hIoSRW4Tg/SzbTNbwvoojwB4Qn/NKj6tG+/NCXsNoCaAW24oCpJC+J5CUUbHVH3O +Ru2kYMZ0/G0F3zplBJ+UdNl3edCVuOsYKosqA251SpbBhw== +=52uO +-----END PGP MESSAGE----- +------=_Part_0_123085323.1639402453729-- diff --git a/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_missing_pub_key_only_signed.txt b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_missing_pub_key_only_signed.txt new file mode 100644 index 0000000000..3fff000586 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_missing_pub_key_only_signed.txt @@ -0,0 +1,34 @@ +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id 7nTaL3JMt2EwEQAAc/RpdQ + (envelope-from ) + for ; Mon, 13 Dec 2021 13:36:50 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id C0AAD84061F + for ; Mon, 13 Dec 2021 13:36:50 +0000 (UTC) +Date: Mon, 13 Dec 2021 15:36:48 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <2967984.1.1639402608568@flowcrypt.test> +Subject: NOT encrypted + signed(inband) + no pub key +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_15474263.1639402608553" + +------=_Part_0_15474263.1639402608553 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCX2jaFz8aOWw08ZT6cnMYCAZ4l6sUKiQlFqemlOYpFCbmpxcWJ6qkJJ +RmKJQnlisUJxZnpeaopCeWZJBlBZeVF+XrpCQVFmWWJJqkJ2aqWeQnBqXkpqkUJi +XgpELZBZlKqQkpmWllqUmlei11HKwiDGxcDGypS4pfkigyKnAMwNYoosHXsObGz8 +luG6RyfyAkx4oz8jw8yK2S9W5S19cGL2MsGt7+3eVS0MPiv4Zp367xdLbDUKb0xn ++O+T+pZxU/QMpfK1GqsbxbL2eXkEq9kvZjlr4FvM3tH7kBEA +=BWVd +-----END PGP MESSAGE----- +------=_Part_0_15474263.1639402608553-- diff --git a/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_encrypted.txt b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_encrypted.txt new file mode 100644 index 0000000000..ecb7f90546 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_encrypted.txt @@ -0,0 +1,36 @@ +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id F6uPOgJos2GyAwAAc/RpdQ + (envelope-from ) + for ; Fri, 10 Dec 2021 14:45:22 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id EC1CC6C1E67 + for ; Fri, 10 Dec 2021 14:45:22 +0000 (UTC) +Date: Fri, 10 Dec 2021 16:44:37 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <36760296.1.1639147477268@flowcrypt.test> +Subject: Encrypted + NOT signed +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_143475953.1639147477209" + +------=_Part_0_143475953.1639147477209 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +hF4D16Pe22XLHvsSAQdApkbDtf6GMhbUdIG8lbA1xVidfOw1xw90yYMKSeUd1lMw +HIPCm32G4OnJFEgSodLZGIjLXAR98YlPANHx8CI12avC5FzWQrbhegmdhnHzw/Ti +hF4DTxRYvSK3u1MSAQdAur1cw4tCsoeoQm4vzslmw+Nr57fIj0rkhhzVnaM/IBYw +MGUnTXLXmjvVnGKb5XZHmpkybOFMtXrZKvddQfJ+uY5BAevGDCCLeJySGceMbDta +0k0B7jC+C2ZeZdJzFcvzhotQDWSM2YOvRNKA0BkMyVsJabUKY1xExidzBQnK5HSp +Ru9HZjZJZTsBnbji9GwvfvgMXlc9LxP53hLdW6lszA== +=xJjg +-----END PGP MESSAGE----- + +------=_Part_0_143475953.1639147477209-- diff --git a/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_signed.txt b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_signed.txt new file mode 100644 index 0000000000..8d03dc4a1b --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_signed.txt @@ -0,0 +1,34 @@ +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id Mv2+B99os2GuBwAAc/RpdQ + (envelope-from ) + for ; Fri, 10 Dec 2021 14:49:03 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 1C4DA6C1E68 + for ; Fri, 10 Dec 2021 14:49:03 +0000 (UTC) +Date: Fri, 10 Dec 2021 16:49:00 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <124374216.1.1639147740952@flowcrypt.test> +Subject: NOT encrypted + signed(Inband) +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_176969482.1639147740896" + +------=_Part_0_176969482.1639147740896 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCV2WKHzbNaPa+cYT2skMYCAZ4l6sUJxZnpeaoqChmdeUmJeiqZCfl5O +pUJuanFxYnqqXkcpC4MYFwMbK1Pi5ow7DIqcAjBDxBRZDqZoXGM8bWneeT7xCkz4 +7ENGhitGLy5tuiSTY85ues+ItWT7wT2CITKucV8OHVkQ9ePp+xSG/2W/Nm2fzvZ0 ++k4VL8PMqSYF12u0TkrKFsRfvRAooudkzgQA +=c6F0 +-----END PGP MESSAGE----- + +------=_Part_0_176969482.1639147740896-- diff --git a/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_signed_mixed.txt b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_signed_mixed.txt new file mode 100644 index 0000000000..5cac1e9a50 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_signed_mixed.txt @@ -0,0 +1,43 @@ +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id Q6lDHJTqtmGyDgAAc/RpdQ + (envelope-from ) + for ; Mon, 13 Dec 2021 06:39:16 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 708E07E22DC + for ; Mon, 13 Dec 2021 06:39:16 +0000 (UTC) +Date: Sat, 11 Dec 2021 14:54:18 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <178316538.1.1639227258998@flowcrypt.test> +Subject: NOT encrypted + signed mixed(inband) +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_254081431.1639227258976" + +------=_Part_0_254081431.1639227258976 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCV2WKHzbNaPa+cYT8snMYBAcGZ6XmqKQnlmSYZCokJBUWZuYlGlQnZq +ZUcpC4MYFwMbK1Pi1uf+DIqcAjC9YoosB1M0rjGetjTvPJ94BSZsw8vwV2r5jx3K +D09YX2YxmXdpntcL7iO8J4vT5asfPUv6f+iMRDojwyG9s+lHxOMUJ60VP6tl/sjr +Kedlni+bmO2MptWmXQj0YQMA +=usCN +-----END PGP MESSAGE----- + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCXWaL/vvdiErcGMpxWSGEAgODM9LzVFoTyzJEOhJCNVoTg1OT8vRSE7 +tbKjlIVBjIuBjZUpcevzDwyKnAIwzWKKLHfMHwmFMAmaprieNocJp/Uy/A/MjTzK +N9UkpXLTg0dXFFasM5wQxT93ufHj+o9hhzuO97YxMlwwsG+6lNHn4xkilcwbmmhx +/ernRzJH7rFaPLM7d/zlHj4A +=Yz2p +-----END PGP MESSAGE----- +------=_Part_0_254081431.1639227258976-- diff --git a/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_signed_partially.txt b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_signed_partially.txt new file mode 100644 index 0000000000..2854dbd7c5 --- /dev/null +++ b/FlowCrypt/src/androidTest/assets/messages/mime/signature_verification_inband_only_signed_partially.txt @@ -0,0 +1,36 @@ +Return-Path: +Delivered-To: default@flowcrypt.test +Received: from mail.flowcrypt.test + by mail.flowcrypt.test with LMTP + id bfJgJ8ePtGHDCAAAc/RpdQ + (envelope-from ) + for ; Sat, 11 Dec 2021 11:47:19 +0000 +Received: from localhost (localhost [127.0.0.1]) + by mail.flowcrypt.test (Postfix) with ESMTP id 9DF3F7E0A69 + for ; Sat, 11 Dec 2021 11:47:19 +0000 (UTC) +Date: Sat, 11 Dec 2021 13:47:17 +0200 (GMT+02:00) +From: denbond7@flowcrypt.test +To: default@flowcrypt.test +Message-ID: <134516345.1.1639223237410@flowcrypt.test> +Subject: NOT encrypted + signed partially(inband) +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_104860116.1639223237396" + +------=_Part_0_104860116.1639223237396 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +Some plain text + +-----BEGIN PGP MESSAGE----- +Version: PGPainless + +owGbwMvMwCV2WKHzbNaPa+cYT0smMYCAf15OpUJxZnpeaopCbmpxcWJ6akcpC4MY +FwMbK1Pilt7tDIqcAjBdYoosB1M0rjGetjTvPJ94BSZ8iZmR4cTMG9aGhvM/T7z3 +ceaf7VPS4l55x0m3eXiIXqm71HX8sQcjw7/JfNKsbvpM+sH6siuTFmrfPrjCsp+J +VTNI6HmdjMpMVgA= +=4Gih +-----END PGP MESSAGE----- + +------=_Part_0_104860116.1639223237396-- diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/CustomMatchers.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/CustomMatchers.kt index c823c27236..61cab3ee61 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/CustomMatchers.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/CustomMatchers.kt @@ -7,9 +7,11 @@ package com.flowcrypt.email.matchers import android.view.View import android.widget.ListView +import androidx.recyclerview.widget.RecyclerView import androidx.test.espresso.Root import androidx.test.espresso.matcher.BoundedMatcher import com.flowcrypt.email.api.email.model.SecurityType +import com.flowcrypt.email.ui.adapter.PgpBadgeListAdapter import com.flowcrypt.email.ui.widget.PGPContactChipSpan import com.google.android.material.appbar.AppBarLayout import com.hootsuite.nachos.NachoTextView @@ -106,6 +108,10 @@ class CustomMatchers { return NachoTextViewChipBackgroundColorMatcher(chipText, backgroundColor) } + fun withPgpBadge(pgpBadge: PgpBadgeListAdapter.PgpBadge): PgpBadgeMatcher { + return PgpBadgeMatcher(pgpBadge) + } + fun isToast(): BaseMatcher { return ToastMatcher() } diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/PgpBadgeMatcher.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/PgpBadgeMatcher.kt new file mode 100644 index 0000000000..04d4ef0004 --- /dev/null +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/PgpBadgeMatcher.kt @@ -0,0 +1,30 @@ +/* + * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com + * Contributors: DenBond7 + */ + +package com.flowcrypt.email.matchers + +import androidx.recyclerview.widget.RecyclerView +import androidx.test.espresso.matcher.BoundedMatcher +import com.flowcrypt.email.ui.adapter.PgpBadgeListAdapter +import org.hamcrest.Description + +/** + * @author Denis Bondarenko + * Date: 12/14/21 + * Time: 10:33 AM + * E-mail: DenBond7@gmail.com + */ +class PgpBadgeMatcher(private val pgpBadge: PgpBadgeListAdapter.PgpBadge) : + BoundedMatcher( + PgpBadgeListAdapter.ViewHolder::class.java + ) { + override fun matchesSafely(holder: PgpBadgeListAdapter.ViewHolder): Boolean { + return holder.badgeType == pgpBadge.type + } + + override fun describeTo(description: Description) { + description.appendText("with: $pgpBadge") + } +} diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt index 37e4801269..2e620eab1d 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/activity/MessageDetailsActivityTest.kt @@ -44,6 +44,8 @@ import com.flowcrypt.email.junit.annotations.NotReadyForCI import com.flowcrypt.email.matchers.CustomMatchers import com.flowcrypt.email.matchers.CustomMatchers.Companion.withDrawable import com.flowcrypt.email.matchers.CustomMatchers.Companion.withEmptyRecyclerView +import com.flowcrypt.email.matchers.CustomMatchers.Companion.withPgpBadge +import com.flowcrypt.email.matchers.CustomMatchers.Companion.withRecyclerViewItemCount import com.flowcrypt.email.model.KeyImportDetails import com.flowcrypt.email.rules.AddPrivateKeyToDatabaseRule import com.flowcrypt.email.rules.ClearAppSettingsRule @@ -51,6 +53,7 @@ import com.flowcrypt.email.rules.RetryRule import com.flowcrypt.email.rules.ScreenshotTestRule import com.flowcrypt.email.ui.activity.base.BaseMessageDetailsActivityTest import com.flowcrypt.email.ui.adapter.MsgDetailsRecyclerViewAdapter +import com.flowcrypt.email.ui.adapter.PgpBadgeListAdapter import com.flowcrypt.email.util.DateTimeUtil import com.flowcrypt.email.util.GeneralUtil import com.flowcrypt.email.util.PrivateKeysManager @@ -453,7 +456,7 @@ class MessageDetailsActivityTest : BaseMessageDetailsActivityTest() { .perform(scrollTo(), click()) onView(withId(R.id.rVMsgDetails)) .check(matches(isDisplayed())) - .check(matches(CustomMatchers.withRecyclerViewItemCount(5))) + .check(matches(withRecyclerViewItemCount(5))) onView(withId(R.id.rVMsgDetails)) .perform( @@ -630,6 +633,153 @@ class MessageDetailsActivityTest : BaseMessageDetailsActivityTest() { .check(matches(not(isDisplayed()))) } + @Test + fun testSignatureVerificationInbandMissingPubKeyEncryptedAndSigned() { + val msgInfo = getMsgInfo( + "messages/info/signature_verification_inband_missing_pub_key_encrypted_signed.json", + "messages/mime/signature_verification_inband_missing_pub_key_encrypted_signed.txt" + ) + baseCheck(msgInfo) + + testPgpBadges( + 2, + PgpBadgeListAdapter.PgpBadge.Type.ENCRYPTED, + PgpBadgeListAdapter.PgpBadge.Type.CAN_NOT_VERIFY_SIGNATURE + ) + } + + @Test + fun testSignatureVerificationInbandMissingPubKeyOnlySigned() { + val msgInfo = getMsgInfo( + "messages/info/signature_verification_inband_missing_pub_key_only_signed.json", + "messages/mime/signature_verification_inband_missing_pub_key_only_signed.txt" + ) + baseCheck(msgInfo) + + testPgpBadges( + 2, + PgpBadgeListAdapter.PgpBadge.Type.NOT_ENCRYPTED, + PgpBadgeListAdapter.PgpBadge.Type.CAN_NOT_VERIFY_SIGNATURE + ) + } + + @Test + fun testSignatureVerificationInbandOnlySignedMixed() { + PrivateKeysManager.savePubKeyToDatabase("pgp/denbond7@flowcrypt.test_pub_primary.asc") + PrivateKeysManager.savePubKeyToDatabase("pgp/denbond7@flowcrypt.test_pub_second.asc") + val msgInfo = getMsgInfo( + "messages/info/signature_verification_inband_only_signed_mixed.json", + "messages/mime/signature_verification_inband_only_signed_mixed.txt" + ) + baseCheck(msgInfo) + + testPgpBadges( + 2, + PgpBadgeListAdapter.PgpBadge.Type.NOT_ENCRYPTED, + PgpBadgeListAdapter.PgpBadge.Type.MIXED_SIGNED + ) + } + + @Test + fun testSignatureVerificationInbandEncryptedAndSignedMixed() { + PrivateKeysManager.savePubKeyToDatabase("pgp/denbond7@flowcrypt.test_pub_primary.asc") + PrivateKeysManager.savePubKeyToDatabase("pgp/denbond7@flowcrypt.test_pub_second.asc") + val msgInfo = getMsgInfo( + "messages/info/signature_verification_inband_encrypted_signed_mixed.json", + "messages/mime/signature_verification_inband_encrypted_signed_mixed.txt" + ) + baseCheck(msgInfo) + + testPgpBadges( + 2, + PgpBadgeListAdapter.PgpBadge.Type.ENCRYPTED, + PgpBadgeListAdapter.PgpBadge.Type.MIXED_SIGNED + ) + } + + @Test + fun testSignatureVerificationInbandOnlySignedPartially() { + PrivateKeysManager.savePubKeyToDatabase("pgp/denbond7@flowcrypt.test_pub_primary.asc") + + val msgInfo = getMsgInfo( + "messages/info/signature_verification_inband_only_signed_partially.json", + "messages/mime/signature_verification_inband_only_signed_partially.txt" + ) + baseCheck(msgInfo) + + testPgpBadges( + 2, + PgpBadgeListAdapter.PgpBadge.Type.NOT_ENCRYPTED, + PgpBadgeListAdapter.PgpBadge.Type.ONLY_PARTIALLY_SIGNED + ) + } + + @Test + fun testSignatureVerificationInbandEncryptedSignedPartially() { + PrivateKeysManager.savePubKeyToDatabase("pgp/denbond7@flowcrypt.test_pub_primary.asc") + + val msgInfo = getMsgInfo( + "messages/info/signature_verification_inband_encrypted_signed_partially.json", + "messages/mime/signature_verification_inband_encrypted_signed_partially.txt" + ) + baseCheck(msgInfo) + + testPgpBadges( + 2, + PgpBadgeListAdapter.PgpBadge.Type.ENCRYPTED, + PgpBadgeListAdapter.PgpBadge.Type.ONLY_PARTIALLY_SIGNED + ) + } + + @Test + fun testSignatureVerificationInbandEncryptedSigned() { + PrivateKeysManager.savePubKeyToDatabase("pgp/denbond7@flowcrypt.test_pub_primary.asc") + + val msgInfo = getMsgInfo( + "messages/info/signature_verification_inband_encrypted_signed.json", + "messages/mime/signature_verification_inband_encrypted_signed.txt" + ) + baseCheck(msgInfo) + + testPgpBadges( + 2, + PgpBadgeListAdapter.PgpBadge.Type.ENCRYPTED, + PgpBadgeListAdapter.PgpBadge.Type.SIGNED + ) + } + + @Test + fun testSignatureVerificationInbandOnlySigned() { + PrivateKeysManager.savePubKeyToDatabase("pgp/denbond7@flowcrypt.test_pub_primary.asc") + + val msgInfo = getMsgInfo( + "messages/info/signature_verification_inband_only_signed.json", + "messages/mime/signature_verification_inband_only_signed.txt" + ) + baseCheck(msgInfo) + + testPgpBadges( + 2, + PgpBadgeListAdapter.PgpBadge.Type.NOT_ENCRYPTED, + PgpBadgeListAdapter.PgpBadge.Type.SIGNED + ) + } + + @Test + fun testSignatureVerificationInbandOnlyEncrypted() { + val msgInfo = getMsgInfo( + "messages/info/signature_verification_inband_only_encrypted.json", + "messages/mime/signature_verification_inband_only_encrypted.txt" + ) + baseCheck(msgInfo) + + testPgpBadges( + 2, + PgpBadgeListAdapter.PgpBadge.Type.ENCRYPTED, + PgpBadgeListAdapter.PgpBadge.Type.NOT_SIGNED + ) + } + private fun testMissingKey(incomingMsgInfo: IncomingMessageInfo?) { assertThat(incomingMsgInfo, notNullValue()) @@ -793,4 +943,15 @@ class MessageDetailsActivityTest : BaseMessageDetailsActivityTest() { } } } + + private fun testPgpBadges(badgeCount: Int, vararg badgeTypes: PgpBadgeListAdapter.PgpBadge.Type) { + onView(withId(R.id.rVPgpBadges)) + .check(matches(withRecyclerViewItemCount(badgeCount))) + + + for (badgeType in badgeTypes) { + onView(withId(R.id.rVPgpBadges)) + .perform(scrollToHolder(withPgpBadge(PgpBadgeListAdapter.PgpBadge(badgeType)))) + } + } } diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/util/PrivateKeysManager.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/util/PrivateKeysManager.kt index 103278e2c6..a7832d7c8a 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/util/PrivateKeysManager.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/util/PrivateKeysManager.kt @@ -64,6 +64,22 @@ class PrivateKeysManager { Thread.sleep(3000) } + fun savePubKeyToDatabase(assetsPath: String) { + savePubKeyToDatabase(getPgpKeyDetailsFromAssets(assetsPath)) + } + + fun savePubKeyToDatabase(pgpKeyDetails: PgpKeyDetails) { + val context = InstrumentationRegistry.getInstrumentation().targetContext + val email = requireNotNull(pgpKeyDetails.getPrimaryInternetAddress()).address.lowercase() + val roomDatabase = FlowCryptRoomDatabase.getDatabase(context) + if (roomDatabase.recipientDao().getRecipientByEmail(email) == null) { + roomDatabase.recipientDao().insert(requireNotNull(pgpKeyDetails.toRecipientEntity())) + } + roomDatabase.pubKeyDao().insert(pgpKeyDetails.toPublicKeyEntity(email)) + // Added timeout for a better sync between threads. + Thread.sleep(500) + } + fun getPgpKeyDetailsFromAssets( assetsPath: String, onlyPrivate: Boolean = false diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/adapter/PgpBadgeListAdapter.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/adapter/PgpBadgeListAdapter.kt index 4e41f6047b..666151f36d 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/adapter/PgpBadgeListAdapter.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/adapter/PgpBadgeListAdapter.kt @@ -39,8 +39,10 @@ class PgpBadgeListAdapter : ListAdapter Date: Wed, 15 Dec 2021 10:35:07 +0200 Subject: [PATCH 12/12] Refactored code.| #1097 --- .../api/retrofit/response/model/MsgBlock.kt | 4 +- .../security/pgp/PgpDecryptAndOrVerify.kt | 12 +-- .../flowcrypt/email/security/pgp/PgpMsg.kt | 97 +++++++++---------- .../email/security/pgp/PgpSignature.kt | 4 +- .../AttachmentDownloadManagerService.kt | 2 +- .../security/pgp/PgpDecryptAndOrVerifyTest.kt | 6 +- .../email/security/pgp/PgpMsgTest.kt | 34 +++---- 7 files changed, 76 insertions(+), 83 deletions(-) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/MsgBlock.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/MsgBlock.kt index 0ec4444210..dd9c3270c1 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/MsgBlock.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/response/model/MsgBlock.kt @@ -108,7 +108,9 @@ interface MsgBlock : Parcelable { PUBLIC_KEY, PRIVATE_KEY, SIGNED_MSG, ENCRYPTED_MSG ) - val SIGNED_BLOCK_TYPES = setOf(SIGNED_TEXT, SIGNED_HTML, SIGNED_MSG) + val SIGNED_BLOCK_TYPES = setOf( + SIGNED_TEXT, SIGNED_HTML, SIGNED_MSG, DECRYPTED_AND_OR_SIGNED_CONTENT + ) val CONTENT_BLOCK_TYPES = setOf( PLAIN_TEXT, diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerify.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerify.kt index 7d45e7a0c9..fe690b1efc 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerify.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerify.kt @@ -40,7 +40,7 @@ object PgpDecryptAndOrVerify { fun decrypt( srcInputStream: InputStream, destOutputStream: OutputStream, - pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, + secretKeys: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): OpenPgpMetadata { srcInputStream.use { srcStream -> @@ -50,7 +50,7 @@ object PgpDecryptAndOrVerify { .onInputStream(srcStream) .withOptions( ConsumerOptions() - .addDecryptionKeys(pgpSecretKeyRingCollection, protector) + .addDecryptionKeys(secretKeys, protector) .setMissingKeyPassphraseStrategy(MissingKeyPassphraseStrategy.THROW_EXCEPTION) ) decryptionStream.use { it.copyTo(outStream) } @@ -64,8 +64,8 @@ object PgpDecryptAndOrVerify { fun decryptAndOrVerifyWithResult( srcInputStream: InputStream, - pgpPublicKeyRingCollection: PGPPublicKeyRingCollection, - pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, + publicKeys: PGPPublicKeyRingCollection, + secretKeys: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector, ignoreMdcErrors: Boolean = false ): DecryptionResult { @@ -77,10 +77,10 @@ object PgpDecryptAndOrVerify { .onInputStream(srcStream) .withOptions( ConsumerOptions() - .addDecryptionKeys(pgpSecretKeyRingCollection, protector) + .addDecryptionKeys(secretKeys, protector) .setMissingKeyPassphraseStrategy(MissingKeyPassphraseStrategy.THROW_EXCEPTION) .setIgnoreMDCErrors(ignoreMdcErrors) - .addVerificationCerts(pgpPublicKeyRingCollection) + .addVerificationCerts(publicKeys) ) decryptionStream.use { it.copyTo(outStream) } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt index ed41c50a56..8ebe6a6b3d 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpMsg.kt @@ -211,18 +211,18 @@ object PgpMsg { suspend fun processMimeMessage(context: Context, inputStream: InputStream): ProcessedMimeMessageResult = withContext(Dispatchers.IO) { val keysStorage = KeysStorageImpl.getInstance(context) - val pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keysStorage.getPGPSecretKeyRings()) + val accountSecretKeys = PGPSecretKeyRingCollection(keysStorage.getPGPSecretKeyRings()) val protector = keysStorage.getSecretKeyRingProtector() val msg = MimeMessage(Session.getInstance(Properties()), inputStream) - val keys = mutableListOf() + val verificationPublicKeys = mutableListOf() val pubKeyDao = FlowCryptRoomDatabase.getDatabase(context).pubKeyDao() for (address in msg.from) { if (address is InternetAddress) { val existingPubKeysInfo = pubKeyDao.getPublicKeysByRecipient(address.address.lowercase()) for (existingPublicKeyEntity in existingPubKeysInfo) { - keys.addAll( + verificationPublicKeys.addAll( //ask Tom about this place. Do we need to catch exception here or we can throw it PgpKey.parseKeys(source = existingPublicKeyEntity.publicKey) .pgpKeyRingCollection.pgpPublicKeyRingCollection @@ -233,37 +233,37 @@ object PgpMsg { return@withContext processMimeMessage( msg = msg, - pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(keys), - pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + verificationPublicKeys = PGPPublicKeyRingCollection(verificationPublicKeys), + secretKeys = accountSecretKeys, protector = protector ) } fun processMimeMessage( inputStream: InputStream, - pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, + secretKeys: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): ProcessedMimeMessageResult { return processMimeMessage( msg = MimeMessage(Session.getInstance(Properties()), inputStream), - pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + secretKeys = secretKeys, protector = protector ) } fun processMimeMessage( msg: MimeMessage, - pgpPublicKeyRingCollection: PGPPublicKeyRingCollection = PGPPublicKeyRingCollection(listOf()), - pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, + verificationPublicKeys: PGPPublicKeyRingCollection = PGPPublicKeyRingCollection(listOf()), + secretKeys: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): ProcessedMimeMessageResult { val extractedMimeContent = extractMimeContent(msg) val extractedMsgBlocks = extractMsgBlocks(extractedMimeContent) return processExtractedMsgBlocks( - extractedMsgBlocks, - pgpPublicKeyRingCollection, - pgpSecretKeyRingCollection, - protector + msgBlocks = extractedMsgBlocks, + verificationPublicKeys = verificationPublicKeys, + secretKeys = secretKeys, + protector = protector ) } @@ -800,14 +800,14 @@ object PgpMsg { private fun processExtractedMsgBlocks( msgBlocks: List, - pgpPublicKeyRingCollection: PGPPublicKeyRingCollection, - pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, + verificationPublicKeys: PGPPublicKeyRingCollection, + secretKeys: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): ProcessedMimeMessageResult { val sequentialProcessedBlocks = handleExtractedMsgBlocks( msgBlocks = msgBlocks, - pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, - pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + verificationPublicKeys = verificationPublicKeys, + secretKeys = secretKeys, protector = protector ) @@ -829,11 +829,7 @@ object PgpMsg { // So, at least meanwhile, not porting this: // block.content = isContentBlock(block.type) // ? block.content.toUtfStr() : block.content.toRawBytesStr(); - if (block.type in listOf( - MsgBlock.Type.SIGNED_MSG, - MsgBlock.Type.DECRYPTED_AND_OR_SIGNED_CONTENT - ) - ) { + if (block.type in MsgBlock.Type.SIGNED_BLOCK_TYPES) { val openPgpMetadata = when (block) { is DecryptedAndOrSignedContentMsgBlock -> { block.openPgpMetadata @@ -873,9 +869,11 @@ object PgpMsg { if (verifiedSignatures.isEmpty()) { verifiedSignatures.putAll(openPgpMetadata.verifiedSignatures) } else { - val bufferedKeysIds = verifiedSignatures.keys.map { it.keyId } - val iteratedKeysIds = openPgpMetadata.verifiedSignatures.keys.map { it.keyId } - if (bufferedKeysIds != iteratedKeysIds) { + val keyIdsOfAllVerifiedSignatures = verifiedSignatures.keys.map { it.keyId } + val keyIdsOfCurrentVerifiedSignatures = openPgpMetadata.verifiedSignatures.keys.map { + it.keyId + } + if (keyIdsOfAllVerifiedSignatures != keyIdsOfCurrentVerifiedSignatures) { hasMixedSignatures = true verifiedSignatures.putAll(openPgpMetadata.verifiedSignatures) } @@ -921,27 +919,20 @@ object PgpMsg { ) } - private fun canBeAddedToCombinedContent(block: MsgBlock): Boolean { - return when { - block.type.isContentBlockType() || MimeUtils.isPlainImgAtt(block) -> { - block.error == null - } - - else -> false - } - } + private fun canBeAddedToCombinedContent(block: MsgBlock): Boolean = + (block.type.isContentBlockType() || MimeUtils.isPlainImgAtt(block)) && block.error == null private fun handleExtractedMsgBlocks( msgBlocks: List, - pgpPublicKeyRingCollection: PGPPublicKeyRingCollection, - pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, + verificationPublicKeys: PGPPublicKeyRingCollection, + secretKeys: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): MutableList { val sequentialProcessedBlocks = mutableListOf() for (msgBlock in msgBlocks) { when { msgBlock is SignedMsgBlock -> { - processSignedMsgBlock(msgBlock, pgpPublicKeyRingCollection)?.let { + processSignedMsgBlock(msgBlock, verificationPublicKeys)?.let { sequentialProcessedBlocks.add(it) } } @@ -949,8 +940,8 @@ object PgpMsg { msgBlock.type == MsgBlock.Type.ENCRYPTED_MSG -> { val decryptedContentMsgBlock = processEncryptedMsgBlock( msgBlock = msgBlock, - pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, - pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + verificationPublicKeys = verificationPublicKeys, + secretKeys = secretKeys, protector = protector ) sequentialProcessedBlocks.add(decryptedContentMsgBlock) @@ -962,8 +953,8 @@ object PgpMsg { sequentialProcessedBlocks.add( processPublicKeyMsgBlock( msgBlock = msgBlock, - pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, - pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + verificationPublicKeys = verificationPublicKeys, + secretKeys = secretKeys, protector = protector ) ) @@ -1011,15 +1002,15 @@ object PgpMsg { private fun processPublicKeyMsgBlock( msgBlock: MsgBlock, - pgpPublicKeyRingCollection: PGPPublicKeyRingCollection, - pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, + verificationPublicKeys: PGPPublicKeyRingCollection, + secretKeys: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): MsgBlock { // encrypted public key attached val decryptionResult = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( srcInputStream = msgBlock.content?.toInputStream()!!, - pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, - pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + publicKeys = verificationPublicKeys, + secretKeys = secretKeys, protector = protector ) return if (decryptionResult.content != null) { @@ -1033,14 +1024,14 @@ object PgpMsg { private fun processEncryptedMsgBlock( msgBlock: MsgBlock, - pgpPublicKeyRingCollection: PGPPublicKeyRingCollection, - pgpSecretKeyRingCollection: PGPSecretKeyRingCollection, + verificationPublicKeys: PGPPublicKeyRingCollection, + secretKeys: PGPSecretKeyRingCollection, protector: SecretKeyRingProtector ): DecryptedAndOrSignedContentMsgBlock { val decryptionResult = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( srcInputStream = msgBlock.content?.toInputStream()!!, - pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, - pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + publicKeys = verificationPublicKeys, + secretKeys = secretKeys, protector = protector ) @@ -1076,8 +1067,8 @@ object PgpMsg { if (PgpDecryptAndOrVerify.DecryptionErrorType.NO_MDC == decryptionResult.exception.decryptionErrorType) { val resultWithIgnoredMDCErrors = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( srcInputStream = msgBlock.content?.toInputStream()!!, - pgpPublicKeyRingCollection = pgpPublicKeyRingCollection, - pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + publicKeys = verificationPublicKeys, + secretKeys = secretKeys, protector = protector, ignoreMdcErrors = true ) @@ -1114,7 +1105,7 @@ object PgpMsg { private fun processSignedMsgBlock( msgBlock: SignedMsgBlock, - pgpPublicKeyRingCollection: PGPPublicKeyRingCollection + verificationPublicKeys: PGPPublicKeyRingCollection ): MsgBlock? { return when { msgBlock.signature != null -> { @@ -1153,7 +1144,7 @@ object PgpMsg { return try { val clearTextVerificationResult = PgpSignature.verifyClearTextSignature( srcInputStream = requireNotNull(msgBlock.content?.toInputStream()), - pgpPublicKeyRingCollection = pgpPublicKeyRingCollection + publicKeys = verificationPublicKeys ) clearTextVerificationResult.exception?.let { throw it } msgBlock.copy(content = clearTextVerificationResult.clearText) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpSignature.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpSignature.kt index 77ea6e1feb..4e940cd948 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpSignature.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/security/pgp/PgpSignature.kt @@ -49,14 +49,14 @@ object PgpSignature { fun verifyClearTextSignature( srcInputStream: InputStream, - pgpPublicKeyRingCollection: PGPPublicKeyRingCollection + publicKeys: PGPPublicKeyRingCollection ): ClearTextVerificationResult { ByteArrayOutputStream().use { outStream -> return try { val verificationStream = PGPainless.verifyCleartextSignedMessage() .onInputStream(srcInputStream) .withStrategy(InMemoryMultiPassStrategy()) - .withOptions(ConsumerOptions().addVerificationCerts(pgpPublicKeyRingCollection)) + .withOptions(ConsumerOptions().addVerificationCerts(publicKeys)) .verificationStream verificationStream.use { it.copyTo(outStream) } diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentDownloadManagerService.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentDownloadManagerService.kt index 9a1d84e252..4304d62f3c 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentDownloadManagerService.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/service/attachment/AttachmentDownloadManagerService.kt @@ -676,7 +676,7 @@ class AttachmentDownloadManagerService : Service() { val result = PgpDecryptAndOrVerify.decrypt( srcInputStream = inputStream, destOutputStream = decryptedFile.outputStream(), - pgpSecretKeyRingCollection = pgpSecretKeyRingCollection, + secretKeys = pgpSecretKeyRingCollection, protector = protector ) diff --git a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerifyTest.kt b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerifyTest.kt index 2cfe6cc99c..d205601dce 100644 --- a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerifyTest.kt +++ b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpDecryptAndOrVerifyTest.kt @@ -82,7 +82,7 @@ class PgpDecryptAndOrVerifyTest { PgpDecryptAndOrVerify.decrypt( srcInputStream = ByteArrayInputStream(encryptedBytes), destOutputStream = outputStreamWithDecryptedData, - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(listOf(randomKey)), + secretKeys = PGPSecretKeyRingCollection(listOf(randomKey)), protector = PasswordBasedSecretKeyRingProtector.forKey( randomKey, Passphrase.fromPassword("qwerty") @@ -119,7 +119,7 @@ class PgpDecryptAndOrVerifyTest { PgpDecryptAndOrVerify.decrypt( srcInputStream = ByteArrayInputStream(encryptedBytes), destOutputStream = outputStreamWithDecryptedData, - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(listOf(receiverPGPSecretKeyRing)), + secretKeys = PGPSecretKeyRingCollection(listOf(receiverPGPSecretKeyRing)), protector = PasswordBasedSecretKeyRingProtector.forKey( receiverPGPSecretKeyRing, Passphrase.fromPassword(UUID.randomUUID().toString()) @@ -199,7 +199,7 @@ class PgpDecryptAndOrVerifyTest { PgpDecryptAndOrVerify.decrypt( srcInputStream = ByteArrayInputStream(encryptedBytes), destOutputStream = outputStreamWithDecryptedData, - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(listOf(receiverPGPSecretKeyRing)), + secretKeys = PGPSecretKeyRingCollection(listOf(receiverPGPSecretKeyRing)), protector = allPredefinedKeysProtector ) diff --git a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt index 302d1f5537..d7540aaae0 100644 --- a/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt +++ b/FlowCrypt/src/test/java/com/flowcrypt/email/security/pgp/PgpMsgTest.kt @@ -227,8 +227,8 @@ class PgpMsgTest { } val r = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( srcInputStream = messageInfo.armored.byteInputStream(), - pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(privateKeysWithWrongPassPhrases.map { it.keyRing }), + publicKeys = PGPPublicKeyRingCollection(emptyList()), + secretKeys = PGPSecretKeyRingCollection(privateKeysWithWrongPassPhrases.map { it.keyRing }), protector = SecretKeyRingProtector.unprotectedKeys() ) assertTrue("Message returned", r.content == null) @@ -244,8 +244,8 @@ class PgpMsgTest { val messageInfo = findMessage("decrypt - without a subject") val r = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( srcInputStream = messageInfo.armored.byteInputStream(), - pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(PRIVATE_KEYS.map { it.keyRing }), + publicKeys = PGPPublicKeyRingCollection(emptyList()), + secretKeys = PGPSecretKeyRingCollection(PRIVATE_KEYS.map { it.keyRing }), protector = SecretKeyRingProtector.unprotectedKeys() ) assertTrue("Message returned", r.content == null) @@ -262,8 +262,8 @@ class PgpMsgTest { val wrongKey = listOf(PRIVATE_KEYS[1]) val r = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( messageInfo.armored.byteInputStream(), - pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(wrongKey.map { it.keyRing }), + publicKeys = PGPPublicKeyRingCollection(emptyList()), + secretKeys = PGPSecretKeyRingCollection(wrongKey.map { it.keyRing }), protector = SecretKeyRingProtector.unprotectedKeys() ) assertTrue("Message returned", r.content == null) @@ -294,8 +294,8 @@ class PgpMsgTest { val messageInfo = findMessage(messageKey) val result = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( messageInfo.armored.byteInputStream(), - pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(PRIVATE_KEYS.map { it.keyRing }), + publicKeys = PGPPublicKeyRingCollection(emptyList()), + secretKeys = PGPSecretKeyRingCollection(PRIVATE_KEYS.map { it.keyRing }), protector = secretKeyRingProtector ) if (result.content != null) { @@ -395,7 +395,7 @@ class PgpMsgTest { val keys = TestKeys.KEYS["rsa1"]!!.listOfKeysWithPassPhrase val result = PgpMsg.processMimeMessage( msg = MimeUtils.mimeTextToMimeMessage(mimeText), - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), + secretKeys = PGPSecretKeyRingCollection(keys.map { it.keyRing }), protector = SecretKeyRingProtector.unprotectedKeys() ) assertEquals(TEXT_SPECIAL_CHARS, result.text) @@ -419,7 +419,7 @@ class PgpMsgTest { val keys = TestKeys.KEYS["rsa1"]!!.listOfKeysWithPassPhrase val result = PgpMsg.processMimeMessage( msg = MimeUtils.mimeTextToMimeMessage(mimeText), - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), + secretKeys = PGPSecretKeyRingCollection(keys.map { it.keyRing }), protector = SecretKeyRingProtector.unprotectedKeys() ) assertEquals(TEXT_SPECIAL_CHARS, result.text) @@ -436,14 +436,14 @@ class PgpMsgTest { val keys = TestKeys.KEYS["rsa1"]!!.listOfKeysWithPassPhrase val decryptResult = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( srcInputStream = text.toInputStream(), - pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), + publicKeys = PGPPublicKeyRingCollection(emptyList()), + secretKeys = PGPSecretKeyRingCollection(keys.map { it.keyRing }), protector = TestKeys.genRingProtector(keys) ) assertEquals(true, decryptResult.isEncrypted) val result = PgpMsg.processMimeMessage( decryptResult.content?.toByteArray()?.inputStream()!!, - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), + secretKeys = PGPSecretKeyRingCollection(keys.map { it.keyRing }), protector = TestKeys.genRingProtector(keys) ) assertEquals(TEXT_SPECIAL_CHARS, result.text) @@ -460,8 +460,8 @@ class PgpMsgTest { val decryptResult = PgpDecryptAndOrVerify.decryptAndOrVerifyWithResult( text.toInputStream(), - pgpPublicKeyRingCollection = PGPPublicKeyRingCollection(emptyList()), - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), + publicKeys = PGPPublicKeyRingCollection(emptyList()), + secretKeys = PGPSecretKeyRingCollection(keys.map { it.keyRing }), protector = TestKeys.genRingProtector(keys) ) assertEquals(true, decryptResult.isEncrypted) @@ -474,7 +474,7 @@ class PgpMsgTest { val keys = TestKeys.KEYS["rsa1"]!!.listOfKeysWithPassPhrase val result = PgpMsg.processMimeMessage( text.toInputStream(), - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), + secretKeys = PGPSecretKeyRingCollection(keys.map { it.keyRing }), protector = SecretKeyRingProtector.unprotectedKeys() ) assertEquals("Below\n\n[image: image.png]\nAbove", result.text) @@ -506,7 +506,7 @@ class PgpMsgTest { val keys = TestKeys.KEYS["rsa1"]!!.listOfKeysWithPassPhrase val result = PgpMsg.processMimeMessage( text.toInputStream(), - pgpSecretKeyRingCollection = PGPSecretKeyRingCollection(keys.map { it.keyRing }), + secretKeys = PGPSecretKeyRingCollection(keys.map { it.keyRing }), protector = SecretKeyRingProtector.unprotectedKeys() ) val textContent = loadResourceAsString(