test: show cryptographic envelope information for signed mails

Make sure that we emit the correct cryptographic envelope status for
cleartext signed messages.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
This commit is contained in:
Daniel Kahn Gillmor 2019-05-26 18:16:01 -04:00 committed by David Bremner
parent 1c879f3939
commit 996ef5710c
3 changed files with 67 additions and 1 deletions

View file

@ -2,7 +2,6 @@
# TODO:
# * check S/MIME as well as PGP/MIME
# * process headers protected by signature
test_description='Message decryption with protected headers'
. $(dirname "$0")/test-lib.sh || exit 1
@ -67,4 +66,14 @@ test_json_nodes <<<"$output" \
'crypto:[0][0][0]["crypto"]={"decrypted": {"status": "full", "header-mask": {"Subject": "Subject Unavailable"}}}' \
'subject:[0][0][0]["headers"]["Subject"]="This is a message using draft-melnikov-smime-header-signing"'
test_begin_subtest "show cryptographic envelope on signed mail"
output=$(notmuch show --verify --format=json id:simple-signed-mail@crypto.notmuchmail.org)
test_json_nodes <<<"$output" \
'crypto:[0][0][0]["crypto"]={"signed": {"status": [{"created": 1525609971, "fingerprint": "'$FINGERPRINT'", "userid": "'"$SELF_USERID"'", "status": "good"}]}}'
test_begin_subtest "verify signed protected header"
output=$(notmuch show --verify --format=json id:signed-protected-header@crypto.notmuchmail.org)
test_json_nodes <<<"$output" \
'crypto:[0][0][0]["crypto"]={"signed": {"status": [{"created": 1525350527, "fingerprint": "'$FINGERPRINT'", "userid": "'"$SELF_USERID"'", "status": "good"}], "headers": ["Subject"]}}'
test_done

View file

@ -0,0 +1,29 @@
From: test_suite@notmuchmail.org
To: test_suite@notmuchmail.org
Subject: This is a signed message
Date: Sat, 01 Jan 2000 12:00:00 +0000
Message-ID: <signed-protected-header@crypto.notmuchmail.org>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
protocol="application/pgp-signature";
micalg=pgp-sha512
--=-=-=
Content-Type: text/plain; protected-headers="v1"
Subject: This is a signed message
Here is the signed message body.
--=-=-=
Content-Disposition: attachment; filename=signature.asc
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
iLMEAQEKAB0WIQRa6rEfXjPc6HXdt1ttkmEtlORjgQUCWusAfwAKCRBtkmEtlORj
geIJA/0WcyxlwDfXRMbiGE/crLBYhLpXK6ZMzjEn6HQDntMIk3Kr61rAwL8edKGx
gbxr1+XlMYRt+PJDhi8iI0odDI1YjiBjjc0bXUoDn60UcjL2MPGshI3426CA7cqB
cMaoRHajfdxYjSzzfh8duVgi0vmUnsyoePBhANRbDIVmCQS11g==
=c4cq
-----END PGP SIGNATURE-----
--=-=-=--

View file

@ -0,0 +1,28 @@
From: test_suite@notmuchmail.org
To: test_suite@notmuchmail.org
Subject: This is a signed message
Date: Sat, 01 Jan 2000 12:00:00 +0000
Message-ID: <simple-signed-mail@crypto.notmuchmail.org>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
protocol="application/pgp-signature";
micalg=pgp-sha512
--=-=-=
Content-Type: text/plain
Here is the signed message body.
--=-=-=
Content-Disposition: attachment; filename=signature.asc
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
iLMEAQEKAB0WIQRa6rEfXjPc6HXdt1ttkmEtlORjgQUCWu718wAKCRBtkmEtlORj
gUXaA/4/m6CPRgC9JODRKRWo3Szi5D3zg7uf29DIJu9m2vVRw5o0ZeHcxLb26UPe
qdjPq6GBclkXdeTH9Nv2TW5cToJmMA9UvESeRRzbe6ytvswNEYdSbiYAsv/k9t6K
KQO2ZSbsbVlkh8xVYC3ORiUS775YrPxVT6QlPkMKAXw3l3Zwcg==
=jnDO
-----END PGP SIGNATURE-----
--=-=-=--