From 15ed2184e61e40a35e56921aa57a49726f56b5c2 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Mon, 25 Nov 2019 16:45:49 -0500 Subject: email-print-mime-structure: decrypt S/MIME parts with OpenSSL If the user supplies a secret key like the ones found in https://www.ietf.org/id/draft-dkg-lamps-samples-01.html, then email-print-mime-structure will try to use that for decryption of CMS-encrypted (S/MIME) message parts. Signed-off-by: Daniel Kahn Gillmor Acked-by: Sean Whitton --- tests/email-print-mime-structure.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/email-print-mime-structure.sh b/tests/email-print-mime-structure.sh index 6e510ca..b45294e 100755 --- a/tests/email-print-mime-structure.sh +++ b/tests/email-print-mime-structure.sh @@ -22,6 +22,12 @@ for eml in tests/email-print-mime-structure/*.eml; do GNUPGHOME="$testgpghome" test_eml "$base" --use-gpg-agent rm -rf "$testgpghome" elif [ -e "$p12key" ]; then + printf "Testing %s (OpenSSL)\n" "${eml##*/}" + grep -v ^- < "$p12key" | base64 -d | \ + openssl pkcs12 -nocerts -nodes -passin pass: -passout pass: -out "$base.pemkey" + test_eml "$base" --cmskey "$base.pemkey" + rm -f "$base.pemkey" + testgpghome=$(mktemp -d) printf "Testing %s (GnuPG S/MIME)\n" "${eml##*/}" gpgsm --pinentry-mode=loopback --passphrase-fd 4 4<<<'' --homedir="$testgpghome" --batch --quiet --import <"$p12key" -- cgit v1.2.3