mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-02 21:11:05 +01:00
tests: Avoid relying on implicit gpg commands.
* tests/openpgp/armdetach.scm: Always use an explicit command instead of relying on gpg to guess what we want. * tests/openpgp/armdetachm.scm: Likewise. * tests/openpgp/armencrypt.scm: Likewise. * tests/openpgp/armencryptp.scm: Likewise. * tests/openpgp/armor.scm: Likewise. * tests/openpgp/armsignencrypt.scm: Likewise. * tests/openpgp/armsigs.scm: Likewise. * tests/openpgp/clearsig.scm: Likewise. * tests/openpgp/compression.scm: Likewise. * tests/openpgp/conventional-mdc.scm: Likewise. * tests/openpgp/conventional.scm: Likewise. * tests/openpgp/decrypt-dsa.scm: Likewise. * tests/openpgp/decrypt.scm: Likewise. * tests/openpgp/detach.scm: Likewise. * tests/openpgp/detachm.scm: Likewise. * tests/openpgp/ecc.scm: Likewise. * tests/openpgp/encrypt-dsa.scm: Likewise. * tests/openpgp/encrypt-multifile.scm: Likewise. * tests/openpgp/encrypt.scm: Likewise. * tests/openpgp/encryptp.scm: Likewise. * tests/openpgp/seat.scm: Likewise. * tests/openpgp/signencrypt-dsa.scm: Likewise. * tests/openpgp/signencrypt.scm: Likewise. * tests/openpgp/sigs-dsa.scm: Likewise. * tests/openpgp/sigs.scm: Likewise. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
1b28d9dbe0
commit
cde626e7f7
@ -28,5 +28,5 @@
|
||||
--output ,tmp ,source ) usrpass1)
|
||||
(pipe:do
|
||||
(pipe:open source (logior O_RDONLY O_BINARY))
|
||||
(pipe:spawn `(,@GPG --yes ,tmp)))))
|
||||
(pipe:spawn `(,@GPG --yes --verify ,tmp -)))))
|
||||
(append plain-files data-files))
|
||||
|
@ -33,4 +33,4 @@
|
||||
(pipe:open file (logior O_RDONLY O_BINARY))
|
||||
(pipe:splice sink)))
|
||||
files)))
|
||||
(pipe:spawn `(,@GPG --yes ,tmp))))
|
||||
(pipe:spawn `(,@GPG --yes --verify ,tmp -))))
|
||||
|
@ -26,6 +26,6 @@
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg usrpass1 `(--yes --passphrase-fd "0" -ea --recipient ,usrname2))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files))
|
||||
|
@ -27,6 +27,6 @@
|
||||
(tr:open source)
|
||||
(tr:pipe-do
|
||||
(pipe:gpg `(--yes -ea --recipient ,usrname2))
|
||||
(pipe:gpg '(--yes)))
|
||||
(pipe:gpg '(--yes --decrypt)))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files))
|
||||
|
@ -764,4 +764,4 @@ wg7Md81a5RI3F2FG8747t9gX
|
||||
(tr:do
|
||||
(tr:pipe-do
|
||||
(pipe:echo nopad_armored_msg)
|
||||
(pipe:gpg '())))
|
||||
(pipe:gpg '(--decrypt))))
|
||||
|
@ -26,6 +26,6 @@
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg usrpass1 `(--yes --passphrase-fd "0" -sea --recipient ,usrname2))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files))
|
||||
|
@ -26,6 +26,6 @@
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg usrpass1 `(--yes --passphrase-fd "0" -sa --recipient ,usrname2))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files))
|
||||
|
@ -25,7 +25,7 @@
|
||||
(lettmp (signed)
|
||||
(call-popen `(,@GPG --output ,signed --yes
|
||||
,@args ,source) input)
|
||||
(call-popen `(,@GPG --output ,sink --yes ,signed) ""))))
|
||||
(call-popen `(,@GPG --output ,sink --yes --verify ,signed) ""))))
|
||||
|
||||
(for-each-p
|
||||
"Checking signing and verifying plain text messages"
|
||||
|
@ -30,7 +30,7 @@
|
||||
(tr:open source)
|
||||
(tr:gpg "" `(--yes --encrypt --recipient ,usrname2
|
||||
--compress-algo ,compression))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files)))
|
||||
(force all-compression-algos))
|
||||
|
@ -34,7 +34,7 @@
|
||||
(tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k
|
||||
--force-mdc -c
|
||||
--cipher-algo ,algo))
|
||||
(tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k))
|
||||
(tr:gpg passphrase `(--yes --passphrase-fd "0" --decrypt ,s2k))
|
||||
(tr:assert-identity source)))
|
||||
'("plain-1" "data-80000")))
|
||||
(force all-cipher-algos))
|
||||
@ -45,6 +45,6 @@
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k -cs))
|
||||
(tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k))
|
||||
(tr:gpg passphrase `(--yes --passphrase-fd "0" --decrypt ,s2k))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files))
|
||||
|
@ -29,7 +29,7 @@
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k -c))
|
||||
(tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k))
|
||||
(tr:gpg passphrase `(--yes --passphrase-fd "0" --decrypt ,s2k))
|
||||
(tr:assert-identity source)))
|
||||
'("plain-2" "data-32000"))
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
(tr:open source)
|
||||
(tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k -c
|
||||
--cipher-algo ,algo))
|
||||
(tr:gpg passphrase `(--yes --passphrase-fd "0" ,s2k))
|
||||
(tr:gpg passphrase `(--yes --passphrase-fd "0" --decrypt ,s2k))
|
||||
(tr:assert-identity source)))
|
||||
'("plain-1" "data-80000")))
|
||||
(force all-cipher-algos))
|
||||
|
@ -25,6 +25,6 @@
|
||||
(lambda (name)
|
||||
(tr:do
|
||||
(tr:open (in-srcdir (string-append name "-pgp.asc")))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity name)))
|
||||
(list (car plain-files)))
|
||||
|
@ -25,6 +25,6 @@
|
||||
(lambda (name)
|
||||
(tr:do
|
||||
(tr:open (in-srcdir (string-append name ".asc")))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity name)))
|
||||
plain-files)
|
||||
|
@ -28,5 +28,5 @@
|
||||
--output ,tmp ,source ) usrpass1)
|
||||
(pipe:do
|
||||
(pipe:open source (logior O_RDONLY O_BINARY))
|
||||
(pipe:spawn `(,@GPG --yes ,tmp)))))
|
||||
(pipe:spawn `(,@GPG --yes --verify ,tmp -)))))
|
||||
(append plain-files data-files))
|
||||
|
@ -33,4 +33,4 @@
|
||||
(pipe:open file (logior O_RDONLY O_BINARY))
|
||||
(pipe:splice sink)))
|
||||
files)))
|
||||
(pipe:spawn `(,@GPG --yes ,tmp))))
|
||||
(pipe:spawn `(,@GPG --yes --verify ,tmp -))))
|
||||
|
@ -101,8 +101,7 @@ Ic1RdzgeCfosMF+l/zVRchcLKzenEQA=
|
||||
(lettmp (x y)
|
||||
(call-with-output-file
|
||||
x (lambda (p) (display (eval test (current-environment)) p)))
|
||||
(call-check `(,(tool 'gpg) --verify ,x))
|
||||
(call-check `(,(tool 'gpg) --output ,y ,x))
|
||||
(call-check `(,(tool 'gpg) --output ,y --verify ,x))
|
||||
(unless (file=? y z) (fail "mismatch"))))
|
||||
'(msg_opaque_signed_256 msg_opaque_signed_384 msg_opaque_signed_521)))
|
||||
|
||||
@ -181,7 +180,7 @@ Rg==
|
||||
(lettmp (x y)
|
||||
(call-with-output-file
|
||||
x (lambda (p) (display (eval test (current-environment)) p)))
|
||||
(call-check `(,@GPG --yes --output ,y ,x))
|
||||
(call-check `(,@GPG --yes --output ,y --decrypt ,x))
|
||||
(unless (file=? y z) (fail "mismatch"))))
|
||||
'(msg_encrypted_256 msg_encrypted_384 msg_encrypted_521)))
|
||||
|
||||
@ -200,7 +199,7 @@ Rg==
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg "" `(--yes --encrypt --recipient ,keyid))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
mainkeyids))
|
||||
(append plain-files data-files))
|
||||
@ -217,7 +216,7 @@ Rg==
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg "" `(--yes --sign --local-user ,keyid))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
mainkeyids))
|
||||
(append plain-files data-files))
|
||||
|
@ -26,7 +26,7 @@
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg "" `(--yes --encrypt --recipient ,dsa-usrname2))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files))
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
(tr:open source)
|
||||
(tr:gpg "" `(--yes --encrypt --recipient ,dsa-usrname2
|
||||
--cipher-algo ,cipher))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files)))
|
||||
(force all-cipher-algos))
|
||||
|
@ -34,6 +34,6 @@
|
||||
(lambda (source)
|
||||
(tr:do
|
||||
(tr:open (string-append source ".gpg"))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
files)
|
||||
|
@ -26,7 +26,7 @@
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg "" `(--yes --encrypt --recipient ,usrname2))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files))
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
(tr:open source)
|
||||
(tr:gpg "" `(--yes --encrypt --recipient ,usrname2
|
||||
--cipher-algo ,cipher))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files)))
|
||||
(force all-cipher-algos))
|
||||
@ -56,6 +56,6 @@
|
||||
(tr:gpg "" `(--yes -v --no-keyring --encrypt
|
||||
--recipient-file ,(in-srcdir key-file1)
|
||||
--hidden-recipient-file ,(in-srcdir key-file2)))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
plain-files)
|
||||
|
@ -27,6 +27,6 @@
|
||||
(tr:open source)
|
||||
(tr:pipe-do
|
||||
(pipe:gpg `(--yes --encrypt --recipient ,usrname2))
|
||||
(pipe:gpg '(--yes)))
|
||||
(pipe:gpg '(--yes --decrypt)))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files))
|
||||
|
@ -26,6 +26,6 @@
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg usrpass1 '(--yes -seat -r two@example.com --passphrase-fd "0"))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-weak-identity source)))
|
||||
plain-files)
|
||||
|
@ -28,7 +28,7 @@
|
||||
(tr:gpg usrpass1 `(--yes --passphrase-fd "0" -se
|
||||
-u ,dsa-usrname1
|
||||
--recipient ,dsa-usrname2))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files))
|
||||
|
||||
@ -44,6 +44,6 @@
|
||||
-u ,dsa-usrname1
|
||||
--recipient ,dsa-usrname2
|
||||
--digest-algo ,hash))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity (car plain-files))))
|
||||
algos)
|
||||
|
@ -26,14 +26,14 @@
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg usrpass1 `(--yes --passphrase-fd "0" -se --recipient ,usrname2))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files))
|
||||
|
||||
(info "Checking bug 537: MDC problem with old style compressed packets.")
|
||||
(lettmp (tmp)
|
||||
(call-popen `(,@GPG --yes --passphrase-fd "0"
|
||||
--output ,tmp ,(in-srcdir "bug537-test.data.asc"))
|
||||
--output ,tmp --decrypt ,(in-srcdir "bug537-test.data.asc"))
|
||||
usrpass1)
|
||||
(if (not (string=? "4336AE2A528FAE091E73E59E325B588FEE795F9B"
|
||||
(cadar (gpg-hash-string `(--print-md SHA1 ,tmp) ""))))
|
||||
|
@ -26,7 +26,7 @@
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg "" `(--yes --sign --user ,dsa-usrname1))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files))
|
||||
|
||||
@ -39,6 +39,6 @@
|
||||
(tr:do
|
||||
(tr:open (car plain-files))
|
||||
(tr:gpg "" `(--yes --sign --user ,dsa-usrname1 --digest-algo ,hash))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity (car plain-files))))
|
||||
algos)
|
||||
|
@ -26,7 +26,7 @@
|
||||
(tr:do
|
||||
(tr:open source)
|
||||
(tr:gpg "" '(--yes --sign))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity source)))
|
||||
(append plain-files data-files))
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
(tr:do
|
||||
(tr:open (car plain-files))
|
||||
(tr:gpg "" `(--yes --sign --user ,usrname3 --digest-algo ,hash))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity (car plain-files))))
|
||||
(if (not (equal? "MD5" hash))
|
||||
;; Using the DSA sig key - only 160 bit or larger hashes
|
||||
@ -46,6 +46,6 @@
|
||||
(tr:open (car plain-files))
|
||||
(tr:gpg usrpass1
|
||||
`(--yes --sign --passphrase-fd "0" --digest-algo ,hash))
|
||||
(tr:gpg "" '(--yes))
|
||||
(tr:gpg "" '(--yes --decrypt))
|
||||
(tr:assert-identity (car plain-files)))))
|
||||
(force all-hash-algos))
|
||||
|
Loading…
x
Reference in New Issue
Block a user