Ported changes from 1.4.
[gnupg.git] / tests / openpgp / multisig.test
1 #!/bin/sh
2 # Copyright 2001,2002,2003,2004,2005,2006,
3 #           2007 Free Software Foundation, Inc.
4 # This file is free software; as a special exception the author gives
5 # unlimited permission to copy and/or distribute it, with or without
6 # modifications, as long as this notice is preserved.  This file is
7 # distributed in the hope that it will be useful, but WITHOUT ANY
8 # WARRANTY, to the extent permitted by law; without even the implied
9 # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
11 # Check that gpg verifies only signatures where there is no ambiguity
12 # in the order of packets.  Needs the Demo Keys Lima and Mike.
13
14 # Note: We do son't support multiple signaturess anymore thus thsi test is 
15 # not really needed becuase verify could do the same.  We keep it anyway.
16
17 . $srcdir/defs.inc || exit 3
18
19 suspend_error
20
21
22
23 sig_1ls1ls_valid='
24 -----BEGIN PGP ARMORED FILE-----
25
26 kA0DAAIRN8q1H7eRA/gBrCdiBXRleHQxOogq9EkgYW0gc29ycnksIEkgY2FuJ3Qg
27 ZG8gdGhhdAqIPwMFADqIKvQ3yrUft5ED+BEC2joAoJaSaXOZEtSZqQ780HIXG77e
28 8PB7AJ4wCprmaFTO0fBaTcXDuEOBdAWnOZANAwACETfKtR+3kQP4AawnYgV0ZXh0
29 MTqIKvRJIGFtIHNvcnJ5LCBJIGNhbid0IGRvIHRoYXQKiD8DBQA6iCr0N8q1H7eR
30 A/gRAto6AKCWkmlzmRLUmakO/NByFxu+3vDwewCeMAqa5mhUztHwWk3Fw7hDgXQF
31 pzk=
32 =8jSC
33 -----END PGP ARMORED FILE-----
34 '
35 sig_ls_valid='
36 -----BEGIN PGP ARMORED FILE-----
37
38 rCdiBXRleHQxOogrS0kgYW0gc29ycnksIEkgY2FuJ3QgZG8gdGhhdAqIPwMFADqI
39 K0s3yrUft5ED+BECLQMAn2jZUNOpB4OuurSQkc2TRfg6ek02AJ9+oJS0frQ+yUsT
40 QDUFTH2PvZRxjw==
41 =J+lb
42 -----END PGP ARMORED FILE-----
43 '
44 sig_sl_valid='
45 -----BEGIN PGP ARMORED FILE-----
46
47 iD8DBQA6iCtLN8q1H7eRA/gRAi0DAJ9o2VDTqQeDrrq0kJHNk0X4OnpNNgCffqCU
48 tH60PslLE0A1BUx9j72UcY+sJ2IFdGV4dDE6iCtLSSBhbSBzb3JyeSwgSSBjYW4n
49 dCBkbyB0aGF0Cg==
50 =N9MP
51 -----END PGP ARMORED FILE-----
52 '
53 sig_11lss_valid_but_is_not='
54 -----BEGIN PGP ARMORED FILE-----
55
56 kA0DAAIRN8q1H7eRA/gAkA0DAAIRN8q1H7eRA/gBrCdiBXRleHQxOogyXUkgYW0g
57 c29ycnksIEkgY2FuJ3QgZG8gdGhhdAqIPwMFADqIMl03yrUft5ED+BECwQAAnRXT
58 mXjVd385oD38W80XuheWKTGcAJ9pZ6/flaKDfw+SLido7xaUHuhp5Yg/AwUAOogy
59 XTfKtR+3kQP4EQLBAACgnN0IP+NztE0aAc/DZ17yHWR9diwAniN0P01WmbgZJoZB
60 Q341WRXKS/at
61 =Ekrs
62 -----END PGP ARMORED FILE-----
63 '
64 sig_11lss11lss_valid_but_is_not='
65 -----BEGIN PGP ARMORED FILE-----
66
67 kA0DAAIRN8q1H7eRA/gAkA0DAAIRN8q1H7eRA/gBrCdiBXRleHQxOogyXUkgYW0g
68 c29ycnksIEkgY2FuJ3QgZG8gdGhhdAqIPwMFADqIMl03yrUft5ED+BECwQAAnRXT
69 mXjVd385oD38W80XuheWKTGcAJ9pZ6/flaKDfw+SLido7xaUHuhp5Yg/AwUAOogy
70 XTfKtR+3kQP4EQLBAACgnN0IP+NztE0aAc/DZ17yHWR9diwAniN0P01WmbgZJoZB
71 Q341WRXKS/atkA0DAAIRN8q1H7eRA/gAkA0DAAIRN8q1H7eRA/gBrCdiBXRleHQx
72 OogyXUkgYW0gc29ycnksIEkgY2FuJ3QgZG8gdGhhdAqIPwMFADqIMl03yrUft5ED
73 +BECwQAAnRXTmXjVd385oD38W80XuheWKTGcAJ9pZ6/flaKDfw+SLido7xaUHuhp
74 5Yg/AwUAOogyXTfKtR+3kQP4EQLBAACgnN0IP+NztE0aAc/DZ17yHWR9diwAniN0
75 P01WmbgZJoZBQ341WRXKS/at
76 =P1Mu
77 -----END PGP ARMORED FILE-----
78 '
79 sig_ssl_valid_but_is_not='
80 -----BEGIN PGP ARMORED FILE-----
81
82 iD8DBQA6iCtLN8q1H7eRA/gRAi0DAJ9o2VDTqQeDrrq0kJHNk0X4OnpNNgCffqCU
83 tH60PslLE0A1BUx9j72UcY+IPwMFADqIK0s3yrUft5ED+BECLQMAn2jZUNOpB4Ou
84 urSQkc2TRfg6ek02AJ9+oJS0frQ+yUsTQDUFTH2PvZRxj6wnYgV0ZXh0MTqIK0tJ
85 IGFtIHNvcnJ5LCBJIGNhbid0IGRvIHRoYXQK
86 =Zven
87 -----END PGP ARMORED FILE-----
88 '
89 sig_1lsls_invalid='
90 -----BEGIN PGP ARMORED FILE-----
91
92 kA0DAAIRN8q1H7eRA/gBrCdiBXRleHQxOogq9EkgYW0gc29ycnksIEkgY2FuJ3Qg
93 ZG8gdGhhdAqIPwMFADqIKvQ3yrUft5ED+BEC2joAoJaSaXOZEtSZqQ780HIXG77e
94 8PB7AJ4wCprmaFTO0fBaTcXDuEOBdAWnOawnYgV0ZXh0MTqIK0tJIGFtIHNvcnJ5
95 LCBJIGNhbid0IGRvIHRoYXQKiD8DBQA6iCtLN8q1H7eRA/gRAi0DAJ9o2VDTqQeD
96 rrq0kJHNk0X4OnpNNgCffqCUtH60PslLE0A1BUx9j72UcY8=
97 =nkeu
98 -----END PGP ARMORED FILE-----
99 '
100 sig_lsls_invalid='
101 -----BEGIN PGP ARMORED FILE-----
102
103 rCdiBXRleHQxOogrS0kgYW0gc29ycnksIEkgY2FuJ3QgZG8gdGhhdAqIPwMFADqI
104 K0s3yrUft5ED+BECLQMAn2jZUNOpB4OuurSQkc2TRfg6ek02AJ9+oJS0frQ+yUsT
105 QDUFTH2PvZRxj6wnYgV0ZXh0MTqIK0tJIGFtIHNvcnJ5LCBJIGNhbid0IGRvIHRo
106 YXQKiD8DBQA6iCtLN8q1H7eRA/gRAi0DAJ9o2VDTqQeDrrq0kJHNk0X4OnpNNgCf
107 fqCUtH60PslLE0A1BUx9j72UcY8=
108 =BlZH
109 -----END PGP ARMORED FILE-----
110 '
111 sig_lss_invalid='
112 -----BEGIN PGP ARMORED FILE-----
113
114 rCdiBXRleHQxOogrS0kgYW0gc29ycnksIEkgY2FuJ3QgZG8gdGhhdAqIPwMFADqI
115 K0s3yrUft5ED+BECLQMAn2jZUNOpB4OuurSQkc2TRfg6ek02AJ9+oJS0frQ+yUsT
116 QDUFTH2PvZRxj4g/AwUAOogrSzfKtR+3kQP4EQItAwCfaNlQ06kHg666tJCRzZNF
117 +Dp6TTYAn36glLR+tD7JSxNANQVMfY+9lHGP
118 =jmt6
119 -----END PGP ARMORED FILE-----
120 '
121 sig_slsl_invalid='
122 -----BEGIN PGP ARMORED FILE-----
123
124 iD8DBQA6iCtLN8q1H7eRA/gRAi0DAJ9o2VDTqQeDrrq0kJHNk0X4OnpNNgCffqCU
125 tH60PslLE0A1BUx9j72UcY+sJ2IFdGV4dDE6iCtLSSBhbSBzb3JyeSwgSSBjYW4n
126 dCBkbyB0aGF0Cog/AwUAOogrSzfKtR+3kQP4EQItAwCfaNlQ06kHg666tJCRzZNF
127 +Dp6TTYAn36glLR+tD7JSxNANQVMfY+9lHGPrCdiBXRleHQxOogrS0kgYW0gc29y
128 cnksIEkgY2FuJ3QgZG8gdGhhdAo=
129 =phBF
130 -----END PGP ARMORED FILE-----
131 '
132
133
134 for i in  sig_sl_valid ; do
135     eval "(IFS=; echo \"\$$i\")" | ./gpg_dearmor >x
136     $GPG --verify x 2>/dev/null || error "valid is invalid ($i)"
137     linefeed
138 done
139 #for i in "$sig_11lss_valid_but_is_not" "$sig_11lss11lss_valid_but_is_not" \
140 #         "$sig_ssl_valid_but_is_not"; do
141 #    echo "$i" | $GPG --dearmor >x
142 #    $GPG --verify <x 2>/dev/null || error "valid is invalid"
143 #done
144
145 for i in sig_1ls1ls_valid sig_ls_valid \
146          sig_1lsls_invalid sig_lsls_invalid \
147          sig_lss_invalid sig_slsl_invalid ; do
148     eval "(IFS=; echo \"\$$i\")" | ./gpg_dearmor >x
149     $GPG --verify <x 2>/dev/null && error "invalid is valid ($i)"
150     linefeed
151 done
152
153
154 resume_error