Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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\u003e33333\n\u003cbr\u003e\n\u003cbr\u003e\u003c/body\u003e\u003c/html\u003e\u003c/div\u003e\u003c!-- next MsgBlock --\u003e\n\u003c/body\u003e\n \u003c/html\u003e",
"type": "plainHtml"
},
{
"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": "EOFException: null"
},
"type": "publicKey"
}
],
"msgEntity": {
"cc": [],
"email": "default@flowcrypt.test",
"flags": "\\RECENT \\SEEN",
"folder": "INBOX",
"from": [
{
"address": "denbond7@flowcrypt.test"
}
],
"fromAddress": "denbond7@flowcrypt.test",
"hasAttachments": false,
"id": 26,
"isEncrypted": true,
"isNew": false,
"isSeen": true,
"msgState": "NONE",
"receivedDate": 1633527418000,
"replyTo": "denbond7@flowcrypt.test",
"replyToAddress": [
{
"address": "denbond7@flowcrypt.test"
}
],
"sentDate": 1633527415000,
"subject": "Parse an inline pub key error",
"to": [
{
"address": "default@flowcrypt.test"
}
],
"toAddress": "default@flowcrypt.test",
"uid": 25,
"uidAsHEX": "19"
},
"text": "33333"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Return-Path: <denbond7@flowcrypt.test>
Delivered-To: default@flowcrypt.test
Received: from mail.flowcrypt.test
by mail.flowcrypt.test with LMTP
id BYvqBnqmXWFvBgAAc/RpdQ
(envelope-from <denbond7@flowcrypt.test>)
for <default@flowcrypt.test>; Wed, 06 Oct 2021 13:36:58 +0000
Received: from localhost (localhost [127.0.0.1])
by mail.flowcrypt.test (Postfix) with ESMTP id 18F13223D7
for <default@flowcrypt.test>; Wed, 6 Oct 2021 13:36:58 +0000 (UTC)
Date: Wed, 6 Oct 2021 16:36:55 +0300 (GMT+03:00)
From: denbond7@flowcrypt.test
To: default@flowcrypt.test
Message-ID: <160641524.1.1633527415946@flowcrypt.test>
Subject: Parse an inline pub key error
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_0_65153003.1633527415907"

------=_Part_0_65153003.1633527415907
Content-Type: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tbAQsYl9sHNrTRG8n/t0f3bNiUiat6RpAnkH/bS/5dhfK1kAoNTew4q
1vvz5wOkwQQp+UQfl89iHTMryk8MwlDBWptSiMypIvsk+YlgepO/IsIjWAnDDtWv5cBBmBvkrKo4
xidzA04jrXAPR/WtKfIG6Efs+EAy++eloKz+GJHvL032gV8o9YdxqmJgtPXR5sG50+Tp5Av8jowC
OXcyWfQ0lWJujIAjdu6qXdyvEeNgE92mpRRD9Uf8nKRAUFG11sV8tsi8Yy+/EreQU9c1nYAMFomP
N1miKOdDe1PIWpnM3xZ6fom6AZuoJ0uQBkKE372HJV8vKQ1XNRXG479PGn2Fk8FsmC1R3cnlHzEv
oKCexpzYsECqMjaSs8GZU33xCUQbtp+Ar4dGBEStp+HlR90GjOtvwp+Dm92WH9rhCWxxlbDu5kFi
KstisSPdq7ph/bH+H18wxWNZEpUKR+Zq9Eyi9YnqRqun8pQp7A==
=D5N/
-----END PGP MESSAGE-----
------=_Part_0_65153003.1633527415907--
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class MessageDetailsActivityPassphraseInRamTest : BaseMessageDetailsActivityTest
.perform(click())

val decryptErrorMsgBlock = incomingMsgInfo.msgBlocks?.get(1) as DecryptErrorMsgBlock
val decryptError = decryptErrorMsgBlock.error!!
val decryptError = decryptErrorMsgBlock.decryptErr!!
assertEquals(PgpDecrypt.DecryptionErrorType.NEED_PASSPHRASE, decryptError.details?.type)

