summary refs log tree commit diff
path: root/contrib/mverify
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2018-01-06 18:34:16 +0100
committerLeah Neukirchen <leah@vuxu.org>2018-01-06 18:34:16 +0100
commitd1d2a41bafc1bbfcdb6e5485dd4d5faa87d1949a (patch)
treedd32435b0d412fa70b26a81f9d4b38688612fa5d /contrib/mverify
parent48a3769f34f0b69c85d0389db7afda9917dc2873 (diff)
downloadmblaze-d1d2a41bafc1bbfcdb6e5485dd4d5faa87d1949a.tar.gz
mblaze-d1d2a41bafc1bbfcdb6e5485dd4d5faa87d1949a.tar.xz
mblaze-d1d2a41bafc1bbfcdb6e5485dd4d5faa87d1949a.zip
mverify: drop dependency on unix2dos and bash
Diffstat (limited to 'contrib/mverify')
-rwxr-xr-xcontrib/mverify9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/mverify b/contrib/mverify
index 30b51f8..142d11b 100755
--- a/contrib/mverify
+++ b/contrib/mverify
@@ -1,7 +1,7 @@
 #!/bin/sh
 # mverify MSG - verify a OpenPGP or SMIME message
 
-# Needs bash, unix2dos, gpg and openssl.
+# Needs gpg (for OpenPGP) and openssl (for SMIME).
 
 [ "$#" -eq 0 ] && set -- .
 
@@ -19,9 +19,10 @@ END {
 		print("No signature found.")
 		exit(100)
 	} else if (type == "application/pgp-signature") {
-		exit(system("bash -c " q("mshow -r -O " q(msg) " " q(content) \
-			" | unix2dos | gpg --verify <(mshow -O " q(msg) \
-			" " q(signature) " ) -")))
+		exit(system("mshow -r -O " q(msg) " " q(content) \
+			" | sed '/
$/!s/$/
/' | " \
+			" { mshow -O " q(msg) " " q(signature) \
+			" | gpg --verify - /dev/fd/3; } 3<&0"))
 	} else if (type == "application/pkcs7-signature") {
 		exit(system("mshow -r -O " q(msg) " " q(signed) \
 			" | openssl smime -verify"))