Loading k9mail/src/main/java/com/fsck/k9/message/PgpMessageBuilder.java +2 −1 Original line number Diff line number Diff line Loading @@ -285,7 +285,8 @@ public class PgpMessageBuilder extends MessageBuilder { multipartSigned.setSubType("signed"); multipartSigned.addBodyPart(signedBodyPart); multipartSigned.addBodyPart( new MimeBodyPart(new BinaryMemoryBody(signedData, MimeUtil.ENC_7BIT), "application/pgp-signature")); new MimeBodyPart(new BinaryMemoryBody(signedData, MimeUtil.ENC_7BIT), "application/pgp-signature; name=\"signature.asc\"")); MimeMessageHelper.setBody(currentProcessedMimeMessage, multipartSigned); String contentType = String.format( Loading k9mail/src/test/java/com/fsck/k9/message/PgpMessageBuilderTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -154,8 +154,11 @@ public class PgpMessageBuilderTest { assertContentOfBodyPartEquals("content must match the message text", contentBodyPart, TEST_MESSAGE_TEXT); BodyPart signatureBodyPart = multipart.getBodyPart(1); Assert.assertEquals("second part must be pgp signature", "application/pgp-signature", signatureBodyPart.getContentType()); String contentType = signatureBodyPart.getContentType(); Assert.assertEquals("second part must be pgp signature", "application/pgp-signature", MimeUtility.getHeaderParameter(contentType, null)); Assert.assertEquals("second part must be called signature.asc", "signature.asc", MimeUtility.getHeaderParameter(contentType, "name")); assertContentOfBodyPartEquals("content must match the supplied detached signature", signatureBodyPart, new byte[] { 1, 2, 3 }); } Loading Loading
k9mail/src/main/java/com/fsck/k9/message/PgpMessageBuilder.java +2 −1 Original line number Diff line number Diff line Loading @@ -285,7 +285,8 @@ public class PgpMessageBuilder extends MessageBuilder { multipartSigned.setSubType("signed"); multipartSigned.addBodyPart(signedBodyPart); multipartSigned.addBodyPart( new MimeBodyPart(new BinaryMemoryBody(signedData, MimeUtil.ENC_7BIT), "application/pgp-signature")); new MimeBodyPart(new BinaryMemoryBody(signedData, MimeUtil.ENC_7BIT), "application/pgp-signature; name=\"signature.asc\"")); MimeMessageHelper.setBody(currentProcessedMimeMessage, multipartSigned); String contentType = String.format( Loading
k9mail/src/test/java/com/fsck/k9/message/PgpMessageBuilderTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -154,8 +154,11 @@ public class PgpMessageBuilderTest { assertContentOfBodyPartEquals("content must match the message text", contentBodyPart, TEST_MESSAGE_TEXT); BodyPart signatureBodyPart = multipart.getBodyPart(1); Assert.assertEquals("second part must be pgp signature", "application/pgp-signature", signatureBodyPart.getContentType()); String contentType = signatureBodyPart.getContentType(); Assert.assertEquals("second part must be pgp signature", "application/pgp-signature", MimeUtility.getHeaderParameter(contentType, null)); Assert.assertEquals("second part must be called signature.asc", "signature.asc", MimeUtility.getHeaderParameter(contentType, "name")); assertContentOfBodyPartEquals("content must match the supplied detached signature", signatureBodyPart, new byte[] { 1, 2, 3 }); } Loading