commit 391f0fa14e9f61abef02838de706653eb9831c55
parent 08de630816b566dc311759b0c9b7e02d7b760f65
Author: Dan Callaghan <djc@djc.id.au>
Date: Sun, 21 Jun 2020 15:27:39 +1000
tests: check micalg parameter for multipart/signed
This adds test coverage for issue #510.
Diffstat:
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/test/gnupg_test_home/gpg.conf b/test/gnupg_test_home/gpg.conf
@@ -1,2 +1,3 @@
trust-model always
-
+# Set preferred hash algo to the one expected in the test suite
+personal-digest-preferences sha256
diff --git a/test/test_crypto.rb b/test/test_crypto.rb
@@ -61,6 +61,8 @@ class TestCryptoManager < Minitest::Test
if CryptoManager.have_crypto? then
signed = CryptoManager.sign @from_email,@to_email,"ABCDEFG"
assert_instance_of RMail::Message, signed
+ assert_equal("multipart/signed; protocol=application/pgp-signature; micalg=pgp-sha256",
+ signed.header["Content-Type"])
assert_equal "ABCDEFG", signed.body[0]
assert signed.body[1].body.length > 0 , "signature length must be > 0"
assert (signed.body[1].body.include? "-----BEGIN PGP SIGNATURE-----") , "Expecting PGP armored data"