X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2FT355-smime.sh;h=03aada20c03e625bc575f1ceca411b31fc348f13;hb=f12fb4d819956cb467b22183f0416fed44703d0f;hp=117fa2b956ce9fc719578d41fa52c1ff4b342897;hpb=b1a04bddc27c80411cf1ca148b3c33720bc8e785;p=notmuch diff --git a/test/T355-smime.sh b/test/T355-smime.sh index 117fa2b9..03aada20 100755 --- a/test/T355-smime.sh +++ b/test/T355-smime.sh @@ -98,7 +98,6 @@ test_json_nodes <<<"$output" \ 'crypto_uid:[0][0][0]["crypto"]["signed"]["status"][0]["userid"]="CN=Notmuch Test Suite"' test_begin_subtest "encrypted+signed message is known to be encrypted, but signature is unknown" -test_subtest_known_broken output=$(notmuch search subject:"test encrypted message 001") test_expect_equal "$output" "thread:0000000000000002 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message 001 (encrypted inbox)" @@ -132,20 +131,17 @@ expected='' test_expect_equal "$expected" "$output" test_begin_subtest "know the MIME type of the embedded part in PKCS#7 SignedData" -test_subtest_known_broken output=$(notmuch search --output=messages 'mimetype:text/plain') expected=id:smime-onepart-signed@protected-headers.example test_expect_equal "$expected" "$output" test_begin_subtest "PKCS#7 SignedData message is tagged 'signed'" -test_subtest_known_broken output=$(notmuch dump id:smime-onepart-signed@protected-headers.example) expected='#notmuch-dump batch-tag:3 config,properties,tags +inbox +signed +unread -- id:smime-onepart-signed@protected-headers.example' test_expect_equal "$expected" "$output" test_begin_subtest "show contents of PKCS#7 SignedData message" -test_subtest_known_broken output=$(notmuch show --format=raw --part=2 id:smime-onepart-signed@protected-headers.example) whitespace=' ' expected="Bob, we need to cancel this contract. @@ -185,15 +181,19 @@ output=$(notmuch show --format=json id:smime-onepart-signed@protected-headers.ex test_valid_json "$output" test_begin_subtest "Verify signature on PKCS#7 SignedData message" -test_subtest_known_broken output=$(notmuch show --format=json id:smime-onepart-signed@protected-headers.example) + +test_json_nodes <<<"$output" \ + 'created:[0][0][0]["crypto"]["signed"]["status"][0]["created"]=1574813489' \ + 'expires:[0][0][0]["crypto"]["signed"]["status"][0]["expires"]=2611032858' \ + 'fingerprint:[0][0][0]["crypto"]["signed"]["status"][0]["fingerprint"]="702BA4B157F1E2B7D16B0C6A5FFC8A7DE2057DEB"' \ + 'status:[0][0][0]["crypto"]["signed"]["status"][0]["status"]="good"' + +test_begin_subtest "Verify signature on PKCS#7 SignedData message signer User ID" +if [ $NOTMUCH_GMIME_X509_CERT_VALIDITY -ne 1 ]; then + test_subtest_known_broken +fi test_json_nodes <<<"$output" \ - 'crypto:[0][0][0]["crypto"]["signed"]["status"][0]={ - "created" : 1574813489, - "expires" : 2611032858, - "fingerprint" : "702BA4B157F1E2B7D16B0C6A5FFC8A7DE2057DEB", - "userid" : "CN=Alice Lovelace", - "status" : "good" - }' + 'userid:[0][0][0]["crypto"]["signed"]["status"][0]["userid"]="CN=Alice Lovelace"' test_done