Wed May 27 07:00:32 2009 UTC ()
Ensure we can't verify an unsigned file
Rename a test filename
Add some comments


(lukem)
diff -r1.2 -r1.3 src/crypto/external/bsd/netpgp/dist/tests/verify.at

cvs diff -r1.2 -r1.3 src/crypto/external/bsd/netpgp/dist/tests/verify.at (expand / switch to context diff)
--- src/crypto/external/bsd/netpgp/dist/tests/verify.at 2009/05/27 06:47:57 1.2
+++ src/crypto/external/bsd/netpgp/dist/tests/verify.at 2009/05/27 07:00:32 1.3
@@ -1,13 +1,27 @@
-# $NetBSD: verify.at,v 1.2 2009/05/27 06:47:57 lukem Exp $
+# $NetBSD: verify.at,v 1.3 2009/05/27 07:00:32 lukem Exp $
 
 AT_SETUP([check-verify])
 
-cp ${TOPSRCDIR}/configure a
+cp ${TOPSRCDIR}/configure file1
 
-AT_CHECK([$NETPGP --homedir $testhomedir --sign a],
+# Sign the file
+# XXX: this prompts for a passphrase when the userid doesn't have one
+AT_CHECK([$NETPGP --homedir $testhomedir --sign file1],
     [0], [ignore], [ignore])
 
-AT_CHECK([$NETPGP --homedir $testhomedir --verify a.gpg],
+# Verify the signed file
+AT_CHECK([$NETPGP --homedir $testhomedir --verify file1.gpg],
     [0], [ignore], [ignore])
+
+# Fail to verify an unsigned file
+# XXX: determine how to expand $testuserid instead of hard-coding
+AT_CHECK([$NETPGP --homedir $testhomedir --verify file1],
+    [1], [ignore],
+[netpgp: default key set to "C7AB5F325F918728"
+"file1": No signatures found - is this a signed file?
+])
+
+# XXXTODO: deliberately corrupt file1.gpg and attempt to verify
+
 
 AT_CLEANUP