X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT355-smime.sh;h=f3956a34c2533de787f5e4cded658a7ced754a31;hp=9debf2da37fba8199bc86e8f0bc9d5b0a0422ac9;hb=a8bf94af44b21449d8f28478013400c096b0241d;hpb=2e351d10c2aba786656715e8334fc2296e22527d diff --git a/test/T355-smime.sh b/test/T355-smime.sh index 9debf2da..f3956a34 100755 --- a/test/T355-smime.sh +++ b/test/T355-smime.sh @@ -6,9 +6,7 @@ test_description='S/MIME signature verification and decryption' test_require_external_prereq openssl test_require_external_prereq gpgsm -cp $NOTMUCH_SRCDIR/test/smime/key+cert.pem test_suite.pem - -FINGERPRINT=$(openssl x509 -fingerprint -in test_suite.pem -noout | sed -e 's/^.*=//' -e s/://g) +FINGERPRINT=$(openssl x509 -fingerprint -in "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" -noout | sed -e 's/^.*=//' -e s/://g) add_gpgsm_home @@ -74,7 +72,7 @@ test_expect_equal_json \ test_begin_subtest "Decryption and signature verification (openssl)" notmuch show --format=raw subject:"test encrypted message 001" |\ - openssl smime -decrypt -recip test_suite.pem |\ + openssl smime -decrypt -recip $NOTMUCH_SRCDIR/test/smime/key+cert.pem |\ openssl smime -verify -CAfile $NOTMUCH_SRCDIR/test/smime/test.crt 2>OUTPUT cat < EXPECTED Verification successful @@ -90,4 +88,13 @@ This is a test encrypted message. EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "Cryptographic message status (encrypted+signed)" +test_subtest_known_broken +output=$(notmuch show --format=json --decrypt=true subject:"test encrypted message 001") +test_json_nodes <<<"$output" \ + 'crypto_encrypted:[0][0][0]["crypto"]["decrypted"]["status"]="full"' \ + 'crypto_sigok:[0][0][0]["crypto"]["signed"]["status"][0]["status"]="good"' \ + 'crypto_fpr:[0][0][0]["crypto"]["signed"]["status"][0]["fingerprint"]="616F46CD73834C63847756AF0DFB64A6E0972A47"' \ + 'crypto_uid:[0][0][0]["crypto"]["signed"]["status"][0]["userid"]="CN=Notmuch Test Suite"' + test_done