//check error message
Expand Down Expand Up @@ -164,7 +164,7 @@ class MessageDetailsActivityPassphraseInRamTest : BaseMessageDetailsActivityTest
launchActivity(incomingMsgInfo!!.msgEntity)

val decryptErrorMsgBlock = incomingMsgInfo.msgBlocks?.get(1) as DecryptErrorMsgBlock
val fingerprint = decryptErrorMsgBlock.error?.fingerprints?.first()
val fingerprint = decryptErrorMsgBlock.decryptErr?.fingerprints?.first()
val fingerprintFormatted = GeneralUtil.doSectionsInText(
originalString = fingerprint, groupSize = 4
)
Expand Down Expand Up @@ -297,7 +297,7 @@ class MessageDetailsActivityPassphraseInRamTest : BaseMessageDetailsActivityTest

val decryptErrorMsgBlock = incomingMsgInfo.msgBlocks?.get(1) as DecryptErrorMsgBlock
val expectedKeysCount = 2
assertEquals(expectedKeysCount, decryptErrorMsgBlock.error?.fingerprints?.size)
assertEquals(expectedKeysCount, decryptErrorMsgBlock.decryptErr?.fingerprints?.size)

val tVStatusMessageText = getQuantityString(
resId = R.plurals.please_provide_passphrase_for_following_keys,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class MessageDetailsActivityTest : BaseMessageDetailsActivityTest() {
matchHeader(msgInfo)

val block = msgInfo.msgBlocks?.get(1) as DecryptErrorMsgBlock
val decryptError = block.error
val decryptError = block.decryptErr
val formatErrorMsg = (getResString(
R.string.decrypt_error_message_badly_formatted,
getResString(R.string.app_name)
Expand Down Expand Up @@ -270,7 +270,7 @@ class MessageDetailsActivityTest : BaseMessageDetailsActivityTest() {
matchHeader(msgInfo)

val block = msgInfo.msgBlocks?.get(1) as DecryptErrorMsgBlock
val decryptError = block.error
val decryptError = block.decryptErr
val errorMsg = getResString(
R.string.could_not_decrypt_message_due_to_error,
decryptError?.details?.type.toString() + ": " + getResString(R.string.decrypt_error_message_no_mdc)
Expand Down Expand Up @@ -544,6 +544,30 @@ class MessageDetailsActivityTest : BaseMessageDetailsActivityTest() {
baseCheck(msgInfo)
}

@Test
fun testShowParsePubKeyError() {
val msgInfo = getMsgInfo(
"messages/info/encrypted_msg_inline_pub_key_parse_error.json",
"messages/mime/encrypted_msg_inline_pub_key_parse_error.txt"
) ?: throw NullPointerException()

assertThat(msgInfo, notNullValue())

val details = msgInfo.msgEntity

launchActivity(details)
matchHeader(msgInfo)

val block = msgInfo.msgBlocks?.get(1) as PublicKeyMsgBlock
val errorMsg = getResString(
R.string.msg_contains_not_valid_pub_key, requireNotNull(block.error?.errorMsg)
)
onView(withId(R.id.textViewErrorMessage))
.check(matches(withText(errorMsg)))
testSwitch(block.content ?: "")
matchReplyButtons(details)
}

private fun testMissingKey(incomingMsgInfo: IncomingMessageInfo?) {
assertThat(incomingMsgInfo, notNullValue())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import com.google.gson.annotations.SerializedName
data class DecryptErrorMsgBlock(
@Expose override val content: String?,
@Expose override val complete: Boolean,
@SerializedName("decryptErr") @Expose val error: DecryptError?
@SerializedName("decryptErr") @Expose val decryptErr: DecryptError?,
@Expose override val error: MsgBlockError? = null
) : MsgBlock {

@Expose
Expand All @@ -28,31 +29,28 @@ data class DecryptErrorMsgBlock(
constructor(source: Parcel) : this(
source.readString(),
1 == source.readInt(),
source.readParcelable<DecryptError>(DecryptError::class.java.classLoader)
source.readParcelable<DecryptError>(DecryptError::class.java.classLoader),
source.readParcelable(MsgBlockError::class.java.classLoader),
)

override fun describeContents(): Int {
return 0
}

override fun writeToParcel(dest: Parcel, flags: Int) =
with(dest) {
writeParcelable(type, flags)
writeString(content)
writeInt(if (complete) 1 else 0)
writeParcelable(error, flags)
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeParcelable(type, flags)
parcel.writeString(content)
parcel.writeByte(if (complete) 1 else 0)
parcel.writeParcelable(decryptErr, flags)
parcel.writeParcelable(error, flags)
}

companion object CREATOR : Parcelable.Creator<DecryptErrorMsgBlock> {
override fun createFromParcel(parcel: Parcel): DecryptErrorMsgBlock {
parcel.readParcelable<MsgBlock.Type>(MsgBlock.Type::class.java.classLoader)
return DecryptErrorMsgBlock(parcel)
}

companion object {
@JvmField
val CREATOR: Parcelable.Creator<DecryptErrorMsgBlock> =
object : Parcelable.Creator<DecryptErrorMsgBlock> {
override fun createFromParcel(source: Parcel): DecryptErrorMsgBlock {
source.readParcelable<MsgBlock.Type>(MsgBlock.Type::class.java.classLoader)
return DecryptErrorMsgBlock(source)
}

override fun newArray(size: Int): Array<DecryptErrorMsgBlock?> = arrayOfNulls(size)
}
override fun newArray(size: Int): Array<DecryptErrorMsgBlock?> = arrayOfNulls(size)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ data class DecryptedAttMsgBlock(
@Expose override val content: String?,
@Expose override val complete: Boolean,
@Expose override val attMeta: AttMeta,
@SerializedName("decryptErr") @Expose val error: DecryptError?
@SerializedName("decryptErr") @Expose val decryptErr: DecryptError?,
@Expose override val error: MsgBlockError? = null
) : AttMsgBlock {

var fileUri: Uri? = null
Expand All @@ -37,7 +38,8 @@ data class DecryptedAttMsgBlock(
source.readString(),
1 == source.readInt(),
source.readParcelable<AttMeta>(AttMeta::class.java.classLoader)!!,
source.readParcelable<DecryptError>(DecryptError::class.java.classLoader)
source.readParcelable<DecryptError>(DecryptError::class.java.classLoader),
source.readParcelable<MsgBlockError>(MsgBlockError::class.java.classLoader)
) {
fileUri = source.readParcelable(Uri::class.java.classLoader)
}
Expand All @@ -52,6 +54,7 @@ data class DecryptedAttMsgBlock(
writeString(content)
writeInt((if (complete) 1 else 0))
writeParcelable(attMeta, flags)
writeParcelable(decryptErr, flags)
writeParcelable(error, flags)
writeParcelable(fileUri, flags)
}
Expand All @@ -67,16 +70,12 @@ data class DecryptedAttMsgBlock(
)
}

companion object {
@JvmField
val CREATOR: Parcelable.Creator<DecryptedAttMsgBlock> =
object : Parcelable.Creator<DecryptedAttMsgBlock> {
override fun createFromParcel(source: Parcel): DecryptedAttMsgBlock {
source.readParcelable<MsgBlock.Type>(MsgBlock.Type::class.java.classLoader)
return DecryptedAttMsgBlock(source)
}
companion object CREATOR : Parcelable.Creator<DecryptedAttMsgBlock> {
override fun createFromParcel(parcel: Parcel): DecryptedAttMsgBlock {
parcel.readParcelable<MsgBlock.Type>(MsgBlock.Type::class.java.classLoader)
return DecryptedAttMsgBlock(parcel)
}

override fun newArray(size: Int): Array<DecryptedAttMsgBlock?> = arrayOfNulls(size)
}
override fun newArray(size: Int): Array<DecryptedAttMsgBlock?> = arrayOfNulls(size)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,34 @@ import com.google.gson.annotations.Expose

data class EncryptedAttLinkMsgBlock(
@Expose override val attMeta: AttMeta,
@Expose override val error: MsgBlockError? = null
) : AttMsgBlock {

@Expose
override val content: String = ""

@Expose
override val type: MsgBlock.Type = MsgBlock.Type.ENCRYPTED_ATT_LINK

@Expose
override val complete: Boolean = true

constructor(source: Parcel) : this(
source.readParcelable<AttMeta>(AttMeta::class.java.classLoader)!!
source.readParcelable<AttMeta>(AttMeta::class.java.classLoader)!!,
source.readParcelable<MsgBlockError>(MsgBlockError::class.java.classLoader)
)

override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeParcelable(attMeta, flags)
parcel.writeParcelable(error, flags)
}

override fun describeContents(): Int {
return 0
}

companion object CREATOR : Parcelable.Creator<EncryptedAttLinkMsgBlock> {
override fun createFromParcel(parcel: Parcel): EncryptedAttLinkMsgBlock {
return EncryptedAttLinkMsgBlock(parcel)
}

override fun newArray(size: Int): Array<EncryptedAttLinkMsgBlock?> {
return arrayOfNulls(size)
}
override fun createFromParcel(parcel: Parcel) = EncryptedAttLinkMsgBlock(parcel)
override fun newArray(size: Int): Array<EncryptedAttLinkMsgBlock?> = arrayOfNulls(size)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,24 @@ import com.google.gson.annotations.Expose

data class EncryptedAttMsgBlock(
@Expose override val content: String?,
@Expose override val attMeta: AttMeta
@Expose override val attMeta: AttMeta,
@Expose override val error: MsgBlockError? = null
) : AttMsgBlock {

var fileUri: Uri? = null

@Expose
override val complete: Boolean = true

@Expose
override val type: MsgBlock.Type = MsgBlock.Type.ENCRYPTED_ATT

constructor(source: Parcel) : this(
source.readString(),
source.readParcelable<AttMeta>(AttMeta::class.java.classLoader)!!
source.readParcelable<AttMeta>(AttMeta::class.java.classLoader)!!,
source.readParcelable<MsgBlockError>(MsgBlockError::class.java.classLoader)
) {
fileUri = source.readParcelable<Uri>(Uri::class.java.classLoader)
fileUri = source.readParcelable(Uri::class.java.classLoader)
}

override fun describeContents(): Int {
Expand All @@ -39,18 +42,16 @@ data class EncryptedAttMsgBlock(
writeParcelable(type, flags)
writeString(content)
writeParcelable(attMeta, flags)
writeParcelable(error, flags)
writeParcelable(fileUri, flags)
}

companion object {
@JvmField
val CREATOR: Parcelable.Creator<EncryptedAttMsgBlock> = object : Parcelable.Creator<EncryptedAttMsgBlock> {
override fun createFromParcel(source: Parcel): EncryptedAttMsgBlock {
source.readParcelable<MsgBlock.Type>(MsgBlock.Type::class.java.classLoader)
return EncryptedAttMsgBlock(source)
}

override fun newArray(size: Int): Array<EncryptedAttMsgBlock?> = arrayOfNulls(size)
companion object CREATOR : Parcelable.Creator<EncryptedAttMsgBlock> {
override fun createFromParcel(parcel: Parcel): EncryptedAttMsgBlock {
parcel.readParcelable<MsgBlock.Type>(MsgBlock.Type::class.java.classLoader)
return EncryptedAttMsgBlock(parcel)
}

override fun newArray(size: Int): Array<EncryptedAttMsgBlock?> = arrayOfNulls(size)
}
}
Loading