1998-02-26 17:56:31 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
1998-12-09 13:44:46 +01:00
|
|
|
# Fixme: we should not only do a --verify but also the output.
|
|
|
|
|
1998-09-14 12:33:57 +02:00
|
|
|
. $srcdir/defs.inc || exit 3
|
1998-02-26 17:56:31 +01:00
|
|
|
|
1999-02-19 15:54:00 +01:00
|
|
|
# ======================================
|
1998-07-08 11:29:43 +02:00
|
|
|
# I can't compare the out because plain-3 has no LF as last charcater
|
|
|
|
# but the output has always one. I do not thinkl this is a bug, because
|
|
|
|
# it is clear text and not binary text.
|
1999-02-19 15:54:00 +01:00
|
|
|
# ======================================
|
|
|
|
for i in $plain_files plain-large ; do
|
2002-06-29 15:31:13 +02:00
|
|
|
echo "$usrpass1" | $GPG --passphrase-fd 0 -sat -o x --yes $i
|
|
|
|
$GPG --verify x
|
1998-07-08 11:29:43 +02:00
|
|
|
done
|
1999-02-19 15:54:00 +01:00
|
|
|
|
* clearsig.test, conventional-mdc.test, conventional.test, defs.inc,
encrypt-dsa.test, encrypt.test, genkey1024.test, plain-1.asc,
plain-1-pgp.asc, plain-2.asc, plain-3.asc, pubring.asc, secring.asc,
sigs.test: Rework tests to work properly with a gpg binary that doesn't
have all ciphers and all pk algos. Basically, we test for the ciphers we
have, only test signing with non-160-bit hashes with RSA (we test all
hashes as hashes). Test all key lengths of AES.
2003-12-31 20:00:35 +01:00
|
|
|
|
1999-02-19 15:54:00 +01:00
|
|
|
# ======================================
|
1998-07-08 11:29:43 +02:00
|
|
|
# and once more to check rfc1991
|
1999-02-19 15:54:00 +01:00
|
|
|
# ======================================
|
* clearsig.test, conventional-mdc.test, conventional.test, defs.inc,
encrypt-dsa.test, encrypt.test, genkey1024.test, plain-1.asc,
plain-1-pgp.asc, plain-2.asc, plain-3.asc, pubring.asc, secring.asc,
sigs.test: Rework tests to work properly with a gpg binary that doesn't
have all ciphers and all pk algos. Basically, we test for the ciphers we
have, only test signing with non-160-bit hashes with RSA (we test all
hashes as hashes). Test all key lengths of AES.
2003-12-31 20:00:35 +01:00
|
|
|
|
2004-02-09 20:44:36 +01:00
|
|
|
if have_pubkey_algo "RSA"; then
|
* clearsig.test, conventional-mdc.test, conventional.test, defs.inc,
encrypt-dsa.test, encrypt.test, genkey1024.test, plain-1.asc,
plain-1-pgp.asc, plain-2.asc, plain-3.asc, pubring.asc, secring.asc,
sigs.test: Rework tests to work properly with a gpg binary that doesn't
have all ciphers and all pk algos. Basically, we test for the ciphers we
have, only test signing with non-160-bit hashes with RSA (we test all
hashes as hashes). Test all key lengths of AES.
2003-12-31 20:00:35 +01:00
|
|
|
for i in $plain_files plain-large ; do
|
2004-02-09 20:44:36 +01:00
|
|
|
$GPG -u $usrname3 --rfc1991 --digest-algo md5 -sat -o x --yes $i
|
* clearsig.test, conventional-mdc.test, conventional.test, defs.inc,
encrypt-dsa.test, encrypt.test, genkey1024.test, plain-1.asc,
plain-1-pgp.asc, plain-2.asc, plain-3.asc, pubring.asc, secring.asc,
sigs.test: Rework tests to work properly with a gpg binary that doesn't
have all ciphers and all pk algos. Basically, we test for the ciphers we
have, only test signing with non-160-bit hashes with RSA (we test all
hashes as hashes). Test all key lengths of AES.
2003-12-31 20:00:35 +01:00
|
|
|
$GPG --verify x
|
|
|
|
done
|
|
|
|
fi
|
1999-02-19 15:54:00 +01:00
|
|
|
|
|
|
|
# ======================================
|
1998-11-27 15:33:31 +01:00
|
|
|
# and one with long lines
|
1999-02-19 15:54:00 +01:00
|
|
|
# ======================================
|
1998-11-27 15:33:31 +01:00
|
|
|
cat >y <<EOF
|
|
|
|
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyx
|
|
|
|
|
|
|
|
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
EOF
|
2002-06-29 15:31:13 +02:00
|
|
|
echo "$usrpass1" | $GPG --passphrase-fd 0 --clearsign -o x --yes y
|
|
|
|
$GPG --verify x
|
1999-02-19 15:54:00 +01:00
|
|
|
|
* clearsig.test, conventional-mdc.test, conventional.test, defs.inc,
encrypt-dsa.test, encrypt.test, genkey1024.test, plain-1.asc,
plain-1-pgp.asc, plain-2.asc, plain-3.asc, pubring.asc, secring.asc,
sigs.test: Rework tests to work properly with a gpg binary that doesn't
have all ciphers and all pk algos. Basically, we test for the ciphers we
have, only test signing with non-160-bit hashes with RSA (we test all
hashes as hashes). Test all key lengths of AES.
2003-12-31 20:00:35 +01:00
|
|
|
|
1999-02-19 15:54:00 +01:00
|
|
|
# ======================================
|
1998-11-27 15:33:31 +01:00
|
|
|
# and one with only one long lines
|
1999-02-19 15:54:00 +01:00
|
|
|
# ======================================
|
1998-11-27 15:33:31 +01:00
|
|
|
cat >y <<EOF
|
|
|
|
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyx
|
|
|
|
EOF
|
2002-06-29 15:31:13 +02:00
|
|
|
echo "$usrpass1" | $GPG --passphrase-fd 0 --clearsign -o x --yes y
|
|
|
|
$GPG --verify x
|
* clearsig.test, conventional-mdc.test, conventional.test, defs.inc,
encrypt-dsa.test, encrypt.test, genkey1024.test, plain-1.asc,
plain-1-pgp.asc, plain-2.asc, plain-3.asc, pubring.asc, secring.asc,
sigs.test: Rework tests to work properly with a gpg binary that doesn't
have all ciphers and all pk algos. Basically, we test for the ciphers we
have, only test signing with non-160-bit hashes with RSA (we test all
hashes as hashes). Test all key lengths of AES.
2003-12-31 20:00:35 +01:00
|
|
|
|
|
|
|
|
2002-06-29 15:31:13 +02:00
|
|
|
# ======================================
|
1998-11-27 15:33:31 +01:00
|
|
|
# and one with an empty body
|
1999-02-19 15:54:00 +01:00
|
|
|
# ======================================
|
1998-11-27 15:33:31 +01:00
|
|
|
cat >y <<EOF
|
|
|
|
EOF
|
2002-06-29 15:31:13 +02:00
|
|
|
echo "$usrpass1" | $GPG --passphrase-fd 0 --clearsign -o x --yes y
|
|
|
|
$GPG --verify x
|
1998-11-27 15:33:31 +01:00
|
|
|
|
* clearsig.test, conventional-mdc.test, conventional.test, defs.inc,
encrypt-dsa.test, encrypt.test, genkey1024.test, plain-1.asc,
plain-1-pgp.asc, plain-2.asc, plain-3.asc, pubring.asc, secring.asc,
sigs.test: Rework tests to work properly with a gpg binary that doesn't
have all ciphers and all pk algos. Basically, we test for the ciphers we
have, only test signing with non-160-bit hashes with RSA (we test all
hashes as hashes). Test all key lengths of AES.
2003-12-31 20:00:35 +01:00
|
|
|
|
1999-02-19 15:54:00 +01:00
|
|
|
# ======================================
|
1998-12-09 13:44:46 +01:00
|
|
|
# and one with one empty line at the end
|
1999-02-19 15:54:00 +01:00
|
|
|
# ======================================
|
1998-12-09 13:44:46 +01:00
|
|
|
cat >y <<EOF
|
|
|
|
line 1
|
|
|
|
line 2
|
|
|
|
line 3
|
|
|
|
there is a blank line after this
|
|
|
|
|
|
|
|
EOF
|
2002-06-29 15:31:13 +02:00
|
|
|
echo "$usrpass1" | $GPG --passphrase-fd 0 --clearsign -o x --yes y
|
|
|
|
$GPG --verify x
|
1998-12-09 13:44:46 +01:00
|
|
|
|
1998-02-26 17:56:31 +01:00
|
|
|
|
1999-02-19 15:54:00 +01:00
|
|
|
# ======================================
|
2002-06-29 15:31:13 +02:00
|
|
|
# I think this file will be constructed wrong (gpg 0.9.3)
|
1999-02-19 15:54:00 +01:00
|
|
|
# but it should verify okay anyway.
|
|
|
|
# ======================================
|
|
|
|
echo "this is a sig test" >y
|
1999-08-04 10:45:27 +02:00
|
|
|
echo_n " " >>y
|
2002-06-29 15:31:13 +02:00
|
|
|
echo "$usrpass1" | $GPG --passphrase-fd 0 --clearsign -o x --yes y
|
|
|
|
$GPG --verify x
|
|
|
|
|
1999-02-19 15:54:00 +01:00
|
|
|
|
2002-06-29 15:31:13 +02:00
|
|
|
# ======================================
|
|
|
|
# check our special diff mode
|
|
|
|
# ======================================
|
|
|
|
cat >y <<EOF
|
|
|
|
--- mainproc.c Tue Jun 27 09:28:11 2000
|
|
|
|
+++ mainproc.c~ Thu Jun 8 22:50:25 2000
|
|
|
|
@@ -1190,16 +1190,13 @@
|
|
|
|
md_enable( c->mfx.md, n1->pkt->pkt.signature->digest_algo);
|
|
|
|
}
|
|
|
|
/* ask for file and hash it */
|
|
|
|
- if( c->sigs_only ) {
|
|
|
|
+ if( c->sigs_only )
|
|
|
|
rc = hash_datafiles( c->mfx.md, NULL,
|
|
|
|
c->signed_data, c->sigfilename,
|
|
|
|
n1? (n1->pkt->pkt.onepass_sig->sig_class == 0x01):0 );
|
|
|
|
EOF
|
|
|
|
echo "$usrpass1" | $GPG --passphrase-fd 0 \
|
|
|
|
--not-dash-escaped --clearsign -o x --yes y
|
|
|
|
$GPG --verify x
|