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,46 @@
{
"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 text for default@flowcrypt.test\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"
}
],
"msgEntity": {
"cc": [],
"email": "default@flowcrypt.test",
"flags": "\\SEEN",
"folder": "INBOX",
"from": [
{
"address": "default@flowcrypt.test"
}
],
"fromAddress": "default@flowcrypt.test",
"hasAttachments": false,
"id": 70,
"isNew": false,
"isSeen": true,
"msgState": "NONE",
"receivedDate": 1633967967000,
"replyTo": "default@flowcrypt.test",
"replyToAddress": [
{
"address": "default@flowcrypt.test"
}
],
"sentDate": 1633967964000,
"state": -1,
"subject": "SIGNED message. \"gpg --sign --armor\"",
"to": [
{
"address": "default@flowcrypt.test"
}
],
"toAddress": "default@flowcrypt.test",
"uid": 26,
"uidAsHEX": "1a"
},
"text": "Signed text for default@flowcrypt.test"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Return-Path: <default@flowcrypt.test>
Delivered-To: default@flowcrypt.test
Received: from mail.flowcrypt.test
by mail.flowcrypt.test with LMTP
id 4eX1NV9fZGEKBQAAc/RpdQ
(envelope-from <default@flowcrypt.test>)
for <default@flowcrypt.test>; Mon, 11 Oct 2021 15:59:27 +0000
Received: from localhost (localhost [127.0.0.1])
by mail.flowcrypt.test (Postfix) with ESMTP id D93A51C2074
for <default@flowcrypt.test>; Mon, 11 Oct 2021 15:59:27 +0000 (UTC)
Date: Mon, 11 Oct 2021 18:59:24 +0300 (GMT+03:00)
From: default@flowcrypt.test
To: default@flowcrypt.test
Message-ID: <163818563.5.1633967964807@flowcrypt.test>
Subject: SIGNED message. "gpg --sign --armor"
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_4_204938738.1633967964803"

------=_Part_4_204938738.1633967964803
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

-----BEGIN PGP MESSAGE-----

owGbwMvMwCGmFN+gfIiXM5zxtG4SQ2Iw74rgzPS81BSFktSKEoW0/CKFlNS0xNKc
Eoe0nPzy5KLKghK9ktTiEq6OXhYGMQ4GUzFFFtvXL7+VX9252+LpIheYcaxMQLMO
iMtg183AxSkAUynizshwbBMnx4e4tn6NgJYtG/od3HL1y26GvpgqUtr2o37HpC+v
GRmudmly/g+Osdt3t6Rb+8t8i8Y94ZJ3P/zNlk015FihXM0JAA==
=A8uF
-----END PGP MESSAGE-----

------=_Part_4_204938738.1633967964803--
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,15 @@ class MessageDetailsActivityTest : BaseMessageDetailsActivityTest() {
matchReplyButtons(details)
}

@Test
fun testSignedArmoredMsg() {
val msgInfo = getMsgInfo(
"messages/info/signed_msg_armored.json",
"messages/mime/signed_msg_armored.txt"
)
baseCheck(msgInfo)
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ object PgpDecrypt {
)

decryptionStream.use { it.copyTo(outStream) }
return DecryptionResult.withDecrypted(
return DecryptionResult(
content = destOutputStream,
isEncrypted = decryptionStream.result.isEncrypted,
isSigned = decryptionStream.result.isSigned,
filename = decryptionStream.result.fileName
)
} catch (e: Exception) {
Expand Down Expand Up @@ -171,6 +173,8 @@ object PgpDecrypt {
// 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,

Expand All @@ -184,10 +188,6 @@ object PgpDecrypt {
fun withError(exception: DecryptionException): DecryptionResult {
return DecryptionResult(exception = exception)
}

fun withDecrypted(content: ByteArrayOutputStream, filename: String?): DecryptionResult {
return DecryptionResult(content = content, isEncrypted = true, filename = filename)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion docker-mailserver/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2'
services:
mail:
image: flowcrypt/flowcrypt-email-server:0.0.10
image: flowcrypt/flowcrypt-email-server:0.0.11
hostname: ${HOSTNAME}
domainname: ${DOMAINNAME}
container_name: ${CONTAINER_NAME}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
2 M1e C61645f5f
N 00000000000004CB
Return-Path: <default@flowcrypt.test>
Delivered-To: default@flowcrypt.test
Received: from mail.flowcrypt.test
by mail.flowcrypt.test with LMTP
id 4eX1NV9fZGEKBQAAc/RpdQ
(envelope-from <default@flowcrypt.test>)
for <default@flowcrypt.test>; Mon, 11 Oct 2021 15:59:27 +0000
Received: from localhost (localhost [127.0.0.1])
by mail.flowcrypt.test (Postfix) with ESMTP id D93A51C2074
for <default@flowcrypt.test>; Mon, 11 Oct 2021 15:59:27 +0000 (UTC)
Date: Mon, 11 Oct 2021 18:59:24 +0300 (GMT+03:00)
From: default@flowcrypt.test
To: default@flowcrypt.test
Message-ID: <163818563.5.1633967964807@flowcrypt.test>
Subject: SIGNED message. "gpg --sign --armor"
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_4_204938738.1633967964803"

------=_Part_4_204938738.1633967964803
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

-----BEGIN PGP MESSAGE-----

owGbwMvMwCGmFN+gfIiXM5zxtG4SQ2Iw74rgzPS81BSFktSKEoW0/CKFlNS0xNKc
Eoe0nPzy5KLKghK9ktTiEq6OXhYGMQ4GUzFFFtvXL7+VX9252+LpIheYcaxMQLMO
iMtg183AxSkAUynizshwbBMnx4e4tn6NgJYtG/od3HL1y26GvpgqUtr2o37HpC+v
GRmudmly/g+Osdt3t6Rb+8t8i8Y94ZJ3P/zNlk015FihXM0JAA==
=A8uF
-----END PGP MESSAGE-----

------=_Part_4_204938738.1633967964803--


R61645f5f
V4ec
Ga19408365f5f64610a05000073f46975

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
2 M1e C61645f5f
N 000000000000033D
Date: Mon, 11 Oct 2021 18:59:24 +0300 (GMT+03:00)
From: default@flowcrypt.test
To: default@flowcrypt.test
Message-ID: <163818563.5.1633967964807@flowcrypt.test>
Subject: SIGNED message. "gpg --sign --armor"
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_4_204938738.1633967964803"
User-Agent: FlowCrypt_Android_1.2.3_dev_123__2021_10_11

------=_Part_4_204938738.1633967964803
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

-----BEGIN PGP MESSAGE-----

owGbwMvMwCGmFN+gfIiXM5zxtG4SQ2Iw74rgzPS81BSFktSKEoW0/CKFlNS0xNKc
Eoe0nPzy5KLKghK9ktTiEq6OXhYGMQ4GUzFFFtvXL7+VX9252+LpIheYcaxMQLMO
iMtg183AxSkAUynizshwbBMnx4e4tn6NgJYtG/od3HL1y26GvpgqUtr2o37HpC+v
GRmudmly/g+Osdt3t6Rb+8t8i8Y94ZJ3P/zNlk015FihXM0JAA==
=A8uF
-----END PGP MESSAGE-----

------=_Part_4_204938738.1633967964803--


R61645f5c
V355
Ge010cd325f5f6461f204000073f46975

Binary file not shown.