* keygen.c (keygen_get_std_prefs): Set reference count when creating the
[gnupg.git] / checks / multisig.test
1 #!/bin/sh
2 # Check that gpg verifies only signatures where there is no ambiguity
3 # in the order of packets.  Needs the Demo Keys Lima and Mike.
4
5 . $srcdir/defs.inc || exit 3
6
7 # (variable intialization was created using:
8 #   for i in files; do echo "`echo $i | sed 's,[.-],_,g'`='"; \
9 #   gpg --no-version --enarmor <$i | grep -v ^Comment:; echo "'" ; done 
10 # )
11
12 sig_1ls1ls_valid='
13 -----BEGIN PGP ARMORED FILE-----
14
15 kA0DAAIRN8q1H7eRA/gBrCdiBXRleHQxOogq9EkgYW0gc29ycnksIEkgY2FuJ3Qg
16 ZG8gdGhhdAqIPwMFADqIKvQ3yrUft5ED+BEC2joAoJaSaXOZEtSZqQ780HIXG77e
17 8PB7AJ4wCprmaFTO0fBaTcXDuEOBdAWnOZANAwACETfKtR+3kQP4AawnYgV0ZXh0
18 MTqIKvRJIGFtIHNvcnJ5LCBJIGNhbid0IGRvIHRoYXQKiD8DBQA6iCr0N8q1H7eR
19 A/gRAto6AKCWkmlzmRLUmakO/NByFxu+3vDwewCeMAqa5mhUztHwWk3Fw7hDgXQF
20 pzk=
21 =8jSC
22 -----END PGP ARMORED FILE-----
23 '
24 sig_ls_valid='
25 -----BEGIN PGP ARMORED FILE-----
26
27 rCdiBXRleHQxOogrS0kgYW0gc29ycnksIEkgY2FuJ3QgZG8gdGhhdAqIPwMFADqI
28 K0s3yrUft5ED+BECLQMAn2jZUNOpB4OuurSQkc2TRfg6ek02AJ9+oJS0frQ+yUsT
29 QDUFTH2PvZRxjw==
30 =J+lb
31 -----END PGP ARMORED FILE-----
32 '
33 sig_sl_valid='
34 -----BEGIN PGP ARMORED FILE-----
35
36 iD8DBQA6iCtLN8q1H7eRA/gRAi0DAJ9o2VDTqQeDrrq0kJHNk0X4OnpNNgCffqCU
37 tH60PslLE0A1BUx9j72UcY+sJ2IFdGV4dDE6iCtLSSBhbSBzb3JyeSwgSSBjYW4n
38 dCBkbyB0aGF0Cg==
39 =N9MP
40 -----END PGP ARMORED FILE-----
41 '
42 sig_11lss_valid_but_is_not='
43 -----BEGIN PGP ARMORED FILE-----
44
45 kA0DAAIRN8q1H7eRA/gAkA0DAAIRN8q1H7eRA/gBrCdiBXRleHQxOogyXUkgYW0g
46 c29ycnksIEkgY2FuJ3QgZG8gdGhhdAqIPwMFADqIMl03yrUft5ED+BECwQAAnRXT
47 mXjVd385oD38W80XuheWKTGcAJ9pZ6/flaKDfw+SLido7xaUHuhp5Yg/AwUAOogy
48 XTfKtR+3kQP4EQLBAACgnN0IP+NztE0aAc/DZ17yHWR9diwAniN0P01WmbgZJoZB
49 Q341WRXKS/at
50 =Ekrs
51 -----END PGP ARMORED FILE-----
52 '
53 sig_11lss11lss_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/atkA0DAAIRN8q1H7eRA/gAkA0DAAIRN8q1H7eRA/gBrCdiBXRleHQx
61 OogyXUkgYW0gc29ycnksIEkgY2FuJ3QgZG8gdGhhdAqIPwMFADqIMl03yrUft5ED
62 +BECwQAAnRXTmXjVd385oD38W80XuheWKTGcAJ9pZ6/flaKDfw+SLido7xaUHuhp
63 5Yg/AwUAOogyXTfKtR+3kQP4EQLBAACgnN0IP+NztE0aAc/DZ17yHWR9diwAniN0
64 P01WmbgZJoZBQ341WRXKS/at
65 =P1Mu
66 -----END PGP ARMORED FILE-----
67 '
68 sig_ssl_valid_but_is_not='
69 -----BEGIN PGP ARMORED FILE-----
70
71 iD8DBQA6iCtLN8q1H7eRA/gRAi0DAJ9o2VDTqQeDrrq0kJHNk0X4OnpNNgCffqCU
72 tH60PslLE0A1BUx9j72UcY+IPwMFADqIK0s3yrUft5ED+BECLQMAn2jZUNOpB4Ou
73 urSQkc2TRfg6ek02AJ9+oJS0frQ+yUsTQDUFTH2PvZRxj6wnYgV0ZXh0MTqIK0tJ
74 IGFtIHNvcnJ5LCBJIGNhbid0IGRvIHRoYXQK
75 =Zven
76 -----END PGP ARMORED FILE-----
77 '
78 sig_1lsls_invalid='
79 -----BEGIN PGP ARMORED FILE-----
80
81 kA0DAAIRN8q1H7eRA/gBrCdiBXRleHQxOogq9EkgYW0gc29ycnksIEkgY2FuJ3Qg
82 ZG8gdGhhdAqIPwMFADqIKvQ3yrUft5ED+BEC2joAoJaSaXOZEtSZqQ780HIXG77e
83 8PB7AJ4wCprmaFTO0fBaTcXDuEOBdAWnOawnYgV0ZXh0MTqIK0tJIGFtIHNvcnJ5
84 LCBJIGNhbid0IGRvIHRoYXQKiD8DBQA6iCtLN8q1H7eRA/gRAi0DAJ9o2VDTqQeD
85 rrq0kJHNk0X4OnpNNgCffqCUtH60PslLE0A1BUx9j72UcY8=
86 =nkeu
87 -----END PGP ARMORED FILE-----
88 '
89 sig_lsls_invalid='
90 -----BEGIN PGP ARMORED FILE-----
91
92 rCdiBXRleHQxOogrS0kgYW0gc29ycnksIEkgY2FuJ3QgZG8gdGhhdAqIPwMFADqI
93 K0s3yrUft5ED+BECLQMAn2jZUNOpB4OuurSQkc2TRfg6ek02AJ9+oJS0frQ+yUsT
94 QDUFTH2PvZRxj6wnYgV0ZXh0MTqIK0tJIGFtIHNvcnJ5LCBJIGNhbid0IGRvIHRo
95 YXQKiD8DBQA6iCtLN8q1H7eRA/gRAi0DAJ9o2VDTqQeDrrq0kJHNk0X4OnpNNgCf
96 fqCUtH60PslLE0A1BUx9j72UcY8=
97 =BlZH
98 -----END PGP ARMORED FILE-----
99 '
100 sig_lss_invalid='
101 -----BEGIN PGP ARMORED FILE-----
102
103 rCdiBXRleHQxOogrS0kgYW0gc29ycnksIEkgY2FuJ3QgZG8gdGhhdAqIPwMFADqI
104 K0s3yrUft5ED+BECLQMAn2jZUNOpB4OuurSQkc2TRfg6ek02AJ9+oJS0frQ+yUsT
105 QDUFTH2PvZRxj4g/AwUAOogrSzfKtR+3kQP4EQItAwCfaNlQ06kHg666tJCRzZNF
106 +Dp6TTYAn36glLR+tD7JSxNANQVMfY+9lHGP
107 =jmt6
108 -----END PGP ARMORED FILE-----
109 '
110 sig_slsl_invalid='
111 -----BEGIN PGP ARMORED FILE-----
112
113 iD8DBQA6iCtLN8q1H7eRA/gRAi0DAJ9o2VDTqQeDrrq0kJHNk0X4OnpNNgCffqCU
114 tH60PslLE0A1BUx9j72UcY+sJ2IFdGV4dDE6iCtLSSBhbSBzb3JyeSwgSSBjYW4n
115 dCBkbyB0aGF0Cog/AwUAOogrSzfKtR+3kQP4EQItAwCfaNlQ06kHg666tJCRzZNF
116 +Dp6TTYAn36glLR+tD7JSxNANQVMfY+9lHGPrCdiBXRleHQxOogrS0kgYW0gc29y
117 cnksIEkgY2FuJ3QgZG8gdGhhdAo=
118 =phBF
119 -----END PGP ARMORED FILE-----
120 '
121
122 save_IFS="${IFS}"
123 IFS=""
124 for i in "$sig_1ls1ls_valid" "$sig_ls_valid" "$sig_sl_valid"; do
125     echo "$i" | ./gpg_dearmor >x
126     IFS="${save_IFS}"
127     $GPG --verify x 2>/dev/null || error "valid is invalid"
128     IFS=""
129 done
130 #for i in "$sig_11lss_valid_but_is_not" "$sig_11lss11lss_valid_but_is_not" \
131 #         "$sig_ssl_valid_but_is_not"; do
132 #    echo "$i" | $GPG --dearmor >x
133 #    $GPG --verify <x 2>/dev/null || error "valid is invalid"
134 #done
135
136 # without the +e ksh seems to terminate the for loop
137 set +e
138 for i in "$sig_1lsls_invalid" "$sig_lsls_invalid" \
139          "$sig_lss_invalid" "$sig_slsl_invalid" ; do
140     echo "$i" | ./gpg_dearmor >x
141     IFS="${save_IFS}"
142     $GPG --verify <x 2>/dev/null && error "invalid is valid"
143     IFS=""
144 done
145 IFS="${save_IFS}"