Skip to content

Commit b643f9d

Browse files
committed
Merge branch 'master' into issue_3017_fix_parsing_MIME_message
2 parents aba92c6 + c7ff73b commit b643f9d

44 files changed

Lines changed: 1022 additions & 1999 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

FlowCrypt/src/androidTest/java/com/flowcrypt/email/WkdClientTest.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/*
22
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
3-
* Contributors:
4-
* Ivan Pizhenko
5-
* DenBond7
3+
* Contributors: denbond7
64
*/
75

86
package com.flowcrypt.email
@@ -72,7 +70,7 @@ class WkdClientTest {
7270
fun nonExistingDomainTest() = runBlocking {
7371
val keys = WkdClient.lookupEmail(
7472
context,
75-
"doesnotexist@thisdomaindoesnotexist.test"
73+
"doesnotexist@thisdomaindoesnotexist.example"
7674
)
7775
assertTrue("Key found for non-existing email", keys == null)
7876
}

FlowCrypt/src/test/java/com/flowcrypt/email/core/msg/RawBlockParserTest.kt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
/*
22
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
3-
* Contributors: Ivan Pizhenko
3+
* Contributors: denbond7
44
*/
55

66
package com.flowcrypt.email.core.msg
77

88
import com.flowcrypt.email.extensions.kotlin.normalize
9+
import com.flowcrypt.email.security.pgp.PgpSignature
10+
import com.flowcrypt.email.util.TestUtil
911
import org.junit.Assert.assertEquals
1012
import org.junit.Test
1113

1214
class RawBlockParserTest {
15+
16+
@Test
17+
fun testExtractClearTextFromMsgSignedMessagePreserveNewlines() {
18+
val text = TestUtil.readResourceAsString("pgp/messages/signed-message-preserve-newlines.txt")
19+
val blocks = RawBlockParser.detectBlocks(text).toList()
20+
val clearText = PgpSignature.extractClearText(text)
21+
assertEquals(
22+
"Standard message\n\nsigned inline\n\nshould easily verify\nThis is email footer",
23+
clearText
24+
)
25+
assertEquals(1, blocks.size)
26+
assertEquals(RawBlockParser.RawBlockType.PGP_CLEARSIGN_MSG, blocks[0].type)
27+
}
28+
1329
@Test
1430
fun testNoStringIndexOutOfBoundsExceptionInParser() {
1531
checkForSinglePlaintextBlock("-----BEGIN FOO-----\n")

0 commit comments

Comments
 (0)