1 # $NetBSD: verify.at,v 1.9 2009/06/11 02:55:35 lukem Exp $
3 AT_SETUP([simple signature and verification])
5 AT_CHECK([cp ${TOPSRCDIR}/configure file1], [0], [ignore], [ignore])
8 AT_CHECK([netpgp --homedir $testhomedir --sign file1],
9 [0], [ignore], [ignore])
11 # Verify the signed file
12 AT_CHECK([netpgp --homedir $testhomedir --verify file1.gpg],
13 [0], [ignore], [ignore])
15 # Fail to verify an unsigned file
16 AT_CHECK([netpgp --homedir $testhomedir --verify file1],
17 [1], [ignore], [stderr])
18 AT_CHECK([grep 'No signatures found - is this a signed file?' stderr],
19 [0], [ignore], [ignore])
21 # Deliberately corrupt file2.gpg and attempt to verify
22 sed -e 's|1|2|' file1.gpg > file2.gpg
23 AT_CHECK([netpgp --homedir $testhomedir --verify file2.gpg],
24 [1], [ignore], [stderr])
25 AT_CHECK([grep 'verification failure: 1 invalid signature' stderr],
26 [0], [ignore], [ignore])