X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=test%2FT355-smime.sh;h=4de0fbefae65361414d38de5de871c0098b0cb25;hb=5f4aceee26ca6db3cdd09ff69220a63e07976a01;hp=117fa2b956ce9fc719578d41fa52c1ff4b342897;hpb=b1a04bddc27c80411cf1ca148b3c33720bc8e785;p=notmuch diff --git a/test/T355-smime.sh b/test/T355-smime.sh index 117fa2b9..4de0fbef 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. @@ -181,19 +177,23 @@ On Tue, 26 Nov 2019 20:11:29 -0400, Alice Lovelace wrote: test_expect_equal "$expected" "$output" test_begin_subtest "show PKCS#7 SignedData outputs valid JSON" +test_subtest_known_broken output=$(notmuch show --format=json id:smime-onepart-signed@protected-headers.example) 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" +test_subtest_known_broken 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