diff options
Diffstat (limited to 'src/lib/libcrypto/x509v3')
24 files changed, 3967 insertions, 1380 deletions
diff --git a/src/lib/libcrypto/x509v3/Makefile b/src/lib/libcrypto/x509v3/Makefile new file mode 100644 index 0000000000..556ef351bf --- /dev/null +++ b/src/lib/libcrypto/x509v3/Makefile | |||
@@ -0,0 +1,591 @@ | |||
1 | # | ||
2 | # OpenSSL/crypto/x509v3/Makefile | ||
3 | # | ||
4 | |||
5 | DIR= x509v3 | ||
6 | TOP= ../.. | ||
7 | CC= cc | ||
8 | INCLUDES= -I.. -I$(TOP) -I../../include | ||
9 | CFLAG=-g | ||
10 | MAKEFILE= Makefile | ||
11 | AR= ar r | ||
12 | |||
13 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
14 | |||
15 | GENERAL=Makefile README | ||
16 | TEST= | ||
17 | APPS= | ||
18 | |||
19 | LIB=$(TOP)/libcrypto.a | ||
20 | LIBSRC= v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c v3_lib.c \ | ||
21 | v3_prn.c v3_utl.c v3err.c v3_genn.c v3_alt.c v3_skey.c v3_akey.c v3_pku.c \ | ||
22 | v3_int.c v3_enum.c v3_sxnet.c v3_cpols.c v3_crld.c v3_purp.c v3_info.c \ | ||
23 | v3_ocsp.c v3_akeya.c v3_pmaps.c v3_pcons.c v3_ncons.c v3_pcia.c v3_pci.c \ | ||
24 | pcy_cache.c pcy_node.c pcy_data.c pcy_map.c pcy_tree.c pcy_lib.c \ | ||
25 | v3_asid.c v3_addr.c | ||
26 | LIBOBJ= v3_bcons.o v3_bitst.o v3_conf.o v3_extku.o v3_ia5.o v3_lib.o \ | ||
27 | v3_prn.o v3_utl.o v3err.o v3_genn.o v3_alt.o v3_skey.o v3_akey.o v3_pku.o \ | ||
28 | v3_int.o v3_enum.o v3_sxnet.o v3_cpols.o v3_crld.o v3_purp.o v3_info.o \ | ||
29 | v3_ocsp.o v3_akeya.o v3_pmaps.o v3_pcons.o v3_ncons.o v3_pcia.o v3_pci.o \ | ||
30 | pcy_cache.o pcy_node.o pcy_data.o pcy_map.o pcy_tree.o pcy_lib.o \ | ||
31 | v3_asid.o v3_addr.o | ||
32 | |||
33 | SRC= $(LIBSRC) | ||
34 | |||
35 | EXHEADER= x509v3.h | ||
36 | HEADER= $(EXHEADER) pcy_int.h | ||
37 | |||
38 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
39 | |||
40 | top: | ||
41 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) | ||
42 | |||
43 | all: lib | ||
44 | |||
45 | lib: $(LIBOBJ) | ||
46 | $(AR) $(LIB) $(LIBOBJ) | ||
47 | $(RANLIB) $(LIB) || echo Never mind. | ||
48 | @touch lib | ||
49 | |||
50 | files: | ||
51 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | ||
52 | |||
53 | links: | ||
54 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) | ||
55 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) | ||
56 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) | ||
57 | |||
58 | install: | ||
59 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... | ||
60 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ | ||
61 | do \ | ||
62 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | ||
63 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | ||
64 | done; | ||
65 | |||
66 | tags: | ||
67 | ctags $(SRC) | ||
68 | |||
69 | tests: | ||
70 | |||
71 | lint: | ||
72 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
73 | |||
74 | depend: | ||
75 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... | ||
76 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) | ||
77 | |||
78 | dclean: | ||
79 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
80 | mv -f Makefile.new $(MAKEFILE) | ||
81 | |||
82 | clean: | ||
83 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
84 | |||
85 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
86 | |||
87 | pcy_cache.o: ../../e_os.h ../../include/openssl/asn1.h | ||
88 | pcy_cache.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
89 | pcy_cache.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
90 | pcy_cache.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
91 | pcy_cache.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
92 | pcy_cache.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
93 | pcy_cache.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
94 | pcy_cache.o: ../../include/openssl/objects.h | ||
95 | pcy_cache.o: ../../include/openssl/opensslconf.h | ||
96 | pcy_cache.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
97 | pcy_cache.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
98 | pcy_cache.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
99 | pcy_cache.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
100 | pcy_cache.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
101 | pcy_cache.o: ../cryptlib.h pcy_cache.c pcy_int.h | ||
102 | pcy_data.o: ../../e_os.h ../../include/openssl/asn1.h | ||
103 | pcy_data.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
104 | pcy_data.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
105 | pcy_data.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
106 | pcy_data.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
107 | pcy_data.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
108 | pcy_data.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
109 | pcy_data.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
110 | pcy_data.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
111 | pcy_data.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
112 | pcy_data.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
113 | pcy_data.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
114 | pcy_data.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
115 | pcy_data.o: ../cryptlib.h pcy_data.c pcy_int.h | ||
116 | pcy_lib.o: ../../e_os.h ../../include/openssl/asn1.h | ||
117 | pcy_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
118 | pcy_lib.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
119 | pcy_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
120 | pcy_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
121 | pcy_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
122 | pcy_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
123 | pcy_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
124 | pcy_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
125 | pcy_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
126 | pcy_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
127 | pcy_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
128 | pcy_lib.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
129 | pcy_lib.o: ../cryptlib.h pcy_int.h pcy_lib.c | ||
130 | pcy_map.o: ../../e_os.h ../../include/openssl/asn1.h | ||
131 | pcy_map.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
132 | pcy_map.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
133 | pcy_map.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
134 | pcy_map.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
135 | pcy_map.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
136 | pcy_map.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
137 | pcy_map.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
138 | pcy_map.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
139 | pcy_map.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
140 | pcy_map.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
141 | pcy_map.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
142 | pcy_map.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
143 | pcy_map.o: ../cryptlib.h pcy_int.h pcy_map.c | ||
144 | pcy_node.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
145 | pcy_node.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
146 | pcy_node.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
147 | pcy_node.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
148 | pcy_node.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h | ||
149 | pcy_node.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
150 | pcy_node.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
151 | pcy_node.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
152 | pcy_node.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
153 | pcy_node.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
154 | pcy_node.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
155 | pcy_node.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
156 | pcy_node.o: pcy_int.h pcy_node.c | ||
157 | pcy_tree.o: ../../e_os.h ../../include/openssl/asn1.h | ||
158 | pcy_tree.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
159 | pcy_tree.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
160 | pcy_tree.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
161 | pcy_tree.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
162 | pcy_tree.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
163 | pcy_tree.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
164 | pcy_tree.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
165 | pcy_tree.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
166 | pcy_tree.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
167 | pcy_tree.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
168 | pcy_tree.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
169 | pcy_tree.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
170 | pcy_tree.o: ../cryptlib.h pcy_int.h pcy_tree.c | ||
171 | v3_addr.o: ../../e_os.h ../../include/openssl/asn1.h | ||
172 | v3_addr.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
173 | v3_addr.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
174 | v3_addr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
175 | v3_addr.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
176 | v3_addr.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
177 | v3_addr.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
178 | v3_addr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
179 | v3_addr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
180 | v3_addr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
181 | v3_addr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
182 | v3_addr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
183 | v3_addr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
184 | v3_addr.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_addr.c | ||
185 | v3_akey.o: ../../e_os.h ../../include/openssl/asn1.h | ||
186 | v3_akey.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
187 | v3_akey.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
188 | v3_akey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
189 | v3_akey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
190 | v3_akey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
191 | v3_akey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
192 | v3_akey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
193 | v3_akey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
194 | v3_akey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
195 | v3_akey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
196 | v3_akey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
197 | v3_akey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
198 | v3_akey.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_akey.c | ||
199 | v3_akeya.o: ../../e_os.h ../../include/openssl/asn1.h | ||
200 | v3_akeya.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
201 | v3_akeya.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
202 | v3_akeya.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
203 | v3_akeya.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
204 | v3_akeya.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
205 | v3_akeya.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
206 | v3_akeya.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
207 | v3_akeya.o: ../../include/openssl/opensslconf.h | ||
208 | v3_akeya.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
209 | v3_akeya.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
210 | v3_akeya.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
211 | v3_akeya.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
212 | v3_akeya.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
213 | v3_akeya.o: ../cryptlib.h v3_akeya.c | ||
214 | v3_alt.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
215 | v3_alt.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
216 | v3_alt.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
217 | v3_alt.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
218 | v3_alt.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
219 | v3_alt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
220 | v3_alt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
221 | v3_alt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
222 | v3_alt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
223 | v3_alt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
224 | v3_alt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
225 | v3_alt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
226 | v3_alt.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_alt.c | ||
227 | v3_asid.o: ../../e_os.h ../../include/openssl/asn1.h | ||
228 | v3_asid.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
229 | v3_asid.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
230 | v3_asid.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
231 | v3_asid.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
232 | v3_asid.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
233 | v3_asid.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
234 | v3_asid.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
235 | v3_asid.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
236 | v3_asid.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
237 | v3_asid.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
238 | v3_asid.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
239 | v3_asid.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
240 | v3_asid.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
241 | v3_asid.o: ../cryptlib.h v3_asid.c | ||
242 | v3_bcons.o: ../../e_os.h ../../include/openssl/asn1.h | ||
243 | v3_bcons.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
244 | v3_bcons.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
245 | v3_bcons.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
246 | v3_bcons.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
247 | v3_bcons.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
248 | v3_bcons.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
249 | v3_bcons.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
250 | v3_bcons.o: ../../include/openssl/opensslconf.h | ||
251 | v3_bcons.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
252 | v3_bcons.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
253 | v3_bcons.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
254 | v3_bcons.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
255 | v3_bcons.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
256 | v3_bcons.o: ../cryptlib.h v3_bcons.c | ||
257 | v3_bitst.o: ../../e_os.h ../../include/openssl/asn1.h | ||
258 | v3_bitst.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
259 | v3_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
260 | v3_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
261 | v3_bitst.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
262 | v3_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
263 | v3_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
264 | v3_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
265 | v3_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
266 | v3_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
267 | v3_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
268 | v3_bitst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
269 | v3_bitst.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
270 | v3_bitst.o: ../cryptlib.h v3_bitst.c | ||
271 | v3_conf.o: ../../e_os.h ../../include/openssl/asn1.h | ||
272 | v3_conf.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
273 | v3_conf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
274 | v3_conf.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
275 | v3_conf.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
276 | v3_conf.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
277 | v3_conf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
278 | v3_conf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
279 | v3_conf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
280 | v3_conf.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
281 | v3_conf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
282 | v3_conf.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
283 | v3_conf.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
284 | v3_conf.o: ../cryptlib.h v3_conf.c | ||
285 | v3_cpols.o: ../../e_os.h ../../include/openssl/asn1.h | ||
286 | v3_cpols.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
287 | v3_cpols.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
288 | v3_cpols.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
289 | v3_cpols.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
290 | v3_cpols.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
291 | v3_cpols.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
292 | v3_cpols.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
293 | v3_cpols.o: ../../include/openssl/opensslconf.h | ||
294 | v3_cpols.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
295 | v3_cpols.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
296 | v3_cpols.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
297 | v3_cpols.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
298 | v3_cpols.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
299 | v3_cpols.o: ../cryptlib.h pcy_int.h v3_cpols.c | ||
300 | v3_crld.o: ../../e_os.h ../../include/openssl/asn1.h | ||
301 | v3_crld.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
302 | v3_crld.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
303 | v3_crld.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
304 | v3_crld.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
305 | v3_crld.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
306 | v3_crld.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
307 | v3_crld.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
308 | v3_crld.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
309 | v3_crld.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
310 | v3_crld.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
311 | v3_crld.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
312 | v3_crld.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
313 | v3_crld.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_crld.c | ||
314 | v3_enum.o: ../../e_os.h ../../include/openssl/asn1.h | ||
315 | v3_enum.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
316 | v3_enum.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
317 | v3_enum.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
318 | v3_enum.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
319 | v3_enum.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
320 | v3_enum.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
321 | v3_enum.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
322 | v3_enum.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
323 | v3_enum.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
324 | v3_enum.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
325 | v3_enum.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
326 | v3_enum.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
327 | v3_enum.o: ../cryptlib.h v3_enum.c | ||
328 | v3_extku.o: ../../e_os.h ../../include/openssl/asn1.h | ||
329 | v3_extku.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
330 | v3_extku.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
331 | v3_extku.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
332 | v3_extku.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
333 | v3_extku.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
334 | v3_extku.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
335 | v3_extku.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
336 | v3_extku.o: ../../include/openssl/opensslconf.h | ||
337 | v3_extku.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
338 | v3_extku.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
339 | v3_extku.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
340 | v3_extku.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
341 | v3_extku.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
342 | v3_extku.o: ../cryptlib.h v3_extku.c | ||
343 | v3_genn.o: ../../e_os.h ../../include/openssl/asn1.h | ||
344 | v3_genn.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
345 | v3_genn.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
346 | v3_genn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
347 | v3_genn.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
348 | v3_genn.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
349 | v3_genn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
350 | v3_genn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
351 | v3_genn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
352 | v3_genn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
353 | v3_genn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
354 | v3_genn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
355 | v3_genn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
356 | v3_genn.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_genn.c | ||
357 | v3_ia5.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
358 | v3_ia5.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
359 | v3_ia5.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
360 | v3_ia5.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
361 | v3_ia5.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
362 | v3_ia5.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
363 | v3_ia5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
364 | v3_ia5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
365 | v3_ia5.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
366 | v3_ia5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
367 | v3_ia5.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
368 | v3_ia5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
369 | v3_ia5.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_ia5.c | ||
370 | v3_info.o: ../../e_os.h ../../include/openssl/asn1.h | ||
371 | v3_info.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
372 | v3_info.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
373 | v3_info.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
374 | v3_info.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
375 | v3_info.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
376 | v3_info.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
377 | v3_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
378 | v3_info.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
379 | v3_info.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
380 | v3_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
381 | v3_info.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
382 | v3_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
383 | v3_info.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_info.c | ||
384 | v3_int.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
385 | v3_int.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
386 | v3_int.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
387 | v3_int.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
388 | v3_int.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
389 | v3_int.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
390 | v3_int.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
391 | v3_int.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
392 | v3_int.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
393 | v3_int.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
394 | v3_int.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
395 | v3_int.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
396 | v3_int.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_int.c | ||
397 | v3_lib.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
398 | v3_lib.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
399 | v3_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
400 | v3_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
401 | v3_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
402 | v3_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
403 | v3_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
404 | v3_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
405 | v3_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
406 | v3_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
407 | v3_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
408 | v3_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
409 | v3_lib.o: ../../include/openssl/x509v3.h ../cryptlib.h ext_dat.h v3_lib.c | ||
410 | v3_ncons.o: ../../e_os.h ../../include/openssl/asn1.h | ||
411 | v3_ncons.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
412 | v3_ncons.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
413 | v3_ncons.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
414 | v3_ncons.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
415 | v3_ncons.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
416 | v3_ncons.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
417 | v3_ncons.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
418 | v3_ncons.o: ../../include/openssl/opensslconf.h | ||
419 | v3_ncons.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
420 | v3_ncons.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
421 | v3_ncons.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
422 | v3_ncons.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
423 | v3_ncons.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
424 | v3_ncons.o: ../cryptlib.h v3_ncons.c | ||
425 | v3_ocsp.o: ../../e_os.h ../../include/openssl/asn1.h | ||
426 | v3_ocsp.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
427 | v3_ocsp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
428 | v3_ocsp.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
429 | v3_ocsp.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
430 | v3_ocsp.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
431 | v3_ocsp.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
432 | v3_ocsp.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h | ||
433 | v3_ocsp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
434 | v3_ocsp.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
435 | v3_ocsp.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
436 | v3_ocsp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
437 | v3_ocsp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
438 | v3_ocsp.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_ocsp.c | ||
439 | v3_pci.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
440 | v3_pci.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
441 | v3_pci.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
442 | v3_pci.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
443 | v3_pci.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
444 | v3_pci.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
445 | v3_pci.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
446 | v3_pci.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
447 | v3_pci.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
448 | v3_pci.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
449 | v3_pci.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
450 | v3_pci.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
451 | v3_pci.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_pci.c | ||
452 | v3_pcia.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
453 | v3_pcia.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
454 | v3_pcia.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
455 | v3_pcia.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
456 | v3_pcia.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
457 | v3_pcia.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
458 | v3_pcia.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
459 | v3_pcia.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
460 | v3_pcia.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
461 | v3_pcia.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
462 | v3_pcia.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
463 | v3_pcia.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
464 | v3_pcia.o: ../../include/openssl/x509v3.h v3_pcia.c | ||
465 | v3_pcons.o: ../../e_os.h ../../include/openssl/asn1.h | ||
466 | v3_pcons.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
467 | v3_pcons.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
468 | v3_pcons.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
469 | v3_pcons.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
470 | v3_pcons.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
471 | v3_pcons.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
472 | v3_pcons.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
473 | v3_pcons.o: ../../include/openssl/opensslconf.h | ||
474 | v3_pcons.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
475 | v3_pcons.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
476 | v3_pcons.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
477 | v3_pcons.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
478 | v3_pcons.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
479 | v3_pcons.o: ../cryptlib.h v3_pcons.c | ||
480 | v3_pku.o: ../../e_os.h ../../include/openssl/asn1.h | ||
481 | v3_pku.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
482 | v3_pku.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
483 | v3_pku.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
484 | v3_pku.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
485 | v3_pku.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
486 | v3_pku.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
487 | v3_pku.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
488 | v3_pku.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
489 | v3_pku.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
490 | v3_pku.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
491 | v3_pku.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
492 | v3_pku.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
493 | v3_pku.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_pku.c | ||
494 | v3_pmaps.o: ../../e_os.h ../../include/openssl/asn1.h | ||
495 | v3_pmaps.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
496 | v3_pmaps.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
497 | v3_pmaps.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
498 | v3_pmaps.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
499 | v3_pmaps.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
500 | v3_pmaps.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
501 | v3_pmaps.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
502 | v3_pmaps.o: ../../include/openssl/opensslconf.h | ||
503 | v3_pmaps.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
504 | v3_pmaps.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
505 | v3_pmaps.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
506 | v3_pmaps.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
507 | v3_pmaps.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
508 | v3_pmaps.o: ../cryptlib.h v3_pmaps.c | ||
509 | v3_prn.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
510 | v3_prn.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
511 | v3_prn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
512 | v3_prn.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
513 | v3_prn.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
514 | v3_prn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
515 | v3_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
516 | v3_prn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
517 | v3_prn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
518 | v3_prn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
519 | v3_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
520 | v3_prn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
521 | v3_prn.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_prn.c | ||
522 | v3_purp.o: ../../e_os.h ../../include/openssl/asn1.h | ||
523 | v3_purp.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
524 | v3_purp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
525 | v3_purp.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
526 | v3_purp.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
527 | v3_purp.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
528 | v3_purp.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
529 | v3_purp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
530 | v3_purp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
531 | v3_purp.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
532 | v3_purp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
533 | v3_purp.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
534 | v3_purp.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
535 | v3_purp.o: ../cryptlib.h v3_purp.c | ||
536 | v3_skey.o: ../../e_os.h ../../include/openssl/asn1.h | ||
537 | v3_skey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
538 | v3_skey.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
539 | v3_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
540 | v3_skey.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
541 | v3_skey.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
542 | v3_skey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
543 | v3_skey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
544 | v3_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
545 | v3_skey.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
546 | v3_skey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
547 | v3_skey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
548 | v3_skey.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
549 | v3_skey.o: ../cryptlib.h v3_skey.c | ||
550 | v3_sxnet.o: ../../e_os.h ../../include/openssl/asn1.h | ||
551 | v3_sxnet.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
552 | v3_sxnet.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
553 | v3_sxnet.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
554 | v3_sxnet.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
555 | v3_sxnet.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
556 | v3_sxnet.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
557 | v3_sxnet.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
558 | v3_sxnet.o: ../../include/openssl/opensslconf.h | ||
559 | v3_sxnet.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
560 | v3_sxnet.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
561 | v3_sxnet.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
562 | v3_sxnet.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
563 | v3_sxnet.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
564 | v3_sxnet.o: ../cryptlib.h v3_sxnet.c | ||
565 | v3_utl.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
566 | v3_utl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
567 | v3_utl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
568 | v3_utl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
569 | v3_utl.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
570 | v3_utl.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
571 | v3_utl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
572 | v3_utl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
573 | v3_utl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
574 | v3_utl.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
575 | v3_utl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
576 | v3_utl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
577 | v3_utl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
578 | v3_utl.o: ../cryptlib.h v3_utl.c | ||
579 | v3err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
580 | v3err.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h | ||
581 | v3err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
582 | v3err.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
583 | v3err.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
584 | v3err.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
585 | v3err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
586 | v3err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
587 | v3err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
588 | v3err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
589 | v3err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
590 | v3err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
591 | v3err.o: ../../include/openssl/x509v3.h v3err.c | ||
diff --git a/src/lib/libcrypto/x509v3/Makefile.ssl b/src/lib/libcrypto/x509v3/Makefile.ssl new file mode 100644 index 0000000000..66df90c346 --- /dev/null +++ b/src/lib/libcrypto/x509v3/Makefile.ssl | |||
@@ -0,0 +1,603 @@ | |||
1 | # | ||
2 | # SSLeay/crypto/x509v3/Makefile | ||
3 | # | ||
4 | |||
5 | DIR= x509v3 | ||
6 | TOP= ../.. | ||
7 | CC= cc | ||
8 | INCLUDES= -I.. -I$(TOP) -I../../include | ||
9 | CFLAG=-g | ||
10 | INSTALL_PREFIX= | ||
11 | OPENSSLDIR= /usr/local/ssl | ||
12 | INSTALLTOP=/usr/local/ssl | ||
13 | MAKE= make -f Makefile.ssl | ||
14 | MAKEDEPPROG= makedepend | ||
15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
16 | MAKEFILE= Makefile.ssl | ||
17 | AR= ar r | ||
18 | |||
19 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
20 | |||
21 | GENERAL=Makefile README | ||
22 | TEST= | ||
23 | APPS= | ||
24 | |||
25 | LIB=$(TOP)/libcrypto.a | ||
26 | LIBSRC= v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c v3_lib.c \ | ||
27 | v3_prn.c v3_utl.c v3err.c v3_genn.c v3_alt.c v3_skey.c v3_akey.c v3_pku.c \ | ||
28 | v3_int.c v3_enum.c v3_sxnet.c v3_cpols.c v3_crld.c v3_purp.c v3_info.c \ | ||
29 | v3_ocsp.c v3_akeya.c | ||
30 | LIBOBJ= v3_bcons.o v3_bitst.o v3_conf.o v3_extku.o v3_ia5.o v3_lib.o \ | ||
31 | v3_prn.o v3_utl.o v3err.o v3_genn.o v3_alt.o v3_skey.o v3_akey.o v3_pku.o \ | ||
32 | v3_int.o v3_enum.o v3_sxnet.o v3_cpols.o v3_crld.o v3_purp.o v3_info.o \ | ||
33 | v3_ocsp.o v3_akeya.o | ||
34 | |||
35 | SRC= $(LIBSRC) | ||
36 | |||
37 | EXHEADER= x509v3.h | ||
38 | HEADER= $(EXHEADER) | ||
39 | |||
40 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
41 | |||
42 | top: | ||
43 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) | ||
44 | |||
45 | all: lib | ||
46 | |||
47 | lib: $(LIBOBJ) | ||
48 | $(AR) $(LIB) $(LIBOBJ) | ||
49 | $(RANLIB) $(LIB) || echo Never mind. | ||
50 | @touch lib | ||
51 | |||
52 | files: | ||
53 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | ||
54 | |||
55 | links: | ||
56 | @sh $(TOP)/util/point.sh Makefile.ssl Makefile | ||
57 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) | ||
58 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) | ||
59 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) | ||
60 | |||
61 | install: | ||
62 | @for i in $(EXHEADER) ; \ | ||
63 | do \ | ||
64 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | ||
65 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | ||
66 | done; | ||
67 | |||
68 | tags: | ||
69 | ctags $(SRC) | ||
70 | |||
71 | tests: | ||
72 | |||
73 | lint: | ||
74 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
75 | |||
76 | depend: | ||
77 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) | ||
78 | |||
79 | dclean: | ||
80 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
81 | mv -f Makefile.new $(MAKEFILE) | ||
82 | |||
83 | clean: | ||
84 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
85 | |||
86 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
87 | |||
88 | v3_akey.o: ../../e_os.h ../../include/openssl/aes.h | ||
89 | v3_akey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
90 | v3_akey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
91 | v3_akey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
92 | v3_akey.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
93 | v3_akey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
94 | v3_akey.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
95 | v3_akey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
96 | v3_akey.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
97 | v3_akey.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
98 | v3_akey.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
99 | v3_akey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
100 | v3_akey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
101 | v3_akey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
102 | v3_akey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
103 | v3_akey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
104 | v3_akey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
105 | v3_akey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
106 | v3_akey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
107 | v3_akey.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
108 | v3_akey.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
109 | v3_akey.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
110 | v3_akey.o: ../cryptlib.h v3_akey.c | ||
111 | v3_akeya.o: ../../e_os.h ../../include/openssl/aes.h | ||
112 | v3_akeya.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
113 | v3_akeya.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
114 | v3_akeya.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
115 | v3_akeya.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
116 | v3_akeya.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
117 | v3_akeya.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
118 | v3_akeya.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
119 | v3_akeya.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
120 | v3_akeya.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
121 | v3_akeya.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
122 | v3_akeya.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
123 | v3_akeya.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
124 | v3_akeya.o: ../../include/openssl/opensslconf.h | ||
125 | v3_akeya.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
126 | v3_akeya.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
127 | v3_akeya.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
128 | v3_akeya.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
129 | v3_akeya.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
130 | v3_akeya.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
131 | v3_akeya.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
132 | v3_akeya.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
133 | v3_akeya.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_akeya.c | ||
134 | v3_alt.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h | ||
135 | v3_alt.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
136 | v3_alt.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
137 | v3_alt.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
138 | v3_alt.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
139 | v3_alt.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
140 | v3_alt.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
141 | v3_alt.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
142 | v3_alt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
143 | v3_alt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
144 | v3_alt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
145 | v3_alt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
146 | v3_alt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
147 | v3_alt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
148 | v3_alt.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
149 | v3_alt.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
150 | v3_alt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
151 | v3_alt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
152 | v3_alt.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
153 | v3_alt.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
154 | v3_alt.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
155 | v3_alt.o: ../cryptlib.h v3_alt.c | ||
156 | v3_bcons.o: ../../e_os.h ../../include/openssl/aes.h | ||
157 | v3_bcons.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
158 | v3_bcons.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
159 | v3_bcons.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
160 | v3_bcons.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
161 | v3_bcons.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
162 | v3_bcons.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
163 | v3_bcons.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
164 | v3_bcons.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
165 | v3_bcons.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
166 | v3_bcons.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
167 | v3_bcons.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
168 | v3_bcons.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
169 | v3_bcons.o: ../../include/openssl/opensslconf.h | ||
170 | v3_bcons.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
171 | v3_bcons.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
172 | v3_bcons.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
173 | v3_bcons.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
174 | v3_bcons.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
175 | v3_bcons.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
176 | v3_bcons.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
177 | v3_bcons.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
178 | v3_bcons.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_bcons.c | ||
179 | v3_bitst.o: ../../e_os.h ../../include/openssl/aes.h | ||
180 | v3_bitst.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
181 | v3_bitst.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
182 | v3_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
183 | v3_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
184 | v3_bitst.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | ||
185 | v3_bitst.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
186 | v3_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
187 | v3_bitst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
188 | v3_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
189 | v3_bitst.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
190 | v3_bitst.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
191 | v3_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
192 | v3_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
193 | v3_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
194 | v3_bitst.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
195 | v3_bitst.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
196 | v3_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
197 | v3_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
198 | v3_bitst.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
199 | v3_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
200 | v3_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_bitst.c | ||
201 | v3_conf.o: ../../e_os.h ../../include/openssl/aes.h | ||
202 | v3_conf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
203 | v3_conf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
204 | v3_conf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
205 | v3_conf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
206 | v3_conf.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | ||
207 | v3_conf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
208 | v3_conf.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
209 | v3_conf.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
210 | v3_conf.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
211 | v3_conf.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
212 | v3_conf.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
213 | v3_conf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
214 | v3_conf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
215 | v3_conf.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
216 | v3_conf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
217 | v3_conf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
218 | v3_conf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
219 | v3_conf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
220 | v3_conf.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
221 | v3_conf.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
222 | v3_conf.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_conf.c | ||
223 | v3_cpols.o: ../../e_os.h ../../include/openssl/aes.h | ||
224 | v3_cpols.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
225 | v3_cpols.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
226 | v3_cpols.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
227 | v3_cpols.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
228 | v3_cpols.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
229 | v3_cpols.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
230 | v3_cpols.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
231 | v3_cpols.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
232 | v3_cpols.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
233 | v3_cpols.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
234 | v3_cpols.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
235 | v3_cpols.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
236 | v3_cpols.o: ../../include/openssl/opensslconf.h | ||
237 | v3_cpols.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
238 | v3_cpols.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
239 | v3_cpols.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
240 | v3_cpols.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
241 | v3_cpols.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
242 | v3_cpols.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
243 | v3_cpols.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
244 | v3_cpols.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
245 | v3_cpols.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_cpols.c | ||
246 | v3_crld.o: ../../e_os.h ../../include/openssl/aes.h | ||
247 | v3_crld.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
248 | v3_crld.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
249 | v3_crld.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
250 | v3_crld.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
251 | v3_crld.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
252 | v3_crld.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
253 | v3_crld.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
254 | v3_crld.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
255 | v3_crld.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
256 | v3_crld.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
257 | v3_crld.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
258 | v3_crld.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
259 | v3_crld.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
260 | v3_crld.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
261 | v3_crld.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
262 | v3_crld.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
263 | v3_crld.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
264 | v3_crld.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
265 | v3_crld.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
266 | v3_crld.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
267 | v3_crld.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
268 | v3_crld.o: ../cryptlib.h v3_crld.c | ||
269 | v3_enum.o: ../../e_os.h ../../include/openssl/aes.h | ||
270 | v3_enum.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
271 | v3_enum.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
272 | v3_enum.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
273 | v3_enum.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
274 | v3_enum.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | ||
275 | v3_enum.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
276 | v3_enum.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
277 | v3_enum.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
278 | v3_enum.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
279 | v3_enum.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
280 | v3_enum.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
281 | v3_enum.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
282 | v3_enum.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
283 | v3_enum.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
284 | v3_enum.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
285 | v3_enum.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
286 | v3_enum.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
287 | v3_enum.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
288 | v3_enum.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
289 | v3_enum.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
290 | v3_enum.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_enum.c | ||
291 | v3_extku.o: ../../e_os.h ../../include/openssl/aes.h | ||
292 | v3_extku.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
293 | v3_extku.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
294 | v3_extku.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
295 | v3_extku.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
296 | v3_extku.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
297 | v3_extku.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
298 | v3_extku.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
299 | v3_extku.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
300 | v3_extku.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
301 | v3_extku.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
302 | v3_extku.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
303 | v3_extku.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
304 | v3_extku.o: ../../include/openssl/opensslconf.h | ||
305 | v3_extku.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
306 | v3_extku.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
307 | v3_extku.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
308 | v3_extku.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
309 | v3_extku.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
310 | v3_extku.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
311 | v3_extku.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
312 | v3_extku.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
313 | v3_extku.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_extku.c | ||
314 | v3_genn.o: ../../e_os.h ../../include/openssl/aes.h | ||
315 | v3_genn.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
316 | v3_genn.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
317 | v3_genn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
318 | v3_genn.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
319 | v3_genn.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
320 | v3_genn.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
321 | v3_genn.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
322 | v3_genn.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
323 | v3_genn.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
324 | v3_genn.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
325 | v3_genn.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
326 | v3_genn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
327 | v3_genn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
328 | v3_genn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
329 | v3_genn.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
330 | v3_genn.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
331 | v3_genn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
332 | v3_genn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
333 | v3_genn.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
334 | v3_genn.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
335 | v3_genn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
336 | v3_genn.o: ../cryptlib.h v3_genn.c | ||
337 | v3_ia5.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h | ||
338 | v3_ia5.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
339 | v3_ia5.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
340 | v3_ia5.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
341 | v3_ia5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
342 | v3_ia5.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
343 | v3_ia5.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
344 | v3_ia5.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
345 | v3_ia5.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
346 | v3_ia5.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
347 | v3_ia5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
348 | v3_ia5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
349 | v3_ia5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
350 | v3_ia5.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
351 | v3_ia5.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
352 | v3_ia5.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
353 | v3_ia5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
354 | v3_ia5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
355 | v3_ia5.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
356 | v3_ia5.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
357 | v3_ia5.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
358 | v3_ia5.o: ../cryptlib.h v3_ia5.c | ||
359 | v3_info.o: ../../e_os.h ../../include/openssl/aes.h | ||
360 | v3_info.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
361 | v3_info.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
362 | v3_info.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
363 | v3_info.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
364 | v3_info.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
365 | v3_info.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
366 | v3_info.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
367 | v3_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
368 | v3_info.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
369 | v3_info.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
370 | v3_info.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
371 | v3_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
372 | v3_info.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
373 | v3_info.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
374 | v3_info.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
375 | v3_info.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
376 | v3_info.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
377 | v3_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
378 | v3_info.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
379 | v3_info.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
380 | v3_info.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
381 | v3_info.o: ../cryptlib.h v3_info.c | ||
382 | v3_int.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h | ||
383 | v3_int.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
384 | v3_int.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
385 | v3_int.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
386 | v3_int.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
387 | v3_int.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
388 | v3_int.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
389 | v3_int.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
390 | v3_int.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
391 | v3_int.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
392 | v3_int.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
393 | v3_int.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
394 | v3_int.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
395 | v3_int.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
396 | v3_int.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
397 | v3_int.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
398 | v3_int.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
399 | v3_int.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
400 | v3_int.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
401 | v3_int.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
402 | v3_int.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
403 | v3_int.o: ../cryptlib.h v3_int.c | ||
404 | v3_lib.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h | ||
405 | v3_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
406 | v3_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
407 | v3_lib.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
408 | v3_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
409 | v3_lib.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
410 | v3_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
411 | v3_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
412 | v3_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
413 | v3_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
414 | v3_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
415 | v3_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
416 | v3_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
417 | v3_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
418 | v3_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
419 | v3_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
420 | v3_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
421 | v3_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
422 | v3_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
423 | v3_lib.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
424 | v3_lib.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
425 | v3_lib.o: ../cryptlib.h ext_dat.h v3_lib.c | ||
426 | v3_ocsp.o: ../../e_os.h ../../include/openssl/aes.h | ||
427 | v3_ocsp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
428 | v3_ocsp.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
429 | v3_ocsp.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
430 | v3_ocsp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
431 | v3_ocsp.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | ||
432 | v3_ocsp.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
433 | v3_ocsp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
434 | v3_ocsp.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
435 | v3_ocsp.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
436 | v3_ocsp.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
437 | v3_ocsp.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
438 | v3_ocsp.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h | ||
439 | v3_ocsp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
440 | v3_ocsp.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
441 | v3_ocsp.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
442 | v3_ocsp.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
443 | v3_ocsp.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
444 | v3_ocsp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
445 | v3_ocsp.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
446 | v3_ocsp.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
447 | v3_ocsp.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
448 | v3_ocsp.o: ../cryptlib.h v3_ocsp.c | ||
449 | v3_pku.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h | ||
450 | v3_pku.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
451 | v3_pku.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
452 | v3_pku.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
453 | v3_pku.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
454 | v3_pku.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | ||
455 | v3_pku.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
456 | v3_pku.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
457 | v3_pku.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
458 | v3_pku.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
459 | v3_pku.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
460 | v3_pku.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
461 | v3_pku.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
462 | v3_pku.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
463 | v3_pku.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
464 | v3_pku.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
465 | v3_pku.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
466 | v3_pku.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
467 | v3_pku.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
468 | v3_pku.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
469 | v3_pku.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
470 | v3_pku.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_pku.c | ||
471 | v3_prn.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h | ||
472 | v3_prn.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
473 | v3_prn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
474 | v3_prn.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
475 | v3_prn.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
476 | v3_prn.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
477 | v3_prn.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
478 | v3_prn.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
479 | v3_prn.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
480 | v3_prn.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
481 | v3_prn.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
482 | v3_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
483 | v3_prn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
484 | v3_prn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
485 | v3_prn.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
486 | v3_prn.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
487 | v3_prn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
488 | v3_prn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
489 | v3_prn.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
490 | v3_prn.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
491 | v3_prn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
492 | v3_prn.o: ../cryptlib.h v3_prn.c | ||
493 | v3_purp.o: ../../e_os.h ../../include/openssl/aes.h | ||
494 | v3_purp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
495 | v3_purp.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
496 | v3_purp.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
497 | v3_purp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
498 | v3_purp.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | ||
499 | v3_purp.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
500 | v3_purp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
501 | v3_purp.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
502 | v3_purp.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
503 | v3_purp.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
504 | v3_purp.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
505 | v3_purp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
506 | v3_purp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
507 | v3_purp.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
508 | v3_purp.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
509 | v3_purp.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
510 | v3_purp.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
511 | v3_purp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
512 | v3_purp.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
513 | v3_purp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
514 | v3_purp.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_purp.c | ||
515 | v3_skey.o: ../../e_os.h ../../include/openssl/aes.h | ||
516 | v3_skey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
517 | v3_skey.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
518 | v3_skey.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
519 | v3_skey.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | ||
520 | v3_skey.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | ||
521 | v3_skey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
522 | v3_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
523 | v3_skey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
524 | v3_skey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
525 | v3_skey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
526 | v3_skey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
527 | v3_skey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
528 | v3_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
529 | v3_skey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
530 | v3_skey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
531 | v3_skey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
532 | v3_skey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
533 | v3_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
534 | v3_skey.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
535 | v3_skey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
536 | v3_skey.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_skey.c | ||
537 | v3_sxnet.o: ../../e_os.h ../../include/openssl/aes.h | ||
538 | v3_sxnet.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
539 | v3_sxnet.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
540 | v3_sxnet.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
541 | v3_sxnet.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
542 | v3_sxnet.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
543 | v3_sxnet.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
544 | v3_sxnet.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
545 | v3_sxnet.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
546 | v3_sxnet.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
547 | v3_sxnet.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
548 | v3_sxnet.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
549 | v3_sxnet.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
550 | v3_sxnet.o: ../../include/openssl/opensslconf.h | ||
551 | v3_sxnet.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
552 | v3_sxnet.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
553 | v3_sxnet.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
554 | v3_sxnet.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
555 | v3_sxnet.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
556 | v3_sxnet.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
557 | v3_sxnet.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
558 | v3_sxnet.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
559 | v3_sxnet.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_sxnet.c | ||
560 | v3_utl.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h | ||
561 | v3_utl.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
562 | v3_utl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
563 | v3_utl.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
564 | v3_utl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
565 | v3_utl.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
566 | v3_utl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
567 | v3_utl.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
568 | v3_utl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
569 | v3_utl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
570 | v3_utl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
571 | v3_utl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
572 | v3_utl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
573 | v3_utl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
574 | v3_utl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
575 | v3_utl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
576 | v3_utl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
577 | v3_utl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
578 | v3_utl.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
579 | v3_utl.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
580 | v3_utl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
581 | v3_utl.o: ../cryptlib.h v3_utl.c | ||
582 | v3err.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h | ||
583 | v3err.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
584 | v3err.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
585 | v3err.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | ||
586 | v3err.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
587 | v3err.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
588 | v3err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
589 | v3err.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
590 | v3err.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
591 | v3err.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
592 | v3err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
593 | v3err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
594 | v3err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
595 | v3err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | ||
596 | v3err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
597 | v3err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
598 | v3err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
599 | v3err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
600 | v3err.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
601 | v3err.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
602 | v3err.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | ||
603 | v3err.o: v3err.c | ||
diff --git a/src/lib/libcrypto/x509v3/ext_dat.h b/src/lib/libcrypto/x509v3/ext_dat.h index 76daee6fcd..3eaec46f8a 100644 --- a/src/lib/libcrypto/x509v3/ext_dat.h +++ b/src/lib/libcrypto/x509v3/ext_dat.h | |||
@@ -61,19 +61,21 @@ extern X509V3_EXT_METHOD v3_bcons, v3_nscert, v3_key_usage, v3_ext_ku; | |||
61 | extern X509V3_EXT_METHOD v3_pkey_usage_period, v3_sxnet, v3_info, v3_sinfo; | 61 | extern X509V3_EXT_METHOD v3_pkey_usage_period, v3_sxnet, v3_info, v3_sinfo; |
62 | extern X509V3_EXT_METHOD v3_ns_ia5_list[], v3_alt[], v3_skey_id, v3_akey_id; | 62 | extern X509V3_EXT_METHOD v3_ns_ia5_list[], v3_alt[], v3_skey_id, v3_akey_id; |
63 | extern X509V3_EXT_METHOD v3_crl_num, v3_crl_reason, v3_crl_invdate; | 63 | extern X509V3_EXT_METHOD v3_crl_num, v3_crl_reason, v3_crl_invdate; |
64 | extern X509V3_EXT_METHOD v3_delta_crl, v3_cpols, v3_crld, v3_freshest_crl; | 64 | extern X509V3_EXT_METHOD v3_delta_crl, v3_cpols, v3_crld; |
65 | extern X509V3_EXT_METHOD v3_ocsp_nonce, v3_ocsp_accresp, v3_ocsp_acutoff; | 65 | extern X509V3_EXT_METHOD v3_ocsp_nonce, v3_ocsp_accresp, v3_ocsp_acutoff; |
66 | extern X509V3_EXT_METHOD v3_ocsp_crlid, v3_ocsp_nocheck, v3_ocsp_serviceloc; | 66 | extern X509V3_EXT_METHOD v3_ocsp_crlid, v3_ocsp_nocheck, v3_ocsp_serviceloc; |
67 | extern X509V3_EXT_METHOD v3_crl_hold, v3_pci; | 67 | extern X509V3_EXT_METHOD v3_crl_hold, v3_pci; |
68 | extern X509V3_EXT_METHOD v3_policy_mappings, v3_policy_constraints; | 68 | extern X509V3_EXT_METHOD v3_policy_mappings, v3_policy_constraints; |
69 | extern X509V3_EXT_METHOD v3_name_constraints, v3_inhibit_anyp, v3_idp; | 69 | extern X509V3_EXT_METHOD v3_name_constraints, v3_inhibit_anyp; |
70 | #ifndef OPENSSL_NO_RFC3779 | ||
70 | extern X509V3_EXT_METHOD v3_addr, v3_asid; | 71 | extern X509V3_EXT_METHOD v3_addr, v3_asid; |
72 | #endif | ||
71 | 73 | ||
72 | /* This table will be searched using OBJ_bsearch so it *must* kept in | 74 | /* This table will be searched using OBJ_bsearch so it *must* kept in |
73 | * order of the ext_nid values. | 75 | * order of the ext_nid values. |
74 | */ | 76 | */ |
75 | 77 | ||
76 | static const X509V3_EXT_METHOD *standard_exts[] = { | 78 | static X509V3_EXT_METHOD *standard_exts[] = { |
77 | &v3_nscert, | 79 | &v3_nscert, |
78 | &v3_ns_ia5_list[0], | 80 | &v3_ns_ia5_list[0], |
79 | &v3_ns_ia5_list[1], | 81 | &v3_ns_ia5_list[1], |
@@ -120,10 +122,7 @@ static const X509V3_EXT_METHOD *standard_exts[] = { | |||
120 | &v3_pci, | 122 | &v3_pci, |
121 | &v3_name_constraints, | 123 | &v3_name_constraints, |
122 | &v3_policy_mappings, | 124 | &v3_policy_mappings, |
123 | &v3_inhibit_anyp, | 125 | &v3_inhibit_anyp |
124 | &v3_idp, | ||
125 | &v3_alt[2], | ||
126 | &v3_freshest_crl, | ||
127 | }; | 126 | }; |
128 | 127 | ||
129 | /* Number of standard extensions */ | 128 | /* Number of standard extensions */ |
diff --git a/src/lib/libcrypto/x509v3/pcy_data.c b/src/lib/libcrypto/x509v3/pcy_data.c index 3444b03195..fb392b901f 100644 --- a/src/lib/libcrypto/x509v3/pcy_data.c +++ b/src/lib/libcrypto/x509v3/pcy_data.c | |||
@@ -82,21 +82,17 @@ void policy_data_free(X509_POLICY_DATA *data) | |||
82 | * another source. | 82 | * another source. |
83 | */ | 83 | */ |
84 | 84 | ||
85 | X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, | 85 | X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, ASN1_OBJECT *id, int crit) |
86 | const ASN1_OBJECT *cid, int crit) | ||
87 | { | 86 | { |
88 | X509_POLICY_DATA *ret; | 87 | X509_POLICY_DATA *ret; |
89 | ASN1_OBJECT *id; | 88 | if (!policy && !id) |
90 | if (!policy && !cid) | ||
91 | return NULL; | 89 | return NULL; |
92 | if (cid) | 90 | if (id) |
93 | { | 91 | { |
94 | id = OBJ_dup(cid); | 92 | id = OBJ_dup(id); |
95 | if (!id) | 93 | if (!id) |
96 | return NULL; | 94 | return NULL; |
97 | } | 95 | } |
98 | else | ||
99 | id = NULL; | ||
100 | ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA)); | 96 | ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA)); |
101 | if (!ret) | 97 | if (!ret) |
102 | return NULL; | 98 | return NULL; |
diff --git a/src/lib/libcrypto/x509v3/pcy_tree.c b/src/lib/libcrypto/x509v3/pcy_tree.c index 92f6b24556..6c87a7f506 100644 --- a/src/lib/libcrypto/x509v3/pcy_tree.c +++ b/src/lib/libcrypto/x509v3/pcy_tree.c | |||
@@ -62,75 +62,6 @@ | |||
62 | 62 | ||
63 | #include "pcy_int.h" | 63 | #include "pcy_int.h" |
64 | 64 | ||
65 | /* Enable this to print out the complete policy tree at various point during | ||
66 | * evaluation. | ||
67 | */ | ||
68 | |||
69 | /*#define OPENSSL_POLICY_DEBUG*/ | ||
70 | |||
71 | #ifdef OPENSSL_POLICY_DEBUG | ||
72 | |||
73 | static void expected_print(BIO *err, X509_POLICY_LEVEL *lev, | ||
74 | X509_POLICY_NODE *node, int indent) | ||
75 | { | ||
76 | if ( (lev->flags & X509_V_FLAG_INHIBIT_MAP) | ||
77 | || !(node->data->flags & POLICY_DATA_FLAG_MAP_MASK)) | ||
78 | BIO_puts(err, " Not Mapped\n"); | ||
79 | else | ||
80 | { | ||
81 | int i; | ||
82 | STACK_OF(ASN1_OBJECT) *pset = node->data->expected_policy_set; | ||
83 | ASN1_OBJECT *oid; | ||
84 | BIO_puts(err, " Expected: "); | ||
85 | for (i = 0; i < sk_ASN1_OBJECT_num(pset); i++) | ||
86 | { | ||
87 | oid = sk_ASN1_OBJECT_value(pset, i); | ||
88 | if (i) | ||
89 | BIO_puts(err, ", "); | ||
90 | i2a_ASN1_OBJECT(err, oid); | ||
91 | } | ||
92 | BIO_puts(err, "\n"); | ||
93 | } | ||
94 | } | ||
95 | |||
96 | static void tree_print(char *str, X509_POLICY_TREE *tree, | ||
97 | X509_POLICY_LEVEL *curr) | ||
98 | { | ||
99 | X509_POLICY_LEVEL *plev; | ||
100 | X509_POLICY_NODE *node; | ||
101 | int i; | ||
102 | BIO *err; | ||
103 | err = BIO_new_fp(stderr, BIO_NOCLOSE); | ||
104 | if (!curr) | ||
105 | curr = tree->levels + tree->nlevel; | ||
106 | else | ||
107 | curr++; | ||
108 | BIO_printf(err, "Level print after %s\n", str); | ||
109 | BIO_printf(err, "Printing Up to Level %ld\n", curr - tree->levels); | ||
110 | for (plev = tree->levels; plev != curr; plev++) | ||
111 | { | ||
112 | BIO_printf(err, "Level %ld, flags = %x\n", | ||
113 | plev - tree->levels, plev->flags); | ||
114 | for (i = 0; i < sk_X509_POLICY_NODE_num(plev->nodes); i++) | ||
115 | { | ||
116 | node = sk_X509_POLICY_NODE_value(plev->nodes, i); | ||
117 | X509_POLICY_NODE_print(err, node, 2); | ||
118 | expected_print(err, plev, node, 2); | ||
119 | BIO_printf(err, " Flags: %x\n", node->data->flags); | ||
120 | } | ||
121 | if (plev->anyPolicy) | ||
122 | X509_POLICY_NODE_print(err, plev->anyPolicy, 2); | ||
123 | } | ||
124 | |||
125 | BIO_free(err); | ||
126 | |||
127 | } | ||
128 | #else | ||
129 | |||
130 | #define tree_print(a,b,c) /* */ | ||
131 | |||
132 | #endif | ||
133 | |||
134 | /* Initialize policy tree. Return values: | 65 | /* Initialize policy tree. Return values: |
135 | * 0 Some internal error occured. | 66 | * 0 Some internal error occured. |
136 | * -1 Inconsistent or invalid extensions in certificates. | 67 | * -1 Inconsistent or invalid extensions in certificates. |
@@ -156,10 +87,8 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, | |||
156 | *ptree = NULL; | 87 | *ptree = NULL; |
157 | n = sk_X509_num(certs); | 88 | n = sk_X509_num(certs); |
158 | 89 | ||
159 | #if 0 | ||
160 | /* Disable policy mapping for now... */ | 90 | /* Disable policy mapping for now... */ |
161 | flags |= X509_V_FLAG_INHIBIT_MAP; | 91 | flags |= X509_V_FLAG_INHIBIT_MAP; |
162 | #endif | ||
163 | 92 | ||
164 | if (flags & X509_V_FLAG_EXPLICIT_POLICY) | 93 | if (flags & X509_V_FLAG_EXPLICIT_POLICY) |
165 | explicit_policy = 0; | 94 | explicit_policy = 0; |
@@ -231,7 +160,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, | |||
231 | tree->auth_policies = NULL; | 160 | tree->auth_policies = NULL; |
232 | tree->user_policies = NULL; | 161 | tree->user_policies = NULL; |
233 | 162 | ||
234 | if (!tree->levels) | 163 | if (!tree) |
235 | { | 164 | { |
236 | OPENSSL_free(tree); | 165 | OPENSSL_free(tree); |
237 | return 0; | 166 | return 0; |
@@ -255,6 +184,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, | |||
255 | level++; | 184 | level++; |
256 | x = sk_X509_value(certs, i); | 185 | x = sk_X509_value(certs, i); |
257 | cache = policy_cache_set(x); | 186 | cache = policy_cache_set(x); |
187 | |||
258 | CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509); | 188 | CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509); |
259 | level->cert = x; | 189 | level->cert = x; |
260 | 190 | ||
@@ -283,13 +213,13 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, | |||
283 | level->flags |= X509_V_FLAG_INHIBIT_MAP; | 213 | level->flags |= X509_V_FLAG_INHIBIT_MAP; |
284 | else | 214 | else |
285 | { | 215 | { |
286 | if (!(x->ex_flags & EXFLAG_SI)) | 216 | map_skip--; |
287 | map_skip--; | ||
288 | if ((cache->map_skip >= 0) | 217 | if ((cache->map_skip >= 0) |
289 | && (cache->map_skip < map_skip)) | 218 | && (cache->map_skip < map_skip)) |
290 | map_skip = cache->map_skip; | 219 | map_skip = cache->map_skip; |
291 | } | 220 | } |
292 | 221 | ||
222 | |||
293 | } | 223 | } |
294 | 224 | ||
295 | *ptree = tree; | 225 | *ptree = tree; |
@@ -307,32 +237,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, | |||
307 | 237 | ||
308 | } | 238 | } |
309 | 239 | ||
310 | static int tree_link_matching_nodes(X509_POLICY_LEVEL *curr, | 240 | /* This corresponds to RFC3280 XXXX XXXXX: |
311 | const X509_POLICY_DATA *data) | ||
312 | { | ||
313 | X509_POLICY_LEVEL *last = curr - 1; | ||
314 | X509_POLICY_NODE *node; | ||
315 | int i, matched = 0; | ||
316 | /* Iterate through all in nodes linking matches */ | ||
317 | for (i = 0; i < sk_X509_POLICY_NODE_num(last->nodes); i++) | ||
318 | { | ||
319 | node = sk_X509_POLICY_NODE_value(last->nodes, i); | ||
320 | if (policy_node_match(last, node, data->valid_policy)) | ||
321 | { | ||
322 | if (!level_add_node(curr, data, node, NULL)) | ||
323 | return 0; | ||
324 | matched = 1; | ||
325 | } | ||
326 | } | ||
327 | if (!matched && last->anyPolicy) | ||
328 | { | ||
329 | if (!level_add_node(curr, data, last->anyPolicy, NULL)) | ||
330 | return 0; | ||
331 | } | ||
332 | return 1; | ||
333 | } | ||
334 | |||
335 | /* This corresponds to RFC3280 6.1.3(d)(1): | ||
336 | * link any data from CertificatePolicies onto matching parent | 241 | * link any data from CertificatePolicies onto matching parent |
337 | * or anyPolicy if no match. | 242 | * or anyPolicy if no match. |
338 | */ | 243 | */ |
@@ -343,6 +248,7 @@ static int tree_link_nodes(X509_POLICY_LEVEL *curr, | |||
343 | int i; | 248 | int i; |
344 | X509_POLICY_LEVEL *last; | 249 | X509_POLICY_LEVEL *last; |
345 | X509_POLICY_DATA *data; | 250 | X509_POLICY_DATA *data; |
251 | X509_POLICY_NODE *parent; | ||
346 | last = curr - 1; | 252 | last = curr - 1; |
347 | for (i = 0; i < sk_X509_POLICY_DATA_num(cache->data); i++) | 253 | for (i = 0; i < sk_X509_POLICY_DATA_num(cache->data); i++) |
348 | { | 254 | { |
@@ -355,109 +261,40 @@ static int tree_link_nodes(X509_POLICY_LEVEL *curr, | |||
355 | * link because then it will have the mapping flags | 261 | * link because then it will have the mapping flags |
356 | * right and we can prune it later. | 262 | * right and we can prune it later. |
357 | */ | 263 | */ |
358 | #if 0 | ||
359 | if ((data->flags & POLICY_DATA_FLAG_MAPPED_ANY) | 264 | if ((data->flags & POLICY_DATA_FLAG_MAPPED_ANY) |
360 | && !(curr->flags & X509_V_FLAG_INHIBIT_ANY)) | 265 | && !(curr->flags & X509_V_FLAG_INHIBIT_ANY)) |
361 | continue; | 266 | continue; |
362 | #endif | 267 | /* Look for matching node in parent */ |
363 | /* Look for matching nodes in previous level */ | 268 | parent = level_find_node(last, data->valid_policy); |
364 | if (!tree_link_matching_nodes(curr, data)) | 269 | /* If no match link to anyPolicy */ |
270 | if (!parent) | ||
271 | parent = last->anyPolicy; | ||
272 | if (parent && !level_add_node(curr, data, parent, NULL)) | ||
365 | return 0; | 273 | return 0; |
366 | } | 274 | } |
367 | return 1; | 275 | return 1; |
368 | } | 276 | } |
369 | 277 | ||
370 | /* This corresponds to RFC3280 6.1.3(d)(2): | 278 | /* This corresponds to RFC3280 XXXX XXXXX: |
371 | * Create new data for any unmatched policies in the parent and link | 279 | * Create new data for any unmatched policies in the parent and link |
372 | * to anyPolicy. | 280 | * to anyPolicy. |
373 | */ | 281 | */ |
374 | 282 | ||
375 | static int tree_add_unmatched(X509_POLICY_LEVEL *curr, | ||
376 | const X509_POLICY_CACHE *cache, | ||
377 | const ASN1_OBJECT *id, | ||
378 | X509_POLICY_NODE *node, | ||
379 | X509_POLICY_TREE *tree) | ||
380 | { | ||
381 | X509_POLICY_DATA *data; | ||
382 | if (id == NULL) | ||
383 | id = node->data->valid_policy; | ||
384 | /* Create a new node with qualifiers from anyPolicy and | ||
385 | * id from unmatched node. | ||
386 | */ | ||
387 | data = policy_data_new(NULL, id, node_critical(node)); | ||
388 | |||
389 | if (data == NULL) | ||
390 | return 0; | ||
391 | /* Curr may not have anyPolicy */ | ||
392 | data->qualifier_set = cache->anyPolicy->qualifier_set; | ||
393 | data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; | ||
394 | if (!level_add_node(curr, data, node, tree)) | ||
395 | { | ||
396 | policy_data_free(data); | ||
397 | return 0; | ||
398 | } | ||
399 | |||
400 | return 1; | ||
401 | } | ||
402 | |||
403 | static int tree_link_unmatched(X509_POLICY_LEVEL *curr, | ||
404 | const X509_POLICY_CACHE *cache, | ||
405 | X509_POLICY_NODE *node, | ||
406 | X509_POLICY_TREE *tree) | ||
407 | { | ||
408 | const X509_POLICY_LEVEL *last = curr - 1; | ||
409 | int i; | ||
410 | |||
411 | if ( (last->flags & X509_V_FLAG_INHIBIT_MAP) | ||
412 | || !(node->data->flags & POLICY_DATA_FLAG_MAPPED)) | ||
413 | { | ||
414 | /* If no policy mapping: matched if one child present */ | ||
415 | if (node->nchild) | ||
416 | return 1; | ||
417 | if (!tree_add_unmatched(curr, cache, NULL, node, tree)) | ||
418 | return 0; | ||
419 | /* Add it */ | ||
420 | } | ||
421 | else | ||
422 | { | ||
423 | /* If mapping: matched if one child per expected policy set */ | ||
424 | STACK_OF(ASN1_OBJECT) *expset = node->data->expected_policy_set; | ||
425 | if (node->nchild == sk_ASN1_OBJECT_num(expset)) | ||
426 | return 1; | ||
427 | /* Locate unmatched nodes */ | ||
428 | for (i = 0; i < sk_ASN1_OBJECT_num(expset); i++) | ||
429 | { | ||
430 | ASN1_OBJECT *oid = sk_ASN1_OBJECT_value(expset, i); | ||
431 | if (level_find_node(curr, node, oid)) | ||
432 | continue; | ||
433 | if (!tree_add_unmatched(curr, cache, oid, node, tree)) | ||
434 | return 0; | ||
435 | } | ||
436 | |||
437 | } | ||
438 | |||
439 | return 1; | ||
440 | |||
441 | } | ||
442 | |||
443 | static int tree_link_any(X509_POLICY_LEVEL *curr, | 283 | static int tree_link_any(X509_POLICY_LEVEL *curr, |
444 | const X509_POLICY_CACHE *cache, | 284 | const X509_POLICY_CACHE *cache, |
445 | X509_POLICY_TREE *tree) | 285 | X509_POLICY_TREE *tree) |
446 | { | 286 | { |
447 | int i; | 287 | int i; |
448 | /*X509_POLICY_DATA *data;*/ | 288 | X509_POLICY_DATA *data; |
449 | X509_POLICY_NODE *node; | 289 | X509_POLICY_NODE *node; |
450 | X509_POLICY_LEVEL *last = curr - 1; | 290 | X509_POLICY_LEVEL *last; |
291 | |||
292 | last = curr - 1; | ||
451 | 293 | ||
452 | for (i = 0; i < sk_X509_POLICY_NODE_num(last->nodes); i++) | 294 | for (i = 0; i < sk_X509_POLICY_NODE_num(last->nodes); i++) |
453 | { | 295 | { |
454 | node = sk_X509_POLICY_NODE_value(last->nodes, i); | 296 | node = sk_X509_POLICY_NODE_value(last->nodes, i); |
455 | 297 | ||
456 | if (!tree_link_unmatched(curr, cache, node, tree)) | ||
457 | return 0; | ||
458 | |||
459 | #if 0 | ||
460 | |||
461 | /* Skip any node with any children: we only want unmathced | 298 | /* Skip any node with any children: we only want unmathced |
462 | * nodes. | 299 | * nodes. |
463 | * | 300 | * |
@@ -466,7 +303,6 @@ static int tree_link_any(X509_POLICY_LEVEL *curr, | |||
466 | */ | 303 | */ |
467 | if (node->nchild) | 304 | if (node->nchild) |
468 | continue; | 305 | continue; |
469 | |||
470 | /* Create a new node with qualifiers from anyPolicy and | 306 | /* Create a new node with qualifiers from anyPolicy and |
471 | * id from unmatched node. | 307 | * id from unmatched node. |
472 | */ | 308 | */ |
@@ -483,9 +319,6 @@ static int tree_link_any(X509_POLICY_LEVEL *curr, | |||
483 | policy_data_free(data); | 319 | policy_data_free(data); |
484 | return 0; | 320 | return 0; |
485 | } | 321 | } |
486 | |||
487 | #endif | ||
488 | |||
489 | } | 322 | } |
490 | /* Finally add link to anyPolicy */ | 323 | /* Finally add link to anyPolicy */ |
491 | if (last->anyPolicy) | 324 | if (last->anyPolicy) |
@@ -504,36 +337,30 @@ static int tree_link_any(X509_POLICY_LEVEL *curr, | |||
504 | 337 | ||
505 | static int tree_prune(X509_POLICY_TREE *tree, X509_POLICY_LEVEL *curr) | 338 | static int tree_prune(X509_POLICY_TREE *tree, X509_POLICY_LEVEL *curr) |
506 | { | 339 | { |
507 | STACK_OF(X509_POLICY_NODE) *nodes; | ||
508 | X509_POLICY_NODE *node; | 340 | X509_POLICY_NODE *node; |
509 | int i; | 341 | int i; |
510 | nodes = curr->nodes; | 342 | for (i = sk_X509_POLICY_NODE_num(curr->nodes) - 1; i >= 0; i--) |
511 | if (curr->flags & X509_V_FLAG_INHIBIT_MAP) | ||
512 | { | 343 | { |
513 | for (i = sk_X509_POLICY_NODE_num(nodes) - 1; i >= 0; i--) | 344 | node = sk_X509_POLICY_NODE_value(curr->nodes, i); |
345 | /* Delete any mapped data: see RFC3280 XXXX */ | ||
346 | if (node->data->flags & POLICY_DATA_FLAG_MAP_MASK) | ||
514 | { | 347 | { |
515 | node = sk_X509_POLICY_NODE_value(nodes, i); | 348 | node->parent->nchild--; |
516 | /* Delete any mapped data: see RFC3280 XXXX */ | 349 | OPENSSL_free(node); |
517 | if (node->data->flags & POLICY_DATA_FLAG_MAP_MASK) | 350 | (void)sk_X509_POLICY_NODE_delete(curr->nodes, i); |
518 | { | ||
519 | node->parent->nchild--; | ||
520 | OPENSSL_free(node); | ||
521 | (void)sk_X509_POLICY_NODE_delete(nodes,i); | ||
522 | } | ||
523 | } | 351 | } |
524 | } | 352 | } |
525 | 353 | ||
526 | for(;;) { | 354 | for(;;) { |
527 | --curr; | 355 | --curr; |
528 | nodes = curr->nodes; | 356 | for (i = sk_X509_POLICY_NODE_num(curr->nodes) - 1; i >= 0; i--) |
529 | for (i = sk_X509_POLICY_NODE_num(nodes) - 1; i >= 0; i--) | ||
530 | { | 357 | { |
531 | node = sk_X509_POLICY_NODE_value(nodes, i); | 358 | node = sk_X509_POLICY_NODE_value(curr->nodes, i); |
532 | if (node->nchild == 0) | 359 | if (node->nchild == 0) |
533 | { | 360 | { |
534 | node->parent->nchild--; | 361 | node->parent->nchild--; |
535 | OPENSSL_free(node); | 362 | OPENSSL_free(node); |
536 | (void)sk_X509_POLICY_NODE_delete(nodes, i); | 363 | (void)sk_X509_POLICY_NODE_delete(curr->nodes, i); |
537 | } | 364 | } |
538 | } | 365 | } |
539 | if (curr->anyPolicy && !curr->anyPolicy->nchild) | 366 | if (curr->anyPolicy && !curr->anyPolicy->nchild) |
@@ -709,7 +536,6 @@ static int tree_evaluate(X509_POLICY_TREE *tree) | |||
709 | if (!(curr->flags & X509_V_FLAG_INHIBIT_ANY) | 536 | if (!(curr->flags & X509_V_FLAG_INHIBIT_ANY) |
710 | && !tree_link_any(curr, cache, tree)) | 537 | && !tree_link_any(curr, cache, tree)) |
711 | return 0; | 538 | return 0; |
712 | tree_print("before tree_prune()", tree, curr); | ||
713 | ret = tree_prune(tree, curr); | 539 | ret = tree_prune(tree, curr); |
714 | if (ret != 1) | 540 | if (ret != 1) |
715 | return ret; | 541 | return ret; |
@@ -778,6 +604,7 @@ int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, | |||
778 | *pexplicit_policy = 0; | 604 | *pexplicit_policy = 0; |
779 | ret = tree_init(&tree, certs, flags); | 605 | ret = tree_init(&tree, certs, flags); |
780 | 606 | ||
607 | |||
781 | switch (ret) | 608 | switch (ret) |
782 | { | 609 | { |
783 | 610 | ||
@@ -786,10 +613,6 @@ int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, | |||
786 | return 1; | 613 | return 1; |
787 | 614 | ||
788 | /* Some internal error */ | 615 | /* Some internal error */ |
789 | case -1: | ||
790 | return -1; | ||
791 | |||
792 | /* Some internal error */ | ||
793 | case 0: | 616 | case 0: |
794 | return 0; | 617 | return 0; |
795 | 618 | ||
@@ -823,8 +646,6 @@ int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, | |||
823 | if (!tree) goto error; | 646 | if (!tree) goto error; |
824 | ret = tree_evaluate(tree); | 647 | ret = tree_evaluate(tree); |
825 | 648 | ||
826 | tree_print("tree_evaluate()", tree, NULL); | ||
827 | |||
828 | if (ret <= 0) | 649 | if (ret <= 0) |
829 | goto error; | 650 | goto error; |
830 | 651 | ||
diff --git a/src/lib/libcrypto/x509v3/tabtest.c b/src/lib/libcrypto/x509v3/tabtest.c new file mode 100644 index 0000000000..5ed6eb6891 --- /dev/null +++ b/src/lib/libcrypto/x509v3/tabtest.c | |||
@@ -0,0 +1,88 @@ | |||
1 | /* tabtest.c */ | ||
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | ||
3 | * project 1999. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | /* Simple program to check the ext_dat.h is correct and print out | ||
60 | * problems if it is not. | ||
61 | */ | ||
62 | |||
63 | #include <stdio.h> | ||
64 | |||
65 | #include <openssl/x509v3.h> | ||
66 | |||
67 | #include "ext_dat.h" | ||
68 | |||
69 | main() | ||
70 | { | ||
71 | int i, prev = -1, bad = 0; | ||
72 | X509V3_EXT_METHOD **tmp; | ||
73 | i = sizeof(standard_exts) / sizeof(X509V3_EXT_METHOD *); | ||
74 | if(i != STANDARD_EXTENSION_COUNT) | ||
75 | fprintf(stderr, "Extension number invalid expecting %d\n", i); | ||
76 | tmp = standard_exts; | ||
77 | for(i = 0; i < STANDARD_EXTENSION_COUNT; i++, tmp++) { | ||
78 | if((*tmp)->ext_nid < prev) bad = 1; | ||
79 | prev = (*tmp)->ext_nid; | ||
80 | |||
81 | } | ||
82 | if(bad) { | ||
83 | tmp = standard_exts; | ||
84 | fprintf(stderr, "Extensions out of order!\n"); | ||
85 | for(i = 0; i < STANDARD_EXTENSION_COUNT; i++, tmp++) | ||
86 | printf("%d : %s\n", (*tmp)->ext_nid, OBJ_nid2sn((*tmp)->ext_nid)); | ||
87 | } else fprintf(stderr, "Order OK\n"); | ||
88 | } | ||
diff --git a/src/lib/libcrypto/x509v3/v3_addr.c b/src/lib/libcrypto/x509v3/v3_addr.c new file mode 100644 index 0000000000..efdf7c3ba7 --- /dev/null +++ b/src/lib/libcrypto/x509v3/v3_addr.c | |||
@@ -0,0 +1,1286 @@ | |||
1 | /* | ||
2 | * Contributed to the OpenSSL Project by the American Registry for | ||
3 | * Internet Numbers ("ARIN"). | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2006 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | */ | ||
57 | |||
58 | /* | ||
59 | * Implementation of RFC 3779 section 2.2. | ||
60 | */ | ||
61 | |||
62 | #include <stdio.h> | ||
63 | #include <stdlib.h> | ||
64 | |||
65 | #include "cryptlib.h" | ||
66 | #include <openssl/conf.h> | ||
67 | #include <openssl/asn1.h> | ||
68 | #include <openssl/asn1t.h> | ||
69 | #include <openssl/buffer.h> | ||
70 | #include <openssl/x509v3.h> | ||
71 | |||
72 | #ifndef OPENSSL_NO_RFC3779 | ||
73 | |||
74 | /* | ||
75 | * OpenSSL ASN.1 template translation of RFC 3779 2.2.3. | ||
76 | */ | ||
77 | |||
78 | ASN1_SEQUENCE(IPAddressRange) = { | ||
79 | ASN1_SIMPLE(IPAddressRange, min, ASN1_BIT_STRING), | ||
80 | ASN1_SIMPLE(IPAddressRange, max, ASN1_BIT_STRING) | ||
81 | } ASN1_SEQUENCE_END(IPAddressRange) | ||
82 | |||
83 | ASN1_CHOICE(IPAddressOrRange) = { | ||
84 | ASN1_SIMPLE(IPAddressOrRange, u.addressPrefix, ASN1_BIT_STRING), | ||
85 | ASN1_SIMPLE(IPAddressOrRange, u.addressRange, IPAddressRange) | ||
86 | } ASN1_CHOICE_END(IPAddressOrRange) | ||
87 | |||
88 | ASN1_CHOICE(IPAddressChoice) = { | ||
89 | ASN1_SIMPLE(IPAddressChoice, u.inherit, ASN1_NULL), | ||
90 | ASN1_SEQUENCE_OF(IPAddressChoice, u.addressesOrRanges, IPAddressOrRange) | ||
91 | } ASN1_CHOICE_END(IPAddressChoice) | ||
92 | |||
93 | ASN1_SEQUENCE(IPAddressFamily) = { | ||
94 | ASN1_SIMPLE(IPAddressFamily, addressFamily, ASN1_OCTET_STRING), | ||
95 | ASN1_SIMPLE(IPAddressFamily, ipAddressChoice, IPAddressChoice) | ||
96 | } ASN1_SEQUENCE_END(IPAddressFamily) | ||
97 | |||
98 | ASN1_ITEM_TEMPLATE(IPAddrBlocks) = | ||
99 | ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, | ||
100 | IPAddrBlocks, IPAddressFamily) | ||
101 | ASN1_ITEM_TEMPLATE_END(IPAddrBlocks) | ||
102 | |||
103 | IMPLEMENT_ASN1_FUNCTIONS(IPAddressRange) | ||
104 | IMPLEMENT_ASN1_FUNCTIONS(IPAddressOrRange) | ||
105 | IMPLEMENT_ASN1_FUNCTIONS(IPAddressChoice) | ||
106 | IMPLEMENT_ASN1_FUNCTIONS(IPAddressFamily) | ||
107 | |||
108 | /* | ||
109 | * How much buffer space do we need for a raw address? | ||
110 | */ | ||
111 | #define ADDR_RAW_BUF_LEN 16 | ||
112 | |||
113 | /* | ||
114 | * What's the address length associated with this AFI? | ||
115 | */ | ||
116 | static int length_from_afi(const unsigned afi) | ||
117 | { | ||
118 | switch (afi) { | ||
119 | case IANA_AFI_IPV4: | ||
120 | return 4; | ||
121 | case IANA_AFI_IPV6: | ||
122 | return 16; | ||
123 | default: | ||
124 | return 0; | ||
125 | } | ||
126 | } | ||
127 | |||
128 | /* | ||
129 | * Extract the AFI from an IPAddressFamily. | ||
130 | */ | ||
131 | unsigned int v3_addr_get_afi(const IPAddressFamily *f) | ||
132 | { | ||
133 | return ((f != NULL && | ||
134 | f->addressFamily != NULL && | ||
135 | f->addressFamily->data != NULL) | ||
136 | ? ((f->addressFamily->data[0] << 8) | | ||
137 | (f->addressFamily->data[1])) | ||
138 | : 0); | ||
139 | } | ||
140 | |||
141 | /* | ||
142 | * Expand the bitstring form of an address into a raw byte array. | ||
143 | * At the moment this is coded for simplicity, not speed. | ||
144 | */ | ||
145 | static void addr_expand(unsigned char *addr, | ||
146 | const ASN1_BIT_STRING *bs, | ||
147 | const int length, | ||
148 | const unsigned char fill) | ||
149 | { | ||
150 | OPENSSL_assert(bs->length >= 0 && bs->length <= length); | ||
151 | if (bs->length > 0) { | ||
152 | memcpy(addr, bs->data, bs->length); | ||
153 | if ((bs->flags & 7) != 0) { | ||
154 | unsigned char mask = 0xFF >> (8 - (bs->flags & 7)); | ||
155 | if (fill == 0) | ||
156 | addr[bs->length - 1] &= ~mask; | ||
157 | else | ||
158 | addr[bs->length - 1] |= mask; | ||
159 | } | ||
160 | } | ||
161 | memset(addr + bs->length, fill, length - bs->length); | ||
162 | } | ||
163 | |||
164 | /* | ||
165 | * Extract the prefix length from a bitstring. | ||
166 | */ | ||
167 | #define addr_prefixlen(bs) ((int) ((bs)->length * 8 - ((bs)->flags & 7))) | ||
168 | |||
169 | /* | ||
170 | * i2r handler for one address bitstring. | ||
171 | */ | ||
172 | static int i2r_address(BIO *out, | ||
173 | const unsigned afi, | ||
174 | const unsigned char fill, | ||
175 | const ASN1_BIT_STRING *bs) | ||
176 | { | ||
177 | unsigned char addr[ADDR_RAW_BUF_LEN]; | ||
178 | int i, n; | ||
179 | |||
180 | switch (afi) { | ||
181 | case IANA_AFI_IPV4: | ||
182 | addr_expand(addr, bs, 4, fill); | ||
183 | BIO_printf(out, "%d.%d.%d.%d", addr[0], addr[1], addr[2], addr[3]); | ||
184 | break; | ||
185 | case IANA_AFI_IPV6: | ||
186 | addr_expand(addr, bs, 16, fill); | ||
187 | for (n = 16; n > 1 && addr[n-1] == 0x00 && addr[n-2] == 0x00; n -= 2) | ||
188 | ; | ||
189 | for (i = 0; i < n; i += 2) | ||
190 | BIO_printf(out, "%x%s", (addr[i] << 8) | addr[i+1], (i < 14 ? ":" : "")); | ||
191 | if (i < 16) | ||
192 | BIO_puts(out, ":"); | ||
193 | if (i == 0) | ||
194 | BIO_puts(out, ":"); | ||
195 | break; | ||
196 | default: | ||
197 | for (i = 0; i < bs->length; i++) | ||
198 | BIO_printf(out, "%s%02x", (i > 0 ? ":" : ""), bs->data[i]); | ||
199 | BIO_printf(out, "[%d]", (int) (bs->flags & 7)); | ||
200 | break; | ||
201 | } | ||
202 | return 1; | ||
203 | } | ||
204 | |||
205 | /* | ||
206 | * i2r handler for a sequence of addresses and ranges. | ||
207 | */ | ||
208 | static int i2r_IPAddressOrRanges(BIO *out, | ||
209 | const int indent, | ||
210 | const IPAddressOrRanges *aors, | ||
211 | const unsigned afi) | ||
212 | { | ||
213 | int i; | ||
214 | for (i = 0; i < sk_IPAddressOrRange_num(aors); i++) { | ||
215 | const IPAddressOrRange *aor = sk_IPAddressOrRange_value(aors, i); | ||
216 | BIO_printf(out, "%*s", indent, ""); | ||
217 | switch (aor->type) { | ||
218 | case IPAddressOrRange_addressPrefix: | ||
219 | if (!i2r_address(out, afi, 0x00, aor->u.addressPrefix)) | ||
220 | return 0; | ||
221 | BIO_printf(out, "/%d\n", addr_prefixlen(aor->u.addressPrefix)); | ||
222 | continue; | ||
223 | case IPAddressOrRange_addressRange: | ||
224 | if (!i2r_address(out, afi, 0x00, aor->u.addressRange->min)) | ||
225 | return 0; | ||
226 | BIO_puts(out, "-"); | ||
227 | if (!i2r_address(out, afi, 0xFF, aor->u.addressRange->max)) | ||
228 | return 0; | ||
229 | BIO_puts(out, "\n"); | ||
230 | continue; | ||
231 | } | ||
232 | } | ||
233 | return 1; | ||
234 | } | ||
235 | |||
236 | /* | ||
237 | * i2r handler for an IPAddrBlocks extension. | ||
238 | */ | ||
239 | static int i2r_IPAddrBlocks(X509V3_EXT_METHOD *method, | ||
240 | void *ext, | ||
241 | BIO *out, | ||
242 | int indent) | ||
243 | { | ||
244 | const IPAddrBlocks *addr = ext; | ||
245 | int i; | ||
246 | for (i = 0; i < sk_IPAddressFamily_num(addr); i++) { | ||
247 | IPAddressFamily *f = sk_IPAddressFamily_value(addr, i); | ||
248 | const unsigned int afi = v3_addr_get_afi(f); | ||
249 | switch (afi) { | ||
250 | case IANA_AFI_IPV4: | ||
251 | BIO_printf(out, "%*sIPv4", indent, ""); | ||
252 | break; | ||
253 | case IANA_AFI_IPV6: | ||
254 | BIO_printf(out, "%*sIPv6", indent, ""); | ||
255 | break; | ||
256 | default: | ||
257 | BIO_printf(out, "%*sUnknown AFI %u", indent, "", afi); | ||
258 | break; | ||
259 | } | ||
260 | if (f->addressFamily->length > 2) { | ||
261 | switch (f->addressFamily->data[2]) { | ||
262 | case 1: | ||
263 | BIO_puts(out, " (Unicast)"); | ||
264 | break; | ||
265 | case 2: | ||
266 | BIO_puts(out, " (Multicast)"); | ||
267 | break; | ||
268 | case 3: | ||
269 | BIO_puts(out, " (Unicast/Multicast)"); | ||
270 | break; | ||
271 | case 4: | ||
272 | BIO_puts(out, " (MPLS)"); | ||
273 | break; | ||
274 | case 64: | ||
275 | BIO_puts(out, " (Tunnel)"); | ||
276 | break; | ||
277 | case 65: | ||
278 | BIO_puts(out, " (VPLS)"); | ||
279 | break; | ||
280 | case 66: | ||
281 | BIO_puts(out, " (BGP MDT)"); | ||
282 | break; | ||
283 | case 128: | ||
284 | BIO_puts(out, " (MPLS-labeled VPN)"); | ||
285 | break; | ||
286 | default: | ||
287 | BIO_printf(out, " (Unknown SAFI %u)", | ||
288 | (unsigned) f->addressFamily->data[2]); | ||
289 | break; | ||
290 | } | ||
291 | } | ||
292 | switch (f->ipAddressChoice->type) { | ||
293 | case IPAddressChoice_inherit: | ||
294 | BIO_puts(out, ": inherit\n"); | ||
295 | break; | ||
296 | case IPAddressChoice_addressesOrRanges: | ||
297 | BIO_puts(out, ":\n"); | ||
298 | if (!i2r_IPAddressOrRanges(out, | ||
299 | indent + 2, | ||
300 | f->ipAddressChoice->u.addressesOrRanges, | ||
301 | afi)) | ||
302 | return 0; | ||
303 | break; | ||
304 | } | ||
305 | } | ||
306 | return 1; | ||
307 | } | ||
308 | |||
309 | /* | ||
310 | * Sort comparison function for a sequence of IPAddressOrRange | ||
311 | * elements. | ||
312 | */ | ||
313 | static int IPAddressOrRange_cmp(const IPAddressOrRange *a, | ||
314 | const IPAddressOrRange *b, | ||
315 | const int length) | ||
316 | { | ||
317 | unsigned char addr_a[ADDR_RAW_BUF_LEN], addr_b[ADDR_RAW_BUF_LEN]; | ||
318 | int prefixlen_a = 0; | ||
319 | int prefixlen_b = 0; | ||
320 | int r; | ||
321 | |||
322 | switch (a->type) { | ||
323 | case IPAddressOrRange_addressPrefix: | ||
324 | addr_expand(addr_a, a->u.addressPrefix, length, 0x00); | ||
325 | prefixlen_a = addr_prefixlen(a->u.addressPrefix); | ||
326 | break; | ||
327 | case IPAddressOrRange_addressRange: | ||
328 | addr_expand(addr_a, a->u.addressRange->min, length, 0x00); | ||
329 | prefixlen_a = length * 8; | ||
330 | break; | ||
331 | } | ||
332 | |||
333 | switch (b->type) { | ||
334 | case IPAddressOrRange_addressPrefix: | ||
335 | addr_expand(addr_b, b->u.addressPrefix, length, 0x00); | ||
336 | prefixlen_b = addr_prefixlen(b->u.addressPrefix); | ||
337 | break; | ||
338 | case IPAddressOrRange_addressRange: | ||
339 | addr_expand(addr_b, b->u.addressRange->min, length, 0x00); | ||
340 | prefixlen_b = length * 8; | ||
341 | break; | ||
342 | } | ||
343 | |||
344 | if ((r = memcmp(addr_a, addr_b, length)) != 0) | ||
345 | return r; | ||
346 | else | ||
347 | return prefixlen_a - prefixlen_b; | ||
348 | } | ||
349 | |||
350 | /* | ||
351 | * IPv4-specific closure over IPAddressOrRange_cmp, since sk_sort() | ||
352 | * comparision routines are only allowed two arguments. | ||
353 | */ | ||
354 | static int v4IPAddressOrRange_cmp(const IPAddressOrRange * const *a, | ||
355 | const IPAddressOrRange * const *b) | ||
356 | { | ||
357 | return IPAddressOrRange_cmp(*a, *b, 4); | ||
358 | } | ||
359 | |||
360 | /* | ||
361 | * IPv6-specific closure over IPAddressOrRange_cmp, since sk_sort() | ||
362 | * comparision routines are only allowed two arguments. | ||
363 | */ | ||
364 | static int v6IPAddressOrRange_cmp(const IPAddressOrRange * const *a, | ||
365 | const IPAddressOrRange * const *b) | ||
366 | { | ||
367 | return IPAddressOrRange_cmp(*a, *b, 16); | ||
368 | } | ||
369 | |||
370 | /* | ||
371 | * Calculate whether a range collapses to a prefix. | ||
372 | * See last paragraph of RFC 3779 2.2.3.7. | ||
373 | */ | ||
374 | static int range_should_be_prefix(const unsigned char *min, | ||
375 | const unsigned char *max, | ||
376 | const int length) | ||
377 | { | ||
378 | unsigned char mask; | ||
379 | int i, j; | ||
380 | |||
381 | for (i = 0; i < length && min[i] == max[i]; i++) | ||
382 | ; | ||
383 | for (j = length - 1; j >= 0 && min[j] == 0x00 && max[j] == 0xFF; j--) | ||
384 | ; | ||
385 | if (i < j) | ||
386 | return -1; | ||
387 | if (i > j) | ||
388 | return i * 8; | ||
389 | mask = min[i] ^ max[i]; | ||
390 | switch (mask) { | ||
391 | case 0x01: j = 7; break; | ||
392 | case 0x03: j = 6; break; | ||
393 | case 0x07: j = 5; break; | ||
394 | case 0x0F: j = 4; break; | ||
395 | case 0x1F: j = 3; break; | ||
396 | case 0x3F: j = 2; break; | ||
397 | case 0x7F: j = 1; break; | ||
398 | default: return -1; | ||
399 | } | ||
400 | if ((min[i] & mask) != 0 || (max[i] & mask) != mask) | ||
401 | return -1; | ||
402 | else | ||
403 | return i * 8 + j; | ||
404 | } | ||
405 | |||
406 | /* | ||
407 | * Construct a prefix. | ||
408 | */ | ||
409 | static int make_addressPrefix(IPAddressOrRange **result, | ||
410 | unsigned char *addr, | ||
411 | const int prefixlen) | ||
412 | { | ||
413 | int bytelen = (prefixlen + 7) / 8, bitlen = prefixlen % 8; | ||
414 | IPAddressOrRange *aor = IPAddressOrRange_new(); | ||
415 | |||
416 | if (aor == NULL) | ||
417 | return 0; | ||
418 | aor->type = IPAddressOrRange_addressPrefix; | ||
419 | if (aor->u.addressPrefix == NULL && | ||
420 | (aor->u.addressPrefix = ASN1_BIT_STRING_new()) == NULL) | ||
421 | goto err; | ||
422 | if (!ASN1_BIT_STRING_set(aor->u.addressPrefix, addr, bytelen)) | ||
423 | goto err; | ||
424 | aor->u.addressPrefix->flags &= ~7; | ||
425 | aor->u.addressPrefix->flags |= ASN1_STRING_FLAG_BITS_LEFT; | ||
426 | if (bitlen > 0) { | ||
427 | aor->u.addressPrefix->data[bytelen - 1] &= ~(0xFF >> bitlen); | ||
428 | aor->u.addressPrefix->flags |= 8 - bitlen; | ||
429 | } | ||
430 | |||
431 | *result = aor; | ||
432 | return 1; | ||
433 | |||
434 | err: | ||
435 | IPAddressOrRange_free(aor); | ||
436 | return 0; | ||
437 | } | ||
438 | |||
439 | /* | ||
440 | * Construct a range. If it can be expressed as a prefix, | ||
441 | * return a prefix instead. Doing this here simplifies | ||
442 | * the rest of the code considerably. | ||
443 | */ | ||
444 | static int make_addressRange(IPAddressOrRange **result, | ||
445 | unsigned char *min, | ||
446 | unsigned char *max, | ||
447 | const int length) | ||
448 | { | ||
449 | IPAddressOrRange *aor; | ||
450 | int i, prefixlen; | ||
451 | |||
452 | if ((prefixlen = range_should_be_prefix(min, max, length)) >= 0) | ||
453 | return make_addressPrefix(result, min, prefixlen); | ||
454 | |||
455 | if ((aor = IPAddressOrRange_new()) == NULL) | ||
456 | return 0; | ||
457 | aor->type = IPAddressOrRange_addressRange; | ||
458 | OPENSSL_assert(aor->u.addressRange == NULL); | ||
459 | if ((aor->u.addressRange = IPAddressRange_new()) == NULL) | ||
460 | goto err; | ||
461 | if (aor->u.addressRange->min == NULL && | ||
462 | (aor->u.addressRange->min = ASN1_BIT_STRING_new()) == NULL) | ||
463 | goto err; | ||
464 | if (aor->u.addressRange->max == NULL && | ||
465 | (aor->u.addressRange->max = ASN1_BIT_STRING_new()) == NULL) | ||
466 | goto err; | ||
467 | |||
468 | for (i = length; i > 0 && min[i - 1] == 0x00; --i) | ||
469 | ; | ||
470 | if (!ASN1_BIT_STRING_set(aor->u.addressRange->min, min, i)) | ||
471 | goto err; | ||
472 | aor->u.addressRange->min->flags &= ~7; | ||
473 | aor->u.addressRange->min->flags |= ASN1_STRING_FLAG_BITS_LEFT; | ||
474 | if (i > 0) { | ||
475 | unsigned char b = min[i - 1]; | ||
476 | int j = 1; | ||
477 | while ((b & (0xFFU >> j)) != 0) | ||
478 | ++j; | ||
479 | aor->u.addressRange->min->flags |= 8 - j; | ||
480 | } | ||
481 | |||
482 | for (i = length; i > 0 && max[i - 1] == 0xFF; --i) | ||
483 | ; | ||
484 | if (!ASN1_BIT_STRING_set(aor->u.addressRange->max, max, i)) | ||
485 | goto err; | ||
486 | aor->u.addressRange->max->flags &= ~7; | ||
487 | aor->u.addressRange->max->flags |= ASN1_STRING_FLAG_BITS_LEFT; | ||
488 | if (i > 0) { | ||
489 | unsigned char b = max[i - 1]; | ||
490 | int j = 1; | ||
491 | while ((b & (0xFFU >> j)) != (0xFFU >> j)) | ||
492 | ++j; | ||
493 | aor->u.addressRange->max->flags |= 8 - j; | ||
494 | } | ||
495 | |||
496 | *result = aor; | ||
497 | return 1; | ||
498 | |||
499 | err: | ||
500 | IPAddressOrRange_free(aor); | ||
501 | return 0; | ||
502 | } | ||
503 | |||
504 | /* | ||
505 | * Construct a new address family or find an existing one. | ||
506 | */ | ||
507 | static IPAddressFamily *make_IPAddressFamily(IPAddrBlocks *addr, | ||
508 | const unsigned afi, | ||
509 | const unsigned *safi) | ||
510 | { | ||
511 | IPAddressFamily *f; | ||
512 | unsigned char key[3]; | ||
513 | unsigned keylen; | ||
514 | int i; | ||
515 | |||
516 | key[0] = (afi >> 8) & 0xFF; | ||
517 | key[1] = afi & 0xFF; | ||
518 | if (safi != NULL) { | ||
519 | key[2] = *safi & 0xFF; | ||
520 | keylen = 3; | ||
521 | } else { | ||
522 | keylen = 2; | ||
523 | } | ||
524 | |||
525 | for (i = 0; i < sk_IPAddressFamily_num(addr); i++) { | ||
526 | f = sk_IPAddressFamily_value(addr, i); | ||
527 | OPENSSL_assert(f->addressFamily->data != NULL); | ||
528 | if (f->addressFamily->length == keylen && | ||
529 | !memcmp(f->addressFamily->data, key, keylen)) | ||
530 | return f; | ||
531 | } | ||
532 | |||
533 | if ((f = IPAddressFamily_new()) == NULL) | ||
534 | goto err; | ||
535 | if (f->ipAddressChoice == NULL && | ||
536 | (f->ipAddressChoice = IPAddressChoice_new()) == NULL) | ||
537 | goto err; | ||
538 | if (f->addressFamily == NULL && | ||
539 | (f->addressFamily = ASN1_OCTET_STRING_new()) == NULL) | ||
540 | goto err; | ||
541 | if (!ASN1_OCTET_STRING_set(f->addressFamily, key, keylen)) | ||
542 | goto err; | ||
543 | if (!sk_IPAddressFamily_push(addr, f)) | ||
544 | goto err; | ||
545 | |||
546 | return f; | ||
547 | |||
548 | err: | ||
549 | IPAddressFamily_free(f); | ||
550 | return NULL; | ||
551 | } | ||
552 | |||
553 | /* | ||
554 | * Add an inheritance element. | ||
555 | */ | ||
556 | int v3_addr_add_inherit(IPAddrBlocks *addr, | ||
557 | const unsigned afi, | ||
558 | const unsigned *safi) | ||
559 | { | ||
560 | IPAddressFamily *f = make_IPAddressFamily(addr, afi, safi); | ||
561 | if (f == NULL || | ||
562 | f->ipAddressChoice == NULL || | ||
563 | (f->ipAddressChoice->type == IPAddressChoice_addressesOrRanges && | ||
564 | f->ipAddressChoice->u.addressesOrRanges != NULL)) | ||
565 | return 0; | ||
566 | if (f->ipAddressChoice->type == IPAddressChoice_inherit && | ||
567 | f->ipAddressChoice->u.inherit != NULL) | ||
568 | return 1; | ||
569 | if (f->ipAddressChoice->u.inherit == NULL && | ||
570 | (f->ipAddressChoice->u.inherit = ASN1_NULL_new()) == NULL) | ||
571 | return 0; | ||
572 | f->ipAddressChoice->type = IPAddressChoice_inherit; | ||
573 | return 1; | ||
574 | } | ||
575 | |||
576 | /* | ||
577 | * Construct an IPAddressOrRange sequence, or return an existing one. | ||
578 | */ | ||
579 | static IPAddressOrRanges *make_prefix_or_range(IPAddrBlocks *addr, | ||
580 | const unsigned afi, | ||
581 | const unsigned *safi) | ||
582 | { | ||
583 | IPAddressFamily *f = make_IPAddressFamily(addr, afi, safi); | ||
584 | IPAddressOrRanges *aors = NULL; | ||
585 | |||
586 | if (f == NULL || | ||
587 | f->ipAddressChoice == NULL || | ||
588 | (f->ipAddressChoice->type == IPAddressChoice_inherit && | ||
589 | f->ipAddressChoice->u.inherit != NULL)) | ||
590 | return NULL; | ||
591 | if (f->ipAddressChoice->type == IPAddressChoice_addressesOrRanges) | ||
592 | aors = f->ipAddressChoice->u.addressesOrRanges; | ||
593 | if (aors != NULL) | ||
594 | return aors; | ||
595 | if ((aors = sk_IPAddressOrRange_new_null()) == NULL) | ||
596 | return NULL; | ||
597 | switch (afi) { | ||
598 | case IANA_AFI_IPV4: | ||
599 | (void)sk_IPAddressOrRange_set_cmp_func(aors, v4IPAddressOrRange_cmp); | ||
600 | break; | ||
601 | case IANA_AFI_IPV6: | ||
602 | (void)sk_IPAddressOrRange_set_cmp_func(aors, v6IPAddressOrRange_cmp); | ||
603 | break; | ||
604 | } | ||
605 | f->ipAddressChoice->type = IPAddressChoice_addressesOrRanges; | ||
606 | f->ipAddressChoice->u.addressesOrRanges = aors; | ||
607 | return aors; | ||
608 | } | ||
609 | |||
610 | /* | ||
611 | * Add a prefix. | ||
612 | */ | ||
613 | int v3_addr_add_prefix(IPAddrBlocks *addr, | ||
614 | const unsigned afi, | ||
615 | const unsigned *safi, | ||
616 | unsigned char *a, | ||
617 | const int prefixlen) | ||
618 | { | ||
619 | IPAddressOrRanges *aors = make_prefix_or_range(addr, afi, safi); | ||
620 | IPAddressOrRange *aor; | ||
621 | if (aors == NULL || !make_addressPrefix(&aor, a, prefixlen)) | ||
622 | return 0; | ||
623 | if (sk_IPAddressOrRange_push(aors, aor)) | ||
624 | return 1; | ||
625 | IPAddressOrRange_free(aor); | ||
626 | return 0; | ||
627 | } | ||
628 | |||
629 | /* | ||
630 | * Add a range. | ||
631 | */ | ||
632 | int v3_addr_add_range(IPAddrBlocks *addr, | ||
633 | const unsigned afi, | ||
634 | const unsigned *safi, | ||
635 | unsigned char *min, | ||
636 | unsigned char *max) | ||
637 | { | ||
638 | IPAddressOrRanges *aors = make_prefix_or_range(addr, afi, safi); | ||
639 | IPAddressOrRange *aor; | ||
640 | int length = length_from_afi(afi); | ||
641 | if (aors == NULL) | ||
642 | return 0; | ||
643 | if (!make_addressRange(&aor, min, max, length)) | ||
644 | return 0; | ||
645 | if (sk_IPAddressOrRange_push(aors, aor)) | ||
646 | return 1; | ||
647 | IPAddressOrRange_free(aor); | ||
648 | return 0; | ||
649 | } | ||
650 | |||
651 | /* | ||
652 | * Extract min and max values from an IPAddressOrRange. | ||
653 | */ | ||
654 | static void extract_min_max(IPAddressOrRange *aor, | ||
655 | unsigned char *min, | ||
656 | unsigned char *max, | ||
657 | int length) | ||
658 | { | ||
659 | OPENSSL_assert(aor != NULL && min != NULL && max != NULL); | ||
660 | switch (aor->type) { | ||
661 | case IPAddressOrRange_addressPrefix: | ||
662 | addr_expand(min, aor->u.addressPrefix, length, 0x00); | ||
663 | addr_expand(max, aor->u.addressPrefix, length, 0xFF); | ||
664 | return; | ||
665 | case IPAddressOrRange_addressRange: | ||
666 | addr_expand(min, aor->u.addressRange->min, length, 0x00); | ||
667 | addr_expand(max, aor->u.addressRange->max, length, 0xFF); | ||
668 | return; | ||
669 | } | ||
670 | } | ||
671 | |||
672 | /* | ||
673 | * Public wrapper for extract_min_max(). | ||
674 | */ | ||
675 | int v3_addr_get_range(IPAddressOrRange *aor, | ||
676 | const unsigned afi, | ||
677 | unsigned char *min, | ||
678 | unsigned char *max, | ||
679 | const int length) | ||
680 | { | ||
681 | int afi_length = length_from_afi(afi); | ||
682 | if (aor == NULL || min == NULL || max == NULL || | ||
683 | afi_length == 0 || length < afi_length || | ||
684 | (aor->type != IPAddressOrRange_addressPrefix && | ||
685 | aor->type != IPAddressOrRange_addressRange)) | ||
686 | return 0; | ||
687 | extract_min_max(aor, min, max, afi_length); | ||
688 | return afi_length; | ||
689 | } | ||
690 | |||
691 | /* | ||
692 | * Sort comparision function for a sequence of IPAddressFamily. | ||
693 | * | ||
694 | * The last paragraph of RFC 3779 2.2.3.3 is slightly ambiguous about | ||
695 | * the ordering: I can read it as meaning that IPv6 without a SAFI | ||
696 | * comes before IPv4 with a SAFI, which seems pretty weird. The | ||
697 | * examples in appendix B suggest that the author intended the | ||
698 | * null-SAFI rule to apply only within a single AFI, which is what I | ||
699 | * would have expected and is what the following code implements. | ||
700 | */ | ||
701 | static int IPAddressFamily_cmp(const IPAddressFamily * const *a_, | ||
702 | const IPAddressFamily * const *b_) | ||
703 | { | ||
704 | const ASN1_OCTET_STRING *a = (*a_)->addressFamily; | ||
705 | const ASN1_OCTET_STRING *b = (*b_)->addressFamily; | ||
706 | int len = ((a->length <= b->length) ? a->length : b->length); | ||
707 | int cmp = memcmp(a->data, b->data, len); | ||
708 | return cmp ? cmp : a->length - b->length; | ||
709 | } | ||
710 | |||
711 | /* | ||
712 | * Check whether an IPAddrBLocks is in canonical form. | ||
713 | */ | ||
714 | int v3_addr_is_canonical(IPAddrBlocks *addr) | ||
715 | { | ||
716 | unsigned char a_min[ADDR_RAW_BUF_LEN], a_max[ADDR_RAW_BUF_LEN]; | ||
717 | unsigned char b_min[ADDR_RAW_BUF_LEN], b_max[ADDR_RAW_BUF_LEN]; | ||
718 | IPAddressOrRanges *aors; | ||
719 | int i, j, k; | ||
720 | |||
721 | /* | ||
722 | * Empty extension is cannonical. | ||
723 | */ | ||
724 | if (addr == NULL) | ||
725 | return 1; | ||
726 | |||
727 | /* | ||
728 | * Check whether the top-level list is in order. | ||
729 | */ | ||
730 | for (i = 0; i < sk_IPAddressFamily_num(addr) - 1; i++) { | ||
731 | const IPAddressFamily *a = sk_IPAddressFamily_value(addr, i); | ||
732 | const IPAddressFamily *b = sk_IPAddressFamily_value(addr, i + 1); | ||
733 | if (IPAddressFamily_cmp(&a, &b) >= 0) | ||
734 | return 0; | ||
735 | } | ||
736 | |||
737 | /* | ||
738 | * Top level's ok, now check each address family. | ||
739 | */ | ||
740 | for (i = 0; i < sk_IPAddressFamily_num(addr); i++) { | ||
741 | IPAddressFamily *f = sk_IPAddressFamily_value(addr, i); | ||
742 | int length = length_from_afi(v3_addr_get_afi(f)); | ||
743 | |||
744 | /* | ||
745 | * Inheritance is canonical. Anything other than inheritance or | ||
746 | * a SEQUENCE OF IPAddressOrRange is an ASN.1 error or something. | ||
747 | */ | ||
748 | if (f == NULL || f->ipAddressChoice == NULL) | ||
749 | return 0; | ||
750 | switch (f->ipAddressChoice->type) { | ||
751 | case IPAddressChoice_inherit: | ||
752 | continue; | ||
753 | case IPAddressChoice_addressesOrRanges: | ||
754 | break; | ||
755 | default: | ||
756 | return 0; | ||
757 | } | ||
758 | |||
759 | /* | ||
760 | * It's an IPAddressOrRanges sequence, check it. | ||
761 | */ | ||
762 | aors = f->ipAddressChoice->u.addressesOrRanges; | ||
763 | if (sk_IPAddressOrRange_num(aors) == 0) | ||
764 | return 0; | ||
765 | for (j = 0; j < sk_IPAddressOrRange_num(aors) - 1; j++) { | ||
766 | IPAddressOrRange *a = sk_IPAddressOrRange_value(aors, j); | ||
767 | IPAddressOrRange *b = sk_IPAddressOrRange_value(aors, j + 1); | ||
768 | |||
769 | extract_min_max(a, a_min, a_max, length); | ||
770 | extract_min_max(b, b_min, b_max, length); | ||
771 | |||
772 | /* | ||
773 | * Punt misordered list, overlapping start, or inverted range. | ||
774 | */ | ||
775 | if (memcmp(a_min, b_min, length) >= 0 || | ||
776 | memcmp(a_min, a_max, length) > 0 || | ||
777 | memcmp(b_min, b_max, length) > 0) | ||
778 | return 0; | ||
779 | |||
780 | /* | ||
781 | * Punt if adjacent or overlapping. Check for adjacency by | ||
782 | * subtracting one from b_min first. | ||
783 | */ | ||
784 | for (k = length - 1; k >= 0 && b_min[k]-- == 0x00; k--) | ||
785 | ; | ||
786 | if (memcmp(a_max, b_min, length) >= 0) | ||
787 | return 0; | ||
788 | |||
789 | /* | ||
790 | * Check for range that should be expressed as a prefix. | ||
791 | */ | ||
792 | if (a->type == IPAddressOrRange_addressRange && | ||
793 | range_should_be_prefix(a_min, a_max, length) >= 0) | ||
794 | return 0; | ||
795 | } | ||
796 | |||
797 | /* | ||
798 | * Check final range to see if it should be a prefix. | ||
799 | */ | ||
800 | j = sk_IPAddressOrRange_num(aors) - 1; | ||
801 | { | ||
802 | IPAddressOrRange *a = sk_IPAddressOrRange_value(aors, j); | ||
803 | if (a->type == IPAddressOrRange_addressRange) { | ||
804 | extract_min_max(a, a_min, a_max, length); | ||
805 | if (range_should_be_prefix(a_min, a_max, length) >= 0) | ||
806 | return 0; | ||
807 | } | ||
808 | } | ||
809 | } | ||
810 | |||
811 | /* | ||
812 | * If we made it through all that, we're happy. | ||
813 | */ | ||
814 | return 1; | ||
815 | } | ||
816 | |||
817 | /* | ||
818 | * Whack an IPAddressOrRanges into canonical form. | ||
819 | */ | ||
820 | static int IPAddressOrRanges_canonize(IPAddressOrRanges *aors, | ||
821 | const unsigned afi) | ||
822 | { | ||
823 | int i, j, length = length_from_afi(afi); | ||
824 | |||
825 | /* | ||
826 | * Sort the IPAddressOrRanges sequence. | ||
827 | */ | ||
828 | sk_IPAddressOrRange_sort(aors); | ||
829 | |||
830 | /* | ||
831 | * Clean up representation issues, punt on duplicates or overlaps. | ||
832 | */ | ||
833 | for (i = 0; i < sk_IPAddressOrRange_num(aors) - 1; i++) { | ||
834 | IPAddressOrRange *a = sk_IPAddressOrRange_value(aors, i); | ||
835 | IPAddressOrRange *b = sk_IPAddressOrRange_value(aors, i + 1); | ||
836 | unsigned char a_min[ADDR_RAW_BUF_LEN], a_max[ADDR_RAW_BUF_LEN]; | ||
837 | unsigned char b_min[ADDR_RAW_BUF_LEN], b_max[ADDR_RAW_BUF_LEN]; | ||
838 | |||
839 | extract_min_max(a, a_min, a_max, length); | ||
840 | extract_min_max(b, b_min, b_max, length); | ||
841 | |||
842 | /* | ||
843 | * Punt overlaps. | ||
844 | */ | ||
845 | if (memcmp(a_max, b_min, length) >= 0) | ||
846 | return 0; | ||
847 | |||
848 | /* | ||
849 | * Merge if a and b are adjacent. We check for | ||
850 | * adjacency by subtracting one from b_min first. | ||
851 | */ | ||
852 | for (j = length - 1; j >= 0 && b_min[j]-- == 0x00; j--) | ||
853 | ; | ||
854 | if (memcmp(a_max, b_min, length) == 0) { | ||
855 | IPAddressOrRange *merged; | ||
856 | if (!make_addressRange(&merged, a_min, b_max, length)) | ||
857 | return 0; | ||
858 | sk_IPAddressOrRange_set(aors, i, merged); | ||
859 | (void)sk_IPAddressOrRange_delete(aors, i + 1); | ||
860 | IPAddressOrRange_free(a); | ||
861 | IPAddressOrRange_free(b); | ||
862 | --i; | ||
863 | continue; | ||
864 | } | ||
865 | } | ||
866 | |||
867 | return 1; | ||
868 | } | ||
869 | |||
870 | /* | ||
871 | * Whack an IPAddrBlocks extension into canonical form. | ||
872 | */ | ||
873 | int v3_addr_canonize(IPAddrBlocks *addr) | ||
874 | { | ||
875 | int i; | ||
876 | for (i = 0; i < sk_IPAddressFamily_num(addr); i++) { | ||
877 | IPAddressFamily *f = sk_IPAddressFamily_value(addr, i); | ||
878 | if (f->ipAddressChoice->type == IPAddressChoice_addressesOrRanges && | ||
879 | !IPAddressOrRanges_canonize(f->ipAddressChoice->u.addressesOrRanges, | ||
880 | v3_addr_get_afi(f))) | ||
881 | return 0; | ||
882 | } | ||
883 | (void)sk_IPAddressFamily_set_cmp_func(addr, IPAddressFamily_cmp); | ||
884 | sk_IPAddressFamily_sort(addr); | ||
885 | OPENSSL_assert(v3_addr_is_canonical(addr)); | ||
886 | return 1; | ||
887 | } | ||
888 | |||
889 | /* | ||
890 | * v2i handler for the IPAddrBlocks extension. | ||
891 | */ | ||
892 | static void *v2i_IPAddrBlocks(struct v3_ext_method *method, | ||
893 | struct v3_ext_ctx *ctx, | ||
894 | STACK_OF(CONF_VALUE) *values) | ||
895 | { | ||
896 | static const char v4addr_chars[] = "0123456789."; | ||
897 | static const char v6addr_chars[] = "0123456789.:abcdefABCDEF"; | ||
898 | IPAddrBlocks *addr = NULL; | ||
899 | char *s = NULL, *t; | ||
900 | int i; | ||
901 | |||
902 | if ((addr = sk_IPAddressFamily_new(IPAddressFamily_cmp)) == NULL) { | ||
903 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE); | ||
904 | return NULL; | ||
905 | } | ||
906 | |||
907 | for (i = 0; i < sk_CONF_VALUE_num(values); i++) { | ||
908 | CONF_VALUE *val = sk_CONF_VALUE_value(values, i); | ||
909 | unsigned char min[ADDR_RAW_BUF_LEN], max[ADDR_RAW_BUF_LEN]; | ||
910 | unsigned afi, *safi = NULL, safi_; | ||
911 | const char *addr_chars; | ||
912 | int prefixlen, i1, i2, delim, length; | ||
913 | |||
914 | if ( !name_cmp(val->name, "IPv4")) { | ||
915 | afi = IANA_AFI_IPV4; | ||
916 | } else if (!name_cmp(val->name, "IPv6")) { | ||
917 | afi = IANA_AFI_IPV6; | ||
918 | } else if (!name_cmp(val->name, "IPv4-SAFI")) { | ||
919 | afi = IANA_AFI_IPV4; | ||
920 | safi = &safi_; | ||
921 | } else if (!name_cmp(val->name, "IPv6-SAFI")) { | ||
922 | afi = IANA_AFI_IPV6; | ||
923 | safi = &safi_; | ||
924 | } else { | ||
925 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_EXTENSION_NAME_ERROR); | ||
926 | X509V3_conf_err(val); | ||
927 | goto err; | ||
928 | } | ||
929 | |||
930 | switch (afi) { | ||
931 | case IANA_AFI_IPV4: | ||
932 | addr_chars = v4addr_chars; | ||
933 | break; | ||
934 | case IANA_AFI_IPV6: | ||
935 | addr_chars = v6addr_chars; | ||
936 | break; | ||
937 | } | ||
938 | |||
939 | length = length_from_afi(afi); | ||
940 | |||
941 | /* | ||
942 | * Handle SAFI, if any, and BUF_strdup() so we can null-terminate | ||
943 | * the other input values. | ||
944 | */ | ||
945 | if (safi != NULL) { | ||
946 | *safi = strtoul(val->value, &t, 0); | ||
947 | t += strspn(t, " \t"); | ||
948 | if (*safi > 0xFF || *t++ != ':') { | ||
949 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_INVALID_SAFI); | ||
950 | X509V3_conf_err(val); | ||
951 | goto err; | ||
952 | } | ||
953 | t += strspn(t, " \t"); | ||
954 | s = BUF_strdup(t); | ||
955 | } else { | ||
956 | s = BUF_strdup(val->value); | ||
957 | } | ||
958 | if (s == NULL) { | ||
959 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE); | ||
960 | goto err; | ||
961 | } | ||
962 | |||
963 | /* | ||
964 | * Check for inheritance. Not worth additional complexity to | ||
965 | * optimize this (seldom-used) case. | ||
966 | */ | ||
967 | if (!strcmp(s, "inherit")) { | ||
968 | if (!v3_addr_add_inherit(addr, afi, safi)) { | ||
969 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_INVALID_INHERITANCE); | ||
970 | X509V3_conf_err(val); | ||
971 | goto err; | ||
972 | } | ||
973 | OPENSSL_free(s); | ||
974 | s = NULL; | ||
975 | continue; | ||
976 | } | ||
977 | |||
978 | i1 = strspn(s, addr_chars); | ||
979 | i2 = i1 + strspn(s + i1, " \t"); | ||
980 | delim = s[i2++]; | ||
981 | s[i1] = '\0'; | ||
982 | |||
983 | if (a2i_ipadd(min, s) != length) { | ||
984 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_INVALID_IPADDRESS); | ||
985 | X509V3_conf_err(val); | ||
986 | goto err; | ||
987 | } | ||
988 | |||
989 | switch (delim) { | ||
990 | case '/': | ||
991 | prefixlen = (int) strtoul(s + i2, &t, 10); | ||
992 | if (t == s + i2 || *t != '\0') { | ||
993 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_EXTENSION_VALUE_ERROR); | ||
994 | X509V3_conf_err(val); | ||
995 | goto err; | ||
996 | } | ||
997 | if (!v3_addr_add_prefix(addr, afi, safi, min, prefixlen)) { | ||
998 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE); | ||
999 | goto err; | ||
1000 | } | ||
1001 | break; | ||
1002 | case '-': | ||
1003 | i1 = i2 + strspn(s + i2, " \t"); | ||
1004 | i2 = i1 + strspn(s + i1, addr_chars); | ||
1005 | if (i1 == i2 || s[i2] != '\0') { | ||
1006 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_EXTENSION_VALUE_ERROR); | ||
1007 | X509V3_conf_err(val); | ||
1008 | goto err; | ||
1009 | } | ||
1010 | if (a2i_ipadd(max, s + i1) != length) { | ||
1011 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_INVALID_IPADDRESS); | ||
1012 | X509V3_conf_err(val); | ||
1013 | goto err; | ||
1014 | } | ||
1015 | if (!v3_addr_add_range(addr, afi, safi, min, max)) { | ||
1016 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE); | ||
1017 | goto err; | ||
1018 | } | ||
1019 | break; | ||
1020 | case '\0': | ||
1021 | if (!v3_addr_add_prefix(addr, afi, safi, min, length * 8)) { | ||
1022 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE); | ||
1023 | goto err; | ||
1024 | } | ||
1025 | break; | ||
1026 | default: | ||
1027 | X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_EXTENSION_VALUE_ERROR); | ||
1028 | X509V3_conf_err(val); | ||
1029 | goto err; | ||
1030 | } | ||
1031 | |||
1032 | OPENSSL_free(s); | ||
1033 | s = NULL; | ||
1034 | } | ||
1035 | |||
1036 | /* | ||
1037 | * Canonize the result, then we're done. | ||
1038 | */ | ||
1039 | if (!v3_addr_canonize(addr)) | ||
1040 | goto err; | ||
1041 | return addr; | ||
1042 | |||
1043 | err: | ||
1044 | OPENSSL_free(s); | ||
1045 | sk_IPAddressFamily_pop_free(addr, IPAddressFamily_free); | ||
1046 | return NULL; | ||
1047 | } | ||
1048 | |||
1049 | /* | ||
1050 | * OpenSSL dispatch | ||
1051 | */ | ||
1052 | const X509V3_EXT_METHOD v3_addr = { | ||
1053 | NID_sbgp_ipAddrBlock, /* nid */ | ||
1054 | 0, /* flags */ | ||
1055 | ASN1_ITEM_ref(IPAddrBlocks), /* template */ | ||
1056 | 0, 0, 0, 0, /* old functions, ignored */ | ||
1057 | 0, /* i2s */ | ||
1058 | 0, /* s2i */ | ||
1059 | 0, /* i2v */ | ||
1060 | v2i_IPAddrBlocks, /* v2i */ | ||
1061 | i2r_IPAddrBlocks, /* i2r */ | ||
1062 | 0, /* r2i */ | ||
1063 | NULL /* extension-specific data */ | ||
1064 | }; | ||
1065 | |||
1066 | /* | ||
1067 | * Figure out whether extension sues inheritance. | ||
1068 | */ | ||
1069 | int v3_addr_inherits(IPAddrBlocks *addr) | ||
1070 | { | ||
1071 | int i; | ||
1072 | if (addr == NULL) | ||
1073 | return 0; | ||
1074 | for (i = 0; i < sk_IPAddressFamily_num(addr); i++) { | ||
1075 | IPAddressFamily *f = sk_IPAddressFamily_value(addr, i); | ||
1076 | if (f->ipAddressChoice->type == IPAddressChoice_inherit) | ||
1077 | return 1; | ||
1078 | } | ||
1079 | return 0; | ||
1080 | } | ||
1081 | |||
1082 | /* | ||
1083 | * Figure out whether parent contains child. | ||
1084 | */ | ||
1085 | static int addr_contains(IPAddressOrRanges *parent, | ||
1086 | IPAddressOrRanges *child, | ||
1087 | int length) | ||
1088 | { | ||
1089 | unsigned char p_min[ADDR_RAW_BUF_LEN], p_max[ADDR_RAW_BUF_LEN]; | ||
1090 | unsigned char c_min[ADDR_RAW_BUF_LEN], c_max[ADDR_RAW_BUF_LEN]; | ||
1091 | int p, c; | ||
1092 | |||
1093 | if (child == NULL || parent == child) | ||
1094 | return 1; | ||
1095 | if (parent == NULL) | ||
1096 | return 0; | ||
1097 | |||
1098 | p = 0; | ||
1099 | for (c = 0; c < sk_IPAddressOrRange_num(child); c++) { | ||
1100 | extract_min_max(sk_IPAddressOrRange_value(child, c), | ||
1101 | c_min, c_max, length); | ||
1102 | for (;; p++) { | ||
1103 | if (p >= sk_IPAddressOrRange_num(parent)) | ||
1104 | return 0; | ||
1105 | extract_min_max(sk_IPAddressOrRange_value(parent, p), | ||
1106 | p_min, p_max, length); | ||
1107 | if (memcmp(p_max, c_max, length) < 0) | ||
1108 | continue; | ||
1109 | if (memcmp(p_min, c_min, length) > 0) | ||
1110 | return 0; | ||
1111 | break; | ||
1112 | } | ||
1113 | } | ||
1114 | |||
1115 | return 1; | ||
1116 | } | ||
1117 | |||
1118 | /* | ||
1119 | * Test whether a is a subset of b. | ||
1120 | */ | ||
1121 | int v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b) | ||
1122 | { | ||
1123 | int i; | ||
1124 | if (a == NULL || a == b) | ||
1125 | return 1; | ||
1126 | if (b == NULL || v3_addr_inherits(a) || v3_addr_inherits(b)) | ||
1127 | return 0; | ||
1128 | (void)sk_IPAddressFamily_set_cmp_func(b, IPAddressFamily_cmp); | ||
1129 | for (i = 0; i < sk_IPAddressFamily_num(a); i++) { | ||
1130 | IPAddressFamily *fa = sk_IPAddressFamily_value(a, i); | ||
1131 | int j = sk_IPAddressFamily_find(b, fa); | ||
1132 | IPAddressFamily *fb; | ||
1133 | fb = sk_IPAddressFamily_value(b, j); | ||
1134 | if (fb == NULL) | ||
1135 | return 0; | ||
1136 | if (!addr_contains(fb->ipAddressChoice->u.addressesOrRanges, | ||
1137 | fa->ipAddressChoice->u.addressesOrRanges, | ||
1138 | length_from_afi(v3_addr_get_afi(fb)))) | ||
1139 | return 0; | ||
1140 | } | ||
1141 | return 1; | ||
1142 | } | ||
1143 | |||
1144 | /* | ||
1145 | * Validation error handling via callback. | ||
1146 | */ | ||
1147 | #define validation_err(_err_) \ | ||
1148 | do { \ | ||
1149 | if (ctx != NULL) { \ | ||
1150 | ctx->error = _err_; \ | ||
1151 | ctx->error_depth = i; \ | ||
1152 | ctx->current_cert = x; \ | ||
1153 | ret = ctx->verify_cb(0, ctx); \ | ||
1154 | } else { \ | ||
1155 | ret = 0; \ | ||
1156 | } \ | ||
1157 | if (!ret) \ | ||
1158 | goto done; \ | ||
1159 | } while (0) | ||
1160 | |||
1161 | /* | ||
1162 | * Core code for RFC 3779 2.3 path validation. | ||
1163 | */ | ||
1164 | static int v3_addr_validate_path_internal(X509_STORE_CTX *ctx, | ||
1165 | STACK_OF(X509) *chain, | ||
1166 | IPAddrBlocks *ext) | ||
1167 | { | ||
1168 | IPAddrBlocks *child = NULL; | ||
1169 | int i, j, ret = 1; | ||
1170 | X509 *x = NULL; | ||
1171 | |||
1172 | OPENSSL_assert(chain != NULL && sk_X509_num(chain) > 0); | ||
1173 | OPENSSL_assert(ctx != NULL || ext != NULL); | ||
1174 | OPENSSL_assert(ctx == NULL || ctx->verify_cb != NULL); | ||
1175 | |||
1176 | /* | ||
1177 | * Figure out where to start. If we don't have an extension to | ||
1178 | * check, we're done. Otherwise, check canonical form and | ||
1179 | * set up for walking up the chain. | ||
1180 | */ | ||
1181 | if (ext != NULL) { | ||
1182 | i = -1; | ||
1183 | } else { | ||
1184 | i = 0; | ||
1185 | x = sk_X509_value(chain, i); | ||
1186 | OPENSSL_assert(x != NULL); | ||
1187 | if ((ext = x->rfc3779_addr) == NULL) | ||
1188 | goto done; | ||
1189 | } | ||
1190 | if (!v3_addr_is_canonical(ext)) | ||
1191 | validation_err(X509_V_ERR_INVALID_EXTENSION); | ||
1192 | (void)sk_IPAddressFamily_set_cmp_func(ext, IPAddressFamily_cmp); | ||
1193 | if ((child = sk_IPAddressFamily_dup(ext)) == NULL) { | ||
1194 | X509V3err(X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL, ERR_R_MALLOC_FAILURE); | ||
1195 | ret = 0; | ||
1196 | goto done; | ||
1197 | } | ||
1198 | |||
1199 | /* | ||
1200 | * Now walk up the chain. No cert may list resources that its | ||
1201 | * parent doesn't list. | ||
1202 | */ | ||
1203 | for (i++; i < sk_X509_num(chain); i++) { | ||
1204 | x = sk_X509_value(chain, i); | ||
1205 | OPENSSL_assert(x != NULL); | ||
1206 | if (!v3_addr_is_canonical(x->rfc3779_addr)) | ||
1207 | validation_err(X509_V_ERR_INVALID_EXTENSION); | ||
1208 | if (x->rfc3779_addr == NULL) { | ||
1209 | for (j = 0; j < sk_IPAddressFamily_num(child); j++) { | ||
1210 | IPAddressFamily *fc = sk_IPAddressFamily_value(child, j); | ||
1211 | if (fc->ipAddressChoice->type != IPAddressChoice_inherit) { | ||
1212 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); | ||
1213 | break; | ||
1214 | } | ||
1215 | } | ||
1216 | continue; | ||
1217 | } | ||
1218 | (void)sk_IPAddressFamily_set_cmp_func(x->rfc3779_addr, IPAddressFamily_cmp); | ||
1219 | for (j = 0; j < sk_IPAddressFamily_num(child); j++) { | ||
1220 | IPAddressFamily *fc = sk_IPAddressFamily_value(child, j); | ||
1221 | int k = sk_IPAddressFamily_find(x->rfc3779_addr, fc); | ||
1222 | IPAddressFamily *fp = sk_IPAddressFamily_value(x->rfc3779_addr, k); | ||
1223 | if (fp == NULL) { | ||
1224 | if (fc->ipAddressChoice->type == IPAddressChoice_addressesOrRanges) { | ||
1225 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); | ||
1226 | break; | ||
1227 | } | ||
1228 | continue; | ||
1229 | } | ||
1230 | if (fp->ipAddressChoice->type == IPAddressChoice_addressesOrRanges) { | ||
1231 | if (fc->ipAddressChoice->type == IPAddressChoice_inherit || | ||
1232 | addr_contains(fp->ipAddressChoice->u.addressesOrRanges, | ||
1233 | fc->ipAddressChoice->u.addressesOrRanges, | ||
1234 | length_from_afi(v3_addr_get_afi(fc)))) | ||
1235 | sk_IPAddressFamily_set(child, j, fp); | ||
1236 | else | ||
1237 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); | ||
1238 | } | ||
1239 | } | ||
1240 | } | ||
1241 | |||
1242 | /* | ||
1243 | * Trust anchor can't inherit. | ||
1244 | */ | ||
1245 | if (x->rfc3779_addr != NULL) { | ||
1246 | for (j = 0; j < sk_IPAddressFamily_num(x->rfc3779_addr); j++) { | ||
1247 | IPAddressFamily *fp = sk_IPAddressFamily_value(x->rfc3779_addr, j); | ||
1248 | if (fp->ipAddressChoice->type == IPAddressChoice_inherit && | ||
1249 | sk_IPAddressFamily_find(child, fp) >= 0) | ||
1250 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); | ||
1251 | } | ||
1252 | } | ||
1253 | |||
1254 | done: | ||
1255 | sk_IPAddressFamily_free(child); | ||
1256 | return ret; | ||
1257 | } | ||
1258 | |||
1259 | #undef validation_err | ||
1260 | |||
1261 | /* | ||
1262 | * RFC 3779 2.3 path validation -- called from X509_verify_cert(). | ||
1263 | */ | ||
1264 | int v3_addr_validate_path(X509_STORE_CTX *ctx) | ||
1265 | { | ||
1266 | return v3_addr_validate_path_internal(ctx, ctx->chain, NULL); | ||
1267 | } | ||
1268 | |||
1269 | /* | ||
1270 | * RFC 3779 2.3 path validation of an extension. | ||
1271 | * Test whether chain covers extension. | ||
1272 | */ | ||
1273 | int v3_addr_validate_resource_set(STACK_OF(X509) *chain, | ||
1274 | IPAddrBlocks *ext, | ||
1275 | int allow_inheritance) | ||
1276 | { | ||
1277 | if (ext == NULL) | ||
1278 | return 1; | ||
1279 | if (chain == NULL || sk_X509_num(chain) == 0) | ||
1280 | return 0; | ||
1281 | if (!allow_inheritance && v3_addr_inherits(ext)) | ||
1282 | return 0; | ||
1283 | return v3_addr_validate_path_internal(NULL, chain, ext); | ||
1284 | } | ||
1285 | |||
1286 | #endif /* OPENSSL_NO_RFC3779 */ | ||
diff --git a/src/lib/libcrypto/x509v3/v3_alt.c b/src/lib/libcrypto/x509v3/v3_alt.c index d29d94338e..75fda7f268 100644 --- a/src/lib/libcrypto/x509v3/v3_alt.c +++ b/src/lib/libcrypto/x509v3/v3_alt.c | |||
@@ -82,12 +82,6 @@ NULL, NULL, NULL}, | |||
82 | (X509V3_EXT_I2V)i2v_GENERAL_NAMES, | 82 | (X509V3_EXT_I2V)i2v_GENERAL_NAMES, |
83 | (X509V3_EXT_V2I)v2i_issuer_alt, | 83 | (X509V3_EXT_V2I)v2i_issuer_alt, |
84 | NULL, NULL, NULL}, | 84 | NULL, NULL, NULL}, |
85 | |||
86 | { NID_certificate_issuer, 0, ASN1_ITEM_ref(GENERAL_NAMES), | ||
87 | 0,0,0,0, | ||
88 | 0,0, | ||
89 | (X509V3_EXT_I2V)i2v_GENERAL_NAMES, | ||
90 | NULL, NULL, NULL, NULL}, | ||
91 | }; | 85 | }; |
92 | 86 | ||
93 | STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, | 87 | STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, |
@@ -153,9 +147,9 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, | |||
153 | BIO_snprintf(htmp, sizeof htmp, | 147 | BIO_snprintf(htmp, sizeof htmp, |
154 | "%X", p[0] << 8 | p[1]); | 148 | "%X", p[0] << 8 | p[1]); |
155 | p += 2; | 149 | p += 2; |
156 | strcat(oline, htmp); | 150 | strlcat(oline, htmp, sizeof oline); |
157 | if (i != 7) | 151 | if (i != 7) |
158 | strcat(oline, ":"); | 152 | strlcat(oline, ":", sizeof oline); |
159 | } | 153 | } |
160 | } | 154 | } |
161 | else | 155 | else |
@@ -366,7 +360,6 @@ static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p) | |||
366 | if (move_p) | 360 | if (move_p) |
367 | { | 361 | { |
368 | X509_NAME_delete_entry(nm, i); | 362 | X509_NAME_delete_entry(nm, i); |
369 | X509_NAME_ENTRY_free(ne); | ||
370 | i--; | 363 | i--; |
371 | } | 364 | } |
372 | if(!email || !(gen = GENERAL_NAME_new())) { | 365 | if(!email || !(gen = GENERAL_NAME_new())) { |
@@ -393,8 +386,8 @@ static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p) | |||
393 | 386 | ||
394 | } | 387 | } |
395 | 388 | ||
396 | GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method, | 389 | GENERAL_NAMES *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method, |
397 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) | 390 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) |
398 | { | 391 | { |
399 | GENERAL_NAME *gen; | 392 | GENERAL_NAME *gen; |
400 | GENERAL_NAMES *gens = NULL; | 393 | GENERAL_NAMES *gens = NULL; |
@@ -415,22 +408,28 @@ GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method, | |||
415 | return NULL; | 408 | return NULL; |
416 | } | 409 | } |
417 | 410 | ||
418 | GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, | 411 | GENERAL_NAME *v2i_GENERAL_NAME(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, |
419 | CONF_VALUE *cnf) | 412 | CONF_VALUE *cnf) |
420 | { | 413 | { |
421 | return v2i_GENERAL_NAME_ex(NULL, method, ctx, cnf, 0); | 414 | return v2i_GENERAL_NAME_ex(NULL, method, ctx, cnf, 0); |
422 | } | 415 | } |
423 | 416 | ||
424 | GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, | 417 | GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, |
425 | const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, | 418 | X509V3_EXT_METHOD *method, X509V3_CTX *ctx, |
426 | int gen_type, char *value, int is_nc) | 419 | CONF_VALUE *cnf, int is_nc) |
427 | { | 420 | { |
428 | char is_string = 0; | 421 | char is_string = 0; |
422 | int type; | ||
429 | GENERAL_NAME *gen = NULL; | 423 | GENERAL_NAME *gen = NULL; |
430 | 424 | ||
425 | char *name, *value; | ||
426 | |||
427 | name = cnf->name; | ||
428 | value = cnf->value; | ||
429 | |||
431 | if(!value) | 430 | if(!value) |
432 | { | 431 | { |
433 | X509V3err(X509V3_F_A2I_GENERAL_NAME,X509V3_R_MISSING_VALUE); | 432 | X509V3err(X509V3_F_V2I_GENERAL_NAME_EX,X509V3_R_MISSING_VALUE); |
434 | return NULL; | 433 | return NULL; |
435 | } | 434 | } |
436 | 435 | ||
@@ -441,62 +440,74 @@ GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, | |||
441 | gen = GENERAL_NAME_new(); | 440 | gen = GENERAL_NAME_new(); |
442 | if(gen == NULL) | 441 | if(gen == NULL) |
443 | { | 442 | { |
444 | X509V3err(X509V3_F_A2I_GENERAL_NAME,ERR_R_MALLOC_FAILURE); | 443 | X509V3err(X509V3_F_V2I_GENERAL_NAME_EX,ERR_R_MALLOC_FAILURE); |
445 | return NULL; | 444 | return NULL; |
446 | } | 445 | } |
447 | } | 446 | } |
448 | 447 | ||
449 | switch (gen_type) | 448 | if(!name_cmp(name, "email")) |
450 | { | 449 | { |
451 | case GEN_URI: | ||
452 | case GEN_EMAIL: | ||
453 | case GEN_DNS: | ||
454 | is_string = 1; | 450 | is_string = 1; |
455 | break; | 451 | type = GEN_EMAIL; |
456 | 452 | } | |
457 | case GEN_RID: | 453 | else if(!name_cmp(name, "URI")) |
454 | { | ||
455 | is_string = 1; | ||
456 | type = GEN_URI; | ||
457 | } | ||
458 | else if(!name_cmp(name, "DNS")) | ||
459 | { | ||
460 | is_string = 1; | ||
461 | type = GEN_DNS; | ||
462 | } | ||
463 | else if(!name_cmp(name, "RID")) | ||
458 | { | 464 | { |
459 | ASN1_OBJECT *obj; | 465 | ASN1_OBJECT *obj; |
460 | if(!(obj = OBJ_txt2obj(value,0))) | 466 | if(!(obj = OBJ_txt2obj(value,0))) |
461 | { | 467 | { |
462 | X509V3err(X509V3_F_A2I_GENERAL_NAME,X509V3_R_BAD_OBJECT); | 468 | X509V3err(X509V3_F_V2I_GENERAL_NAME_EX,X509V3_R_BAD_OBJECT); |
463 | ERR_add_error_data(2, "value=", value); | 469 | ERR_add_error_data(2, "value=", value); |
464 | goto err; | 470 | goto err; |
465 | } | 471 | } |
466 | gen->d.rid = obj; | 472 | gen->d.rid = obj; |
473 | type = GEN_RID; | ||
467 | } | 474 | } |
468 | break; | 475 | else if(!name_cmp(name, "IP")) |
469 | 476 | { | |
470 | case GEN_IPADD: | ||
471 | if (is_nc) | 477 | if (is_nc) |
472 | gen->d.ip = a2i_IPADDRESS_NC(value); | 478 | gen->d.ip = a2i_IPADDRESS_NC(value); |
473 | else | 479 | else |
474 | gen->d.ip = a2i_IPADDRESS(value); | 480 | gen->d.ip = a2i_IPADDRESS(value); |
475 | if(gen->d.ip == NULL) | 481 | if(gen->d.ip == NULL) |
476 | { | 482 | { |
477 | X509V3err(X509V3_F_A2I_GENERAL_NAME,X509V3_R_BAD_IP_ADDRESS); | 483 | X509V3err(X509V3_F_V2I_GENERAL_NAME_EX,X509V3_R_BAD_IP_ADDRESS); |
478 | ERR_add_error_data(2, "value=", value); | 484 | ERR_add_error_data(2, "value=", value); |
479 | goto err; | 485 | goto err; |
480 | } | 486 | } |
481 | break; | 487 | type = GEN_IPADD; |
482 | 488 | } | |
483 | case GEN_DIRNAME: | 489 | else if(!name_cmp(name, "dirName")) |
490 | { | ||
491 | type = GEN_DIRNAME; | ||
484 | if (!do_dirname(gen, value, ctx)) | 492 | if (!do_dirname(gen, value, ctx)) |
485 | { | 493 | { |
486 | X509V3err(X509V3_F_A2I_GENERAL_NAME,X509V3_R_DIRNAME_ERROR); | 494 | X509V3err(X509V3_F_V2I_GENERAL_NAME_EX,X509V3_R_DIRNAME_ERROR); |
487 | goto err; | 495 | goto err; |
488 | } | 496 | } |
489 | break; | 497 | } |
490 | 498 | else if(!name_cmp(name, "otherName")) | |
491 | case GEN_OTHERNAME: | 499 | { |
492 | if (!do_othername(gen, value, ctx)) | 500 | if (!do_othername(gen, value, ctx)) |
493 | { | 501 | { |
494 | X509V3err(X509V3_F_A2I_GENERAL_NAME,X509V3_R_OTHERNAME_ERROR); | 502 | X509V3err(X509V3_F_V2I_GENERAL_NAME_EX,X509V3_R_OTHERNAME_ERROR); |
495 | goto err; | 503 | goto err; |
496 | } | 504 | } |
497 | break; | 505 | type = GEN_OTHERNAME; |
498 | default: | 506 | } |
499 | X509V3err(X509V3_F_A2I_GENERAL_NAME,X509V3_R_UNSUPPORTED_TYPE); | 507 | else |
508 | { | ||
509 | X509V3err(X509V3_F_V2I_GENERAL_NAME_EX,X509V3_R_UNSUPPORTED_OPTION); | ||
510 | ERR_add_error_data(2, "name=", name); | ||
500 | goto err; | 511 | goto err; |
501 | } | 512 | } |
502 | 513 | ||
@@ -506,12 +517,12 @@ GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, | |||
506 | !ASN1_STRING_set(gen->d.ia5, (unsigned char*)value, | 517 | !ASN1_STRING_set(gen->d.ia5, (unsigned char*)value, |
507 | strlen(value))) | 518 | strlen(value))) |
508 | { | 519 | { |
509 | X509V3err(X509V3_F_A2I_GENERAL_NAME,ERR_R_MALLOC_FAILURE); | 520 | X509V3err(X509V3_F_V2I_GENERAL_NAME_EX,ERR_R_MALLOC_FAILURE); |
510 | goto err; | 521 | goto err; |
511 | } | 522 | } |
512 | } | 523 | } |
513 | 524 | ||
514 | gen->type = gen_type; | 525 | gen->type = type; |
515 | 526 | ||
516 | return gen; | 527 | return gen; |
517 | 528 | ||
@@ -521,48 +532,6 @@ GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, | |||
521 | return NULL; | 532 | return NULL; |
522 | } | 533 | } |
523 | 534 | ||
524 | GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, | ||
525 | const X509V3_EXT_METHOD *method, | ||
526 | X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc) | ||
527 | { | ||
528 | int type; | ||
529 | |||
530 | char *name, *value; | ||
531 | |||
532 | name = cnf->name; | ||
533 | value = cnf->value; | ||
534 | |||
535 | if(!value) | ||
536 | { | ||
537 | X509V3err(X509V3_F_V2I_GENERAL_NAME_EX,X509V3_R_MISSING_VALUE); | ||
538 | return NULL; | ||
539 | } | ||
540 | |||
541 | if(!name_cmp(name, "email")) | ||
542 | type = GEN_EMAIL; | ||
543 | else if(!name_cmp(name, "URI")) | ||
544 | type = GEN_URI; | ||
545 | else if(!name_cmp(name, "DNS")) | ||
546 | type = GEN_DNS; | ||
547 | else if(!name_cmp(name, "RID")) | ||
548 | type = GEN_RID; | ||
549 | else if(!name_cmp(name, "IP")) | ||
550 | type = GEN_IPADD; | ||
551 | else if(!name_cmp(name, "dirName")) | ||
552 | type = GEN_DIRNAME; | ||
553 | else if(!name_cmp(name, "otherName")) | ||
554 | type = GEN_OTHERNAME; | ||
555 | else | ||
556 | { | ||
557 | X509V3err(X509V3_F_V2I_GENERAL_NAME_EX,X509V3_R_UNSUPPORTED_OPTION); | ||
558 | ERR_add_error_data(2, "name=", name); | ||
559 | return NULL; | ||
560 | } | ||
561 | |||
562 | return a2i_GENERAL_NAME(out, method, ctx, type, value, is_nc); | ||
563 | |||
564 | } | ||
565 | |||
566 | static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) | 535 | static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) |
567 | { | 536 | { |
568 | char *objtmp = NULL, *p; | 537 | char *objtmp = NULL, *p; |
@@ -608,7 +577,6 @@ static int do_dirname(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) | |||
608 | if (!ret) | 577 | if (!ret) |
609 | X509_NAME_free(nm); | 578 | X509_NAME_free(nm); |
610 | gen->d.dirn = nm; | 579 | gen->d.dirn = nm; |
611 | X509V3_section_free(ctx, sk); | ||
612 | 580 | ||
613 | return ret; | 581 | return ret; |
614 | } | 582 | } |
diff --git a/src/lib/libcrypto/x509v3/v3_asid.c b/src/lib/libcrypto/x509v3/v3_asid.c new file mode 100644 index 0000000000..abd497ed1f --- /dev/null +++ b/src/lib/libcrypto/x509v3/v3_asid.c | |||
@@ -0,0 +1,842 @@ | |||
1 | /* | ||
2 | * Contributed to the OpenSSL Project by the American Registry for | ||
3 | * Internet Numbers ("ARIN"). | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2006 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | */ | ||
57 | |||
58 | /* | ||
59 | * Implementation of RFC 3779 section 3.2. | ||
60 | */ | ||
61 | |||
62 | #include <stdio.h> | ||
63 | #include <string.h> | ||
64 | #include <assert.h> | ||
65 | #include "cryptlib.h" | ||
66 | #include <openssl/conf.h> | ||
67 | #include <openssl/asn1.h> | ||
68 | #include <openssl/asn1t.h> | ||
69 | #include <openssl/x509v3.h> | ||
70 | #include <openssl/x509.h> | ||
71 | #include <openssl/bn.h> | ||
72 | |||
73 | #ifndef OPENSSL_NO_RFC3779 | ||
74 | |||
75 | /* | ||
76 | * OpenSSL ASN.1 template translation of RFC 3779 3.2.3. | ||
77 | */ | ||
78 | |||
79 | ASN1_SEQUENCE(ASRange) = { | ||
80 | ASN1_SIMPLE(ASRange, min, ASN1_INTEGER), | ||
81 | ASN1_SIMPLE(ASRange, max, ASN1_INTEGER) | ||
82 | } ASN1_SEQUENCE_END(ASRange) | ||
83 | |||
84 | ASN1_CHOICE(ASIdOrRange) = { | ||
85 | ASN1_SIMPLE(ASIdOrRange, u.id, ASN1_INTEGER), | ||
86 | ASN1_SIMPLE(ASIdOrRange, u.range, ASRange) | ||
87 | } ASN1_CHOICE_END(ASIdOrRange) | ||
88 | |||
89 | ASN1_CHOICE(ASIdentifierChoice) = { | ||
90 | ASN1_SIMPLE(ASIdentifierChoice, u.inherit, ASN1_NULL), | ||
91 | ASN1_SEQUENCE_OF(ASIdentifierChoice, u.asIdsOrRanges, ASIdOrRange) | ||
92 | } ASN1_CHOICE_END(ASIdentifierChoice) | ||
93 | |||
94 | ASN1_SEQUENCE(ASIdentifiers) = { | ||
95 | ASN1_EXP_OPT(ASIdentifiers, asnum, ASIdentifierChoice, 0), | ||
96 | ASN1_EXP_OPT(ASIdentifiers, rdi, ASIdentifierChoice, 1) | ||
97 | } ASN1_SEQUENCE_END(ASIdentifiers) | ||
98 | |||
99 | IMPLEMENT_ASN1_FUNCTIONS(ASRange) | ||
100 | IMPLEMENT_ASN1_FUNCTIONS(ASIdOrRange) | ||
101 | IMPLEMENT_ASN1_FUNCTIONS(ASIdentifierChoice) | ||
102 | IMPLEMENT_ASN1_FUNCTIONS(ASIdentifiers) | ||
103 | |||
104 | /* | ||
105 | * i2r method for an ASIdentifierChoice. | ||
106 | */ | ||
107 | static int i2r_ASIdentifierChoice(BIO *out, | ||
108 | ASIdentifierChoice *choice, | ||
109 | int indent, | ||
110 | const char *msg) | ||
111 | { | ||
112 | int i; | ||
113 | char *s; | ||
114 | if (choice == NULL) | ||
115 | return 1; | ||
116 | BIO_printf(out, "%*s%s:\n", indent, "", msg); | ||
117 | switch (choice->type) { | ||
118 | case ASIdentifierChoice_inherit: | ||
119 | BIO_printf(out, "%*sinherit\n", indent + 2, ""); | ||
120 | break; | ||
121 | case ASIdentifierChoice_asIdsOrRanges: | ||
122 | for (i = 0; i < sk_ASIdOrRange_num(choice->u.asIdsOrRanges); i++) { | ||
123 | ASIdOrRange *aor = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i); | ||
124 | switch (aor->type) { | ||
125 | case ASIdOrRange_id: | ||
126 | if ((s = i2s_ASN1_INTEGER(NULL, aor->u.id)) == NULL) | ||
127 | return 0; | ||
128 | BIO_printf(out, "%*s%s\n", indent + 2, "", s); | ||
129 | OPENSSL_free(s); | ||
130 | break; | ||
131 | case ASIdOrRange_range: | ||
132 | if ((s = i2s_ASN1_INTEGER(NULL, aor->u.range->min)) == NULL) | ||
133 | return 0; | ||
134 | BIO_printf(out, "%*s%s-", indent + 2, "", s); | ||
135 | OPENSSL_free(s); | ||
136 | if ((s = i2s_ASN1_INTEGER(NULL, aor->u.range->max)) == NULL) | ||
137 | return 0; | ||
138 | BIO_printf(out, "%s\n", s); | ||
139 | OPENSSL_free(s); | ||
140 | break; | ||
141 | default: | ||
142 | return 0; | ||
143 | } | ||
144 | } | ||
145 | break; | ||
146 | default: | ||
147 | return 0; | ||
148 | } | ||
149 | return 1; | ||
150 | } | ||
151 | |||
152 | /* | ||
153 | * i2r method for an ASIdentifier extension. | ||
154 | */ | ||
155 | static int i2r_ASIdentifiers(X509V3_EXT_METHOD *method, | ||
156 | void *ext, | ||
157 | BIO *out, | ||
158 | int indent) | ||
159 | { | ||
160 | ASIdentifiers *asid = ext; | ||
161 | return (i2r_ASIdentifierChoice(out, asid->asnum, indent, | ||
162 | "Autonomous System Numbers") && | ||
163 | i2r_ASIdentifierChoice(out, asid->rdi, indent, | ||
164 | "Routing Domain Identifiers")); | ||
165 | } | ||
166 | |||
167 | /* | ||
168 | * Sort comparision function for a sequence of ASIdOrRange elements. | ||
169 | */ | ||
170 | static int ASIdOrRange_cmp(const ASIdOrRange * const *a_, | ||
171 | const ASIdOrRange * const *b_) | ||
172 | { | ||
173 | const ASIdOrRange *a = *a_, *b = *b_; | ||
174 | |||
175 | assert((a->type == ASIdOrRange_id && a->u.id != NULL) || | ||
176 | (a->type == ASIdOrRange_range && a->u.range != NULL && | ||
177 | a->u.range->min != NULL && a->u.range->max != NULL)); | ||
178 | |||
179 | assert((b->type == ASIdOrRange_id && b->u.id != NULL) || | ||
180 | (b->type == ASIdOrRange_range && b->u.range != NULL && | ||
181 | b->u.range->min != NULL && b->u.range->max != NULL)); | ||
182 | |||
183 | if (a->type == ASIdOrRange_id && b->type == ASIdOrRange_id) | ||
184 | return ASN1_INTEGER_cmp(a->u.id, b->u.id); | ||
185 | |||
186 | if (a->type == ASIdOrRange_range && b->type == ASIdOrRange_range) { | ||
187 | int r = ASN1_INTEGER_cmp(a->u.range->min, b->u.range->min); | ||
188 | return r != 0 ? r : ASN1_INTEGER_cmp(a->u.range->max, b->u.range->max); | ||
189 | } | ||
190 | |||
191 | if (a->type == ASIdOrRange_id) | ||
192 | return ASN1_INTEGER_cmp(a->u.id, b->u.range->min); | ||
193 | else | ||
194 | return ASN1_INTEGER_cmp(a->u.range->min, b->u.id); | ||
195 | } | ||
196 | |||
197 | /* | ||
198 | * Add an inherit element. | ||
199 | */ | ||
200 | int v3_asid_add_inherit(ASIdentifiers *asid, int which) | ||
201 | { | ||
202 | ASIdentifierChoice **choice; | ||
203 | if (asid == NULL) | ||
204 | return 0; | ||
205 | switch (which) { | ||
206 | case V3_ASID_ASNUM: | ||
207 | choice = &asid->asnum; | ||
208 | break; | ||
209 | case V3_ASID_RDI: | ||
210 | choice = &asid->rdi; | ||
211 | break; | ||
212 | default: | ||
213 | return 0; | ||
214 | } | ||
215 | if (*choice == NULL) { | ||
216 | if ((*choice = ASIdentifierChoice_new()) == NULL) | ||
217 | return 0; | ||
218 | assert((*choice)->u.inherit == NULL); | ||
219 | if (((*choice)->u.inherit = ASN1_NULL_new()) == NULL) | ||
220 | return 0; | ||
221 | (*choice)->type = ASIdentifierChoice_inherit; | ||
222 | } | ||
223 | return (*choice)->type == ASIdentifierChoice_inherit; | ||
224 | } | ||
225 | |||
226 | /* | ||
227 | * Add an ID or range to an ASIdentifierChoice. | ||
228 | */ | ||
229 | int v3_asid_add_id_or_range(ASIdentifiers *asid, | ||
230 | int which, | ||
231 | ASN1_INTEGER *min, | ||
232 | ASN1_INTEGER *max) | ||
233 | { | ||
234 | ASIdentifierChoice **choice; | ||
235 | ASIdOrRange *aor; | ||
236 | if (asid == NULL) | ||
237 | return 0; | ||
238 | switch (which) { | ||
239 | case V3_ASID_ASNUM: | ||
240 | choice = &asid->asnum; | ||
241 | break; | ||
242 | case V3_ASID_RDI: | ||
243 | choice = &asid->rdi; | ||
244 | break; | ||
245 | default: | ||
246 | return 0; | ||
247 | } | ||
248 | if (*choice != NULL && (*choice)->type == ASIdentifierChoice_inherit) | ||
249 | return 0; | ||
250 | if (*choice == NULL) { | ||
251 | if ((*choice = ASIdentifierChoice_new()) == NULL) | ||
252 | return 0; | ||
253 | assert((*choice)->u.asIdsOrRanges == NULL); | ||
254 | (*choice)->u.asIdsOrRanges = sk_ASIdOrRange_new(ASIdOrRange_cmp); | ||
255 | if ((*choice)->u.asIdsOrRanges == NULL) | ||
256 | return 0; | ||
257 | (*choice)->type = ASIdentifierChoice_asIdsOrRanges; | ||
258 | } | ||
259 | if ((aor = ASIdOrRange_new()) == NULL) | ||
260 | return 0; | ||
261 | if (max == NULL) { | ||
262 | aor->type = ASIdOrRange_id; | ||
263 | aor->u.id = min; | ||
264 | } else { | ||
265 | aor->type = ASIdOrRange_range; | ||
266 | if ((aor->u.range = ASRange_new()) == NULL) | ||
267 | goto err; | ||
268 | ASN1_INTEGER_free(aor->u.range->min); | ||
269 | aor->u.range->min = min; | ||
270 | ASN1_INTEGER_free(aor->u.range->max); | ||
271 | aor->u.range->max = max; | ||
272 | } | ||
273 | if (!(sk_ASIdOrRange_push((*choice)->u.asIdsOrRanges, aor))) | ||
274 | goto err; | ||
275 | return 1; | ||
276 | |||
277 | err: | ||
278 | ASIdOrRange_free(aor); | ||
279 | return 0; | ||
280 | } | ||
281 | |||
282 | /* | ||
283 | * Extract min and max values from an ASIdOrRange. | ||
284 | */ | ||
285 | static void extract_min_max(ASIdOrRange *aor, | ||
286 | ASN1_INTEGER **min, | ||
287 | ASN1_INTEGER **max) | ||
288 | { | ||
289 | assert(aor != NULL && min != NULL && max != NULL); | ||
290 | switch (aor->type) { | ||
291 | case ASIdOrRange_id: | ||
292 | *min = aor->u.id; | ||
293 | *max = aor->u.id; | ||
294 | return; | ||
295 | case ASIdOrRange_range: | ||
296 | *min = aor->u.range->min; | ||
297 | *max = aor->u.range->max; | ||
298 | return; | ||
299 | } | ||
300 | } | ||
301 | |||
302 | /* | ||
303 | * Check whether an ASIdentifierChoice is in canonical form. | ||
304 | */ | ||
305 | static int ASIdentifierChoice_is_canonical(ASIdentifierChoice *choice) | ||
306 | { | ||
307 | ASN1_INTEGER *a_max_plus_one = NULL; | ||
308 | BIGNUM *bn = NULL; | ||
309 | int i, ret = 0; | ||
310 | |||
311 | /* | ||
312 | * Empty element or inheritance is canonical. | ||
313 | */ | ||
314 | if (choice == NULL || choice->type == ASIdentifierChoice_inherit) | ||
315 | return 1; | ||
316 | |||
317 | /* | ||
318 | * If not a list, or if empty list, it's broken. | ||
319 | */ | ||
320 | if (choice->type != ASIdentifierChoice_asIdsOrRanges || | ||
321 | sk_ASIdOrRange_num(choice->u.asIdsOrRanges) == 0) | ||
322 | return 0; | ||
323 | |||
324 | /* | ||
325 | * It's a list, check it. | ||
326 | */ | ||
327 | for (i = 0; i < sk_ASIdOrRange_num(choice->u.asIdsOrRanges) - 1; i++) { | ||
328 | ASIdOrRange *a = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i); | ||
329 | ASIdOrRange *b = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i + 1); | ||
330 | ASN1_INTEGER *a_min, *a_max, *b_min, *b_max; | ||
331 | |||
332 | extract_min_max(a, &a_min, &a_max); | ||
333 | extract_min_max(b, &b_min, &b_max); | ||
334 | |||
335 | /* | ||
336 | * Punt misordered list, overlapping start, or inverted range. | ||
337 | */ | ||
338 | if (ASN1_INTEGER_cmp(a_min, b_min) >= 0 || | ||
339 | ASN1_INTEGER_cmp(a_min, a_max) > 0 || | ||
340 | ASN1_INTEGER_cmp(b_min, b_max) > 0) | ||
341 | goto done; | ||
342 | |||
343 | /* | ||
344 | * Calculate a_max + 1 to check for adjacency. | ||
345 | */ | ||
346 | if ((bn == NULL && (bn = BN_new()) == NULL) || | ||
347 | ASN1_INTEGER_to_BN(a_max, bn) == NULL || | ||
348 | !BN_add_word(bn, 1) || | ||
349 | (a_max_plus_one = BN_to_ASN1_INTEGER(bn, a_max_plus_one)) == NULL) { | ||
350 | X509V3err(X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL, | ||
351 | ERR_R_MALLOC_FAILURE); | ||
352 | goto done; | ||
353 | } | ||
354 | |||
355 | /* | ||
356 | * Punt if adjacent or overlapping. | ||
357 | */ | ||
358 | if (ASN1_INTEGER_cmp(a_max_plus_one, b_min) >= 0) | ||
359 | goto done; | ||
360 | } | ||
361 | |||
362 | ret = 1; | ||
363 | |||
364 | done: | ||
365 | ASN1_INTEGER_free(a_max_plus_one); | ||
366 | BN_free(bn); | ||
367 | return ret; | ||
368 | } | ||
369 | |||
370 | /* | ||
371 | * Check whether an ASIdentifier extension is in canonical form. | ||
372 | */ | ||
373 | int v3_asid_is_canonical(ASIdentifiers *asid) | ||
374 | { | ||
375 | return (asid == NULL || | ||
376 | (ASIdentifierChoice_is_canonical(asid->asnum) || | ||
377 | ASIdentifierChoice_is_canonical(asid->rdi))); | ||
378 | } | ||
379 | |||
380 | /* | ||
381 | * Whack an ASIdentifierChoice into canonical form. | ||
382 | */ | ||
383 | static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice) | ||
384 | { | ||
385 | ASN1_INTEGER *a_max_plus_one = NULL; | ||
386 | BIGNUM *bn = NULL; | ||
387 | int i, ret = 0; | ||
388 | |||
389 | /* | ||
390 | * Nothing to do for empty element or inheritance. | ||
391 | */ | ||
392 | if (choice == NULL || choice->type == ASIdentifierChoice_inherit) | ||
393 | return 1; | ||
394 | |||
395 | /* | ||
396 | * We have a list. Sort it. | ||
397 | */ | ||
398 | assert(choice->type == ASIdentifierChoice_asIdsOrRanges); | ||
399 | sk_ASIdOrRange_sort(choice->u.asIdsOrRanges); | ||
400 | |||
401 | /* | ||
402 | * Now check for errors and suboptimal encoding, rejecting the | ||
403 | * former and fixing the latter. | ||
404 | */ | ||
405 | for (i = 0; i < sk_ASIdOrRange_num(choice->u.asIdsOrRanges) - 1; i++) { | ||
406 | ASIdOrRange *a = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i); | ||
407 | ASIdOrRange *b = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i + 1); | ||
408 | ASN1_INTEGER *a_min, *a_max, *b_min, *b_max; | ||
409 | |||
410 | extract_min_max(a, &a_min, &a_max); | ||
411 | extract_min_max(b, &b_min, &b_max); | ||
412 | |||
413 | /* | ||
414 | * Make sure we're properly sorted (paranoia). | ||
415 | */ | ||
416 | assert(ASN1_INTEGER_cmp(a_min, b_min) <= 0); | ||
417 | |||
418 | /* | ||
419 | * Check for overlaps. | ||
420 | */ | ||
421 | if (ASN1_INTEGER_cmp(a_max, b_min) >= 0) { | ||
422 | X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE, | ||
423 | X509V3_R_EXTENSION_VALUE_ERROR); | ||
424 | goto done; | ||
425 | } | ||
426 | |||
427 | /* | ||
428 | * Calculate a_max + 1 to check for adjacency. | ||
429 | */ | ||
430 | if ((bn == NULL && (bn = BN_new()) == NULL) || | ||
431 | ASN1_INTEGER_to_BN(a_max, bn) == NULL || | ||
432 | !BN_add_word(bn, 1) || | ||
433 | (a_max_plus_one = BN_to_ASN1_INTEGER(bn, a_max_plus_one)) == NULL) { | ||
434 | X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE, ERR_R_MALLOC_FAILURE); | ||
435 | goto done; | ||
436 | } | ||
437 | |||
438 | /* | ||
439 | * If a and b are adjacent, merge them. | ||
440 | */ | ||
441 | if (ASN1_INTEGER_cmp(a_max_plus_one, b_min) == 0) { | ||
442 | ASRange *r; | ||
443 | switch (a->type) { | ||
444 | case ASIdOrRange_id: | ||
445 | if ((r = OPENSSL_malloc(sizeof(ASRange))) == NULL) { | ||
446 | X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE, | ||
447 | ERR_R_MALLOC_FAILURE); | ||
448 | goto done; | ||
449 | } | ||
450 | r->min = a_min; | ||
451 | r->max = b_max; | ||
452 | a->type = ASIdOrRange_range; | ||
453 | a->u.range = r; | ||
454 | break; | ||
455 | case ASIdOrRange_range: | ||
456 | ASN1_INTEGER_free(a->u.range->max); | ||
457 | a->u.range->max = b_max; | ||
458 | break; | ||
459 | } | ||
460 | switch (b->type) { | ||
461 | case ASIdOrRange_id: | ||
462 | b->u.id = NULL; | ||
463 | break; | ||
464 | case ASIdOrRange_range: | ||
465 | b->u.range->max = NULL; | ||
466 | break; | ||
467 | } | ||
468 | ASIdOrRange_free(b); | ||
469 | (void)sk_ASIdOrRange_delete(choice->u.asIdsOrRanges, i + 1); | ||
470 | i--; | ||
471 | continue; | ||
472 | } | ||
473 | } | ||
474 | |||
475 | assert(ASIdentifierChoice_is_canonical(choice)); /* Paranoia */ | ||
476 | |||
477 | ret = 1; | ||
478 | |||
479 | done: | ||
480 | ASN1_INTEGER_free(a_max_plus_one); | ||
481 | BN_free(bn); | ||
482 | return ret; | ||
483 | } | ||
484 | |||
485 | /* | ||
486 | * Whack an ASIdentifier extension into canonical form. | ||
487 | */ | ||
488 | int v3_asid_canonize(ASIdentifiers *asid) | ||
489 | { | ||
490 | return (asid == NULL || | ||
491 | (ASIdentifierChoice_canonize(asid->asnum) && | ||
492 | ASIdentifierChoice_canonize(asid->rdi))); | ||
493 | } | ||
494 | |||
495 | /* | ||
496 | * v2i method for an ASIdentifier extension. | ||
497 | */ | ||
498 | static void *v2i_ASIdentifiers(struct v3_ext_method *method, | ||
499 | struct v3_ext_ctx *ctx, | ||
500 | STACK_OF(CONF_VALUE) *values) | ||
501 | { | ||
502 | ASIdentifiers *asid = NULL; | ||
503 | int i; | ||
504 | |||
505 | if ((asid = ASIdentifiers_new()) == NULL) { | ||
506 | X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE); | ||
507 | return NULL; | ||
508 | } | ||
509 | |||
510 | for (i = 0; i < sk_CONF_VALUE_num(values); i++) { | ||
511 | CONF_VALUE *val = sk_CONF_VALUE_value(values, i); | ||
512 | ASN1_INTEGER *min = NULL, *max = NULL; | ||
513 | int i1, i2, i3, is_range, which; | ||
514 | |||
515 | /* | ||
516 | * Figure out whether this is an AS or an RDI. | ||
517 | */ | ||
518 | if ( !name_cmp(val->name, "AS")) { | ||
519 | which = V3_ASID_ASNUM; | ||
520 | } else if (!name_cmp(val->name, "RDI")) { | ||
521 | which = V3_ASID_RDI; | ||
522 | } else { | ||
523 | X509V3err(X509V3_F_V2I_ASIDENTIFIERS, X509V3_R_EXTENSION_NAME_ERROR); | ||
524 | X509V3_conf_err(val); | ||
525 | goto err; | ||
526 | } | ||
527 | |||
528 | /* | ||
529 | * Handle inheritance. | ||
530 | */ | ||
531 | if (!strcmp(val->value, "inherit")) { | ||
532 | if (v3_asid_add_inherit(asid, which)) | ||
533 | continue; | ||
534 | X509V3err(X509V3_F_V2I_ASIDENTIFIERS, X509V3_R_INVALID_INHERITANCE); | ||
535 | X509V3_conf_err(val); | ||
536 | goto err; | ||
537 | } | ||
538 | |||
539 | /* | ||
540 | * Number, range, or mistake, pick it apart and figure out which. | ||
541 | */ | ||
542 | i1 = strspn(val->value, "0123456789"); | ||
543 | if (val->value[i1] == '\0') { | ||
544 | is_range = 0; | ||
545 | } else { | ||
546 | is_range = 1; | ||
547 | i2 = i1 + strspn(val->value + i1, " \t"); | ||
548 | if (val->value[i2] != '-') { | ||
549 | X509V3err(X509V3_F_V2I_ASIDENTIFIERS, X509V3_R_INVALID_ASNUMBER); | ||
550 | X509V3_conf_err(val); | ||
551 | goto err; | ||
552 | } | ||
553 | i2++; | ||
554 | i2 = i2 + strspn(val->value + i2, " \t"); | ||
555 | i3 = i2 + strspn(val->value + i2, "0123456789"); | ||
556 | if (val->value[i3] != '\0') { | ||
557 | X509V3err(X509V3_F_V2I_ASIDENTIFIERS, X509V3_R_INVALID_ASRANGE); | ||
558 | X509V3_conf_err(val); | ||
559 | goto err; | ||
560 | } | ||
561 | } | ||
562 | |||
563 | /* | ||
564 | * Syntax is ok, read and add it. | ||
565 | */ | ||
566 | if (!is_range) { | ||
567 | if (!X509V3_get_value_int(val, &min)) { | ||
568 | X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE); | ||
569 | goto err; | ||
570 | } | ||
571 | } else { | ||
572 | char *s = BUF_strdup(val->value); | ||
573 | if (s == NULL) { | ||
574 | X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE); | ||
575 | goto err; | ||
576 | } | ||
577 | s[i1] = '\0'; | ||
578 | min = s2i_ASN1_INTEGER(NULL, s); | ||
579 | max = s2i_ASN1_INTEGER(NULL, s + i2); | ||
580 | OPENSSL_free(s); | ||
581 | if (min == NULL || max == NULL) { | ||
582 | ASN1_INTEGER_free(min); | ||
583 | ASN1_INTEGER_free(max); | ||
584 | X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE); | ||
585 | goto err; | ||
586 | } | ||
587 | } | ||
588 | if (!v3_asid_add_id_or_range(asid, which, min, max)) { | ||
589 | ASN1_INTEGER_free(min); | ||
590 | ASN1_INTEGER_free(max); | ||
591 | X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE); | ||
592 | goto err; | ||
593 | } | ||
594 | } | ||
595 | |||
596 | /* | ||
597 | * Canonize the result, then we're done. | ||
598 | */ | ||
599 | if (!v3_asid_canonize(asid)) | ||
600 | goto err; | ||
601 | return asid; | ||
602 | |||
603 | err: | ||
604 | ASIdentifiers_free(asid); | ||
605 | return NULL; | ||
606 | } | ||
607 | |||
608 | /* | ||
609 | * OpenSSL dispatch. | ||
610 | */ | ||
611 | const X509V3_EXT_METHOD v3_asid = { | ||
612 | NID_sbgp_autonomousSysNum, /* nid */ | ||
613 | 0, /* flags */ | ||
614 | ASN1_ITEM_ref(ASIdentifiers), /* template */ | ||
615 | 0, 0, 0, 0, /* old functions, ignored */ | ||
616 | 0, /* i2s */ | ||
617 | 0, /* s2i */ | ||
618 | 0, /* i2v */ | ||
619 | v2i_ASIdentifiers, /* v2i */ | ||
620 | i2r_ASIdentifiers, /* i2r */ | ||
621 | 0, /* r2i */ | ||
622 | NULL /* extension-specific data */ | ||
623 | }; | ||
624 | |||
625 | /* | ||
626 | * Figure out whether extension uses inheritance. | ||
627 | */ | ||
628 | int v3_asid_inherits(ASIdentifiers *asid) | ||
629 | { | ||
630 | return (asid != NULL && | ||
631 | ((asid->asnum != NULL && | ||
632 | asid->asnum->type == ASIdentifierChoice_inherit) || | ||
633 | (asid->rdi != NULL && | ||
634 | asid->rdi->type == ASIdentifierChoice_inherit))); | ||
635 | } | ||
636 | |||
637 | /* | ||
638 | * Figure out whether parent contains child. | ||
639 | */ | ||
640 | static int asid_contains(ASIdOrRanges *parent, ASIdOrRanges *child) | ||
641 | { | ||
642 | ASN1_INTEGER *p_min, *p_max, *c_min, *c_max; | ||
643 | int p, c; | ||
644 | |||
645 | if (child == NULL || parent == child) | ||
646 | return 1; | ||
647 | if (parent == NULL) | ||
648 | return 0; | ||
649 | |||
650 | p = 0; | ||
651 | for (c = 0; c < sk_ASIdOrRange_num(child); c++) { | ||
652 | extract_min_max(sk_ASIdOrRange_value(child, c), &c_min, &c_max); | ||
653 | for (;; p++) { | ||
654 | if (p >= sk_ASIdOrRange_num(parent)) | ||
655 | return 0; | ||
656 | extract_min_max(sk_ASIdOrRange_value(parent, p), &p_min, &p_max); | ||
657 | if (ASN1_INTEGER_cmp(p_max, c_max) < 0) | ||
658 | continue; | ||
659 | if (ASN1_INTEGER_cmp(p_min, c_min) > 0) | ||
660 | return 0; | ||
661 | break; | ||
662 | } | ||
663 | } | ||
664 | |||
665 | return 1; | ||
666 | } | ||
667 | |||
668 | /* | ||
669 | * Test whether a is a subet of b. | ||
670 | */ | ||
671 | int v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b) | ||
672 | { | ||
673 | return (a == NULL || | ||
674 | a == b || | ||
675 | (b != NULL && | ||
676 | !v3_asid_inherits(a) && | ||
677 | !v3_asid_inherits(b) && | ||
678 | asid_contains(b->asnum->u.asIdsOrRanges, | ||
679 | a->asnum->u.asIdsOrRanges) && | ||
680 | asid_contains(b->rdi->u.asIdsOrRanges, | ||
681 | a->rdi->u.asIdsOrRanges))); | ||
682 | } | ||
683 | |||
684 | /* | ||
685 | * Validation error handling via callback. | ||
686 | */ | ||
687 | #define validation_err(_err_) \ | ||
688 | do { \ | ||
689 | if (ctx != NULL) { \ | ||
690 | ctx->error = _err_; \ | ||
691 | ctx->error_depth = i; \ | ||
692 | ctx->current_cert = x; \ | ||
693 | ret = ctx->verify_cb(0, ctx); \ | ||
694 | } else { \ | ||
695 | ret = 0; \ | ||
696 | } \ | ||
697 | if (!ret) \ | ||
698 | goto done; \ | ||
699 | } while (0) | ||
700 | |||
701 | /* | ||
702 | * Core code for RFC 3779 3.3 path validation. | ||
703 | */ | ||
704 | static int v3_asid_validate_path_internal(X509_STORE_CTX *ctx, | ||
705 | STACK_OF(X509) *chain, | ||
706 | ASIdentifiers *ext) | ||
707 | { | ||
708 | ASIdOrRanges *child_as = NULL, *child_rdi = NULL; | ||
709 | int i, ret = 1, inherit_as = 0, inherit_rdi = 0; | ||
710 | X509 *x = NULL; | ||
711 | |||
712 | assert(chain != NULL && sk_X509_num(chain) > 0); | ||
713 | assert(ctx != NULL || ext != NULL); | ||
714 | assert(ctx == NULL || ctx->verify_cb != NULL); | ||
715 | |||
716 | /* | ||
717 | * Figure out where to start. If we don't have an extension to | ||
718 | * check, we're done. Otherwise, check canonical form and | ||
719 | * set up for walking up the chain. | ||
720 | */ | ||
721 | if (ext != NULL) { | ||
722 | i = -1; | ||
723 | } else { | ||
724 | i = 0; | ||
725 | x = sk_X509_value(chain, i); | ||
726 | assert(x != NULL); | ||
727 | if ((ext = x->rfc3779_asid) == NULL) | ||
728 | goto done; | ||
729 | } | ||
730 | if (!v3_asid_is_canonical(ext)) | ||
731 | validation_err(X509_V_ERR_INVALID_EXTENSION); | ||
732 | if (ext->asnum != NULL) { | ||
733 | switch (ext->asnum->type) { | ||
734 | case ASIdentifierChoice_inherit: | ||
735 | inherit_as = 1; | ||
736 | break; | ||
737 | case ASIdentifierChoice_asIdsOrRanges: | ||
738 | child_as = ext->asnum->u.asIdsOrRanges; | ||
739 | break; | ||
740 | } | ||
741 | } | ||
742 | if (ext->rdi != NULL) { | ||
743 | switch (ext->rdi->type) { | ||
744 | case ASIdentifierChoice_inherit: | ||
745 | inherit_rdi = 1; | ||
746 | break; | ||
747 | case ASIdentifierChoice_asIdsOrRanges: | ||
748 | child_rdi = ext->rdi->u.asIdsOrRanges; | ||
749 | break; | ||
750 | } | ||
751 | } | ||
752 | |||
753 | /* | ||
754 | * Now walk up the chain. Extensions must be in canonical form, no | ||
755 | * cert may list resources that its parent doesn't list. | ||
756 | */ | ||
757 | for (i++; i < sk_X509_num(chain); i++) { | ||
758 | x = sk_X509_value(chain, i); | ||
759 | assert(x != NULL); | ||
760 | if (x->rfc3779_asid == NULL) { | ||
761 | if (child_as != NULL || child_rdi != NULL) | ||
762 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); | ||
763 | continue; | ||
764 | } | ||
765 | if (!v3_asid_is_canonical(x->rfc3779_asid)) | ||
766 | validation_err(X509_V_ERR_INVALID_EXTENSION); | ||
767 | if (x->rfc3779_asid->asnum == NULL && child_as != NULL) { | ||
768 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); | ||
769 | child_as = NULL; | ||
770 | inherit_as = 0; | ||
771 | } | ||
772 | if (x->rfc3779_asid->asnum != NULL && | ||
773 | x->rfc3779_asid->asnum->type == ASIdentifierChoice_asIdsOrRanges) { | ||
774 | if (inherit_as || | ||
775 | asid_contains(x->rfc3779_asid->asnum->u.asIdsOrRanges, child_as)) { | ||
776 | child_as = x->rfc3779_asid->asnum->u.asIdsOrRanges; | ||
777 | inherit_as = 0; | ||
778 | } else { | ||
779 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); | ||
780 | } | ||
781 | } | ||
782 | if (x->rfc3779_asid->rdi == NULL && child_rdi != NULL) { | ||
783 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); | ||
784 | child_rdi = NULL; | ||
785 | inherit_rdi = 0; | ||
786 | } | ||
787 | if (x->rfc3779_asid->rdi != NULL && | ||
788 | x->rfc3779_asid->rdi->type == ASIdentifierChoice_asIdsOrRanges) { | ||
789 | if (inherit_rdi || | ||
790 | asid_contains(x->rfc3779_asid->rdi->u.asIdsOrRanges, child_rdi)) { | ||
791 | child_rdi = x->rfc3779_asid->rdi->u.asIdsOrRanges; | ||
792 | inherit_rdi = 0; | ||
793 | } else { | ||
794 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); | ||
795 | } | ||
796 | } | ||
797 | } | ||
798 | |||
799 | /* | ||
800 | * Trust anchor can't inherit. | ||
801 | */ | ||
802 | if (x->rfc3779_asid != NULL) { | ||
803 | if (x->rfc3779_asid->asnum != NULL && | ||
804 | x->rfc3779_asid->asnum->type == ASIdentifierChoice_inherit) | ||
805 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); | ||
806 | if (x->rfc3779_asid->rdi != NULL && | ||
807 | x->rfc3779_asid->rdi->type == ASIdentifierChoice_inherit) | ||
808 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); | ||
809 | } | ||
810 | |||
811 | done: | ||
812 | return ret; | ||
813 | } | ||
814 | |||
815 | #undef validation_err | ||
816 | |||
817 | /* | ||
818 | * RFC 3779 3.3 path validation -- called from X509_verify_cert(). | ||
819 | */ | ||
820 | int v3_asid_validate_path(X509_STORE_CTX *ctx) | ||
821 | { | ||
822 | return v3_asid_validate_path_internal(ctx, ctx->chain, NULL); | ||
823 | } | ||
824 | |||
825 | /* | ||
826 | * RFC 3779 3.3 path validation of an extension. | ||
827 | * Test whether chain covers extension. | ||
828 | */ | ||
829 | int v3_asid_validate_resource_set(STACK_OF(X509) *chain, | ||
830 | ASIdentifiers *ext, | ||
831 | int allow_inheritance) | ||
832 | { | ||
833 | if (ext == NULL) | ||
834 | return 1; | ||
835 | if (chain == NULL || sk_X509_num(chain) == 0) | ||
836 | return 0; | ||
837 | if (!allow_inheritance && v3_asid_inherits(ext)) | ||
838 | return 0; | ||
839 | return v3_asid_validate_path_internal(NULL, chain, ext); | ||
840 | } | ||
841 | |||
842 | #endif /* OPENSSL_NO_RFC3779 */ | ||
diff --git a/src/lib/libcrypto/x509v3/v3_conf.c b/src/lib/libcrypto/x509v3/v3_conf.c index 6730f9a6ee..11eb6b7fd5 100644 --- a/src/lib/libcrypto/x509v3/v3_conf.c +++ b/src/lib/libcrypto/x509v3/v3_conf.c | |||
@@ -72,14 +72,14 @@ static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, in | |||
72 | static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, int crit, int type, X509V3_CTX *ctx); | 72 | static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, int crit, int type, X509V3_CTX *ctx); |
73 | static char *conf_lhash_get_string(void *db, char *section, char *value); | 73 | static char *conf_lhash_get_string(void *db, char *section, char *value); |
74 | static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db, char *section); | 74 | static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db, char *section); |
75 | static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, | 75 | static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid, |
76 | int crit, void *ext_struc); | 76 | int crit, void *ext_struc); |
77 | static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len); | 77 | static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len); |
78 | /* CONF *conf: Config file */ | 78 | /* CONF *conf: Config file */ |
79 | /* char *name: Name */ | 79 | /* char *name: Name */ |
80 | /* char *value: Value */ | 80 | /* char *value: Value */ |
81 | X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, | 81 | X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, |
82 | char *value) | 82 | char *value) |
83 | { | 83 | { |
84 | int crit; | 84 | int crit; |
85 | int ext_type; | 85 | int ext_type; |
@@ -99,7 +99,7 @@ X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, | |||
99 | /* CONF *conf: Config file */ | 99 | /* CONF *conf: Config file */ |
100 | /* char *value: Value */ | 100 | /* char *value: Value */ |
101 | X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, | 101 | X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, |
102 | char *value) | 102 | char *value) |
103 | { | 103 | { |
104 | int crit; | 104 | int crit; |
105 | int ext_type; | 105 | int ext_type; |
@@ -113,9 +113,9 @@ X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, | |||
113 | /* CONF *conf: Config file */ | 113 | /* CONF *conf: Config file */ |
114 | /* char *value: Value */ | 114 | /* char *value: Value */ |
115 | static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, | 115 | static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, |
116 | int crit, char *value) | 116 | int crit, char *value) |
117 | { | 117 | { |
118 | const X509V3_EXT_METHOD *method; | 118 | X509V3_EXT_METHOD *method; |
119 | X509_EXTENSION *ext; | 119 | X509_EXTENSION *ext; |
120 | STACK_OF(CONF_VALUE) *nval; | 120 | STACK_OF(CONF_VALUE) *nval; |
121 | void *ext_struc; | 121 | void *ext_struc; |
@@ -172,8 +172,8 @@ static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, | |||
172 | 172 | ||
173 | } | 173 | } |
174 | 174 | ||
175 | static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, | 175 | static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid, |
176 | int crit, void *ext_struc) | 176 | int crit, void *ext_struc) |
177 | { | 177 | { |
178 | unsigned char *ext_der; | 178 | unsigned char *ext_der; |
179 | int ext_len; | 179 | int ext_len; |
@@ -214,7 +214,7 @@ static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, | |||
214 | 214 | ||
215 | X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc) | 215 | X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc) |
216 | { | 216 | { |
217 | const X509V3_EXT_METHOD *method; | 217 | X509V3_EXT_METHOD *method; |
218 | if (!(method = X509V3_EXT_get_nid(ext_nid))) { | 218 | if (!(method = X509V3_EXT_get_nid(ext_nid))) { |
219 | X509V3err(X509V3_F_X509V3_EXT_I2D,X509V3_R_UNKNOWN_EXTENSION); | 219 | X509V3err(X509V3_F_X509V3_EXT_I2D,X509V3_R_UNKNOWN_EXTENSION); |
220 | return NULL; | 220 | return NULL; |
@@ -258,8 +258,7 @@ static int v3_check_generic(char **value) | |||
258 | 258 | ||
259 | /* Create a generic extension: for now just handle DER type */ | 259 | /* Create a generic extension: for now just handle DER type */ |
260 | static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, | 260 | static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, |
261 | int crit, int gen_type, | 261 | int crit, int gen_type, X509V3_CTX *ctx) |
262 | X509V3_CTX *ctx) | ||
263 | { | 262 | { |
264 | unsigned char *ext_der=NULL; | 263 | unsigned char *ext_der=NULL; |
265 | long ext_len; | 264 | long ext_len; |
@@ -323,7 +322,7 @@ static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len) | |||
323 | 322 | ||
324 | 323 | ||
325 | int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, | 324 | int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, |
326 | STACK_OF(X509_EXTENSION) **sk) | 325 | STACK_OF(X509_EXTENSION) **sk) |
327 | { | 326 | { |
328 | X509_EXTENSION *ext; | 327 | X509_EXTENSION *ext; |
329 | STACK_OF(CONF_VALUE) *nval; | 328 | STACK_OF(CONF_VALUE) *nval; |
@@ -344,7 +343,7 @@ int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, | |||
344 | /* Convenience functions to add extensions to a certificate, CRL and request */ | 343 | /* Convenience functions to add extensions to a certificate, CRL and request */ |
345 | 344 | ||
346 | int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, | 345 | int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, |
347 | X509 *cert) | 346 | X509 *cert) |
348 | { | 347 | { |
349 | STACK_OF(X509_EXTENSION) **sk = NULL; | 348 | STACK_OF(X509_EXTENSION) **sk = NULL; |
350 | if (cert) | 349 | if (cert) |
@@ -355,7 +354,7 @@ int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, | |||
355 | /* Same as above but for a CRL */ | 354 | /* Same as above but for a CRL */ |
356 | 355 | ||
357 | int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, | 356 | int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, |
358 | X509_CRL *crl) | 357 | X509_CRL *crl) |
359 | { | 358 | { |
360 | STACK_OF(X509_EXTENSION) **sk = NULL; | 359 | STACK_OF(X509_EXTENSION) **sk = NULL; |
361 | if (crl) | 360 | if (crl) |
@@ -444,7 +443,7 @@ void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf) | |||
444 | } | 443 | } |
445 | 444 | ||
446 | void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req, | 445 | void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req, |
447 | X509_CRL *crl, int flags) | 446 | X509_CRL *crl, int flags) |
448 | { | 447 | { |
449 | ctx->issuer_cert = issuer; | 448 | ctx->issuer_cert = issuer; |
450 | ctx->subject_cert = subj; | 449 | ctx->subject_cert = subj; |
@@ -455,8 +454,8 @@ void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req, | |||
455 | 454 | ||
456 | /* Old conf compatibility functions */ | 455 | /* Old conf compatibility functions */ |
457 | 456 | ||
458 | X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | 457 | X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, |
459 | char *name, char *value) | 458 | char *value) |
460 | { | 459 | { |
461 | CONF ctmp; | 460 | CONF ctmp; |
462 | CONF_set_nconf(&ctmp, conf); | 461 | CONF_set_nconf(&ctmp, conf); |
@@ -465,8 +464,8 @@ X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | |||
465 | 464 | ||
466 | /* LHASH *conf: Config file */ | 465 | /* LHASH *conf: Config file */ |
467 | /* char *value: Value */ | 466 | /* char *value: Value */ |
468 | X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | 467 | X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, |
469 | int ext_nid, char *value) | 468 | char *value) |
470 | { | 469 | { |
471 | CONF ctmp; | 470 | CONF ctmp; |
472 | CONF_set_nconf(&ctmp, conf); | 471 | CONF_set_nconf(&ctmp, conf); |
@@ -490,14 +489,14 @@ NULL, | |||
490 | NULL | 489 | NULL |
491 | }; | 490 | }; |
492 | 491 | ||
493 | void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash) | 492 | void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash) |
494 | { | 493 | { |
495 | ctx->db_meth = &conf_lhash_method; | 494 | ctx->db_meth = &conf_lhash_method; |
496 | ctx->db = lhash; | 495 | ctx->db = lhash; |
497 | } | 496 | } |
498 | 497 | ||
499 | int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | 498 | int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, |
500 | char *section, X509 *cert) | 499 | X509 *cert) |
501 | { | 500 | { |
502 | CONF ctmp; | 501 | CONF ctmp; |
503 | CONF_set_nconf(&ctmp, conf); | 502 | CONF_set_nconf(&ctmp, conf); |
@@ -506,8 +505,8 @@ int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | |||
506 | 505 | ||
507 | /* Same as above but for a CRL */ | 506 | /* Same as above but for a CRL */ |
508 | 507 | ||
509 | int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | 508 | int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, |
510 | char *section, X509_CRL *crl) | 509 | X509_CRL *crl) |
511 | { | 510 | { |
512 | CONF ctmp; | 511 | CONF ctmp; |
513 | CONF_set_nconf(&ctmp, conf); | 512 | CONF_set_nconf(&ctmp, conf); |
@@ -516,8 +515,8 @@ int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | |||
516 | 515 | ||
517 | /* Add extensions to certificate request */ | 516 | /* Add extensions to certificate request */ |
518 | 517 | ||
519 | int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | 518 | int X509V3_EXT_REQ_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, |
520 | char *section, X509_REQ *req) | 519 | X509_REQ *req) |
521 | { | 520 | { |
522 | CONF ctmp; | 521 | CONF ctmp; |
523 | CONF_set_nconf(&ctmp, conf); | 522 | CONF_set_nconf(&ctmp, conf); |
diff --git a/src/lib/libcrypto/x509v3/v3_cpols.c b/src/lib/libcrypto/x509v3/v3_cpols.c index 1f0798b946..ad0506d75c 100644 --- a/src/lib/libcrypto/x509v3/v3_cpols.c +++ b/src/lib/libcrypto/x509v3/v3_cpols.c | |||
@@ -450,8 +450,5 @@ void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent) | |||
450 | else | 450 | else |
451 | BIO_printf(out, "%*sNo Qualifiers\n", indent + 2, ""); | 451 | BIO_printf(out, "%*sNo Qualifiers\n", indent + 2, ""); |
452 | } | 452 | } |
453 | 453 | ||
454 | |||
455 | IMPLEMENT_STACK_OF(X509_POLICY_NODE) | 454 | IMPLEMENT_STACK_OF(X509_POLICY_NODE) |
456 | IMPLEMENT_STACK_OF(X509_POLICY_DATA) | ||
457 | |||
diff --git a/src/lib/libcrypto/x509v3/v3_crld.c b/src/lib/libcrypto/x509v3/v3_crld.c index 790a6dd032..181a8977b1 100644 --- a/src/lib/libcrypto/x509v3/v3_crld.c +++ b/src/lib/libcrypto/x509v3/v3_crld.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * project 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
5 | /* ==================================================================== | 5 | /* ==================================================================== |
6 | * Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. | 6 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. |
7 | * | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions |
@@ -63,254 +63,45 @@ | |||
63 | #include <openssl/asn1t.h> | 63 | #include <openssl/asn1t.h> |
64 | #include <openssl/x509v3.h> | 64 | #include <openssl/x509v3.h> |
65 | 65 | ||
66 | static void *v2i_crld(const X509V3_EXT_METHOD *method, | 66 | static STACK_OF(CONF_VALUE) *i2v_crld(X509V3_EXT_METHOD *method, |
67 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); | 67 | STACK_OF(DIST_POINT) *crld, STACK_OF(CONF_VALUE) *extlist); |
68 | static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out, | 68 | static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method, |
69 | int indent); | 69 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); |
70 | 70 | ||
71 | const X509V3_EXT_METHOD v3_crld = | 71 | const X509V3_EXT_METHOD v3_crld = { |
72 | { | 72 | NID_crl_distribution_points, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(CRL_DIST_POINTS), |
73 | NID_crl_distribution_points, 0, ASN1_ITEM_ref(CRL_DIST_POINTS), | 73 | 0,0,0,0, |
74 | 0,0,0,0, | 74 | 0,0, |
75 | 0,0, | 75 | (X509V3_EXT_I2V)i2v_crld, |
76 | 0, | 76 | (X509V3_EXT_V2I)v2i_crld, |
77 | v2i_crld, | 77 | 0,0, |
78 | i2r_crldp,0, | 78 | NULL |
79 | NULL | ||
80 | }; | ||
81 | |||
82 | const X509V3_EXT_METHOD v3_freshest_crl = | ||
83 | { | ||
84 | NID_freshest_crl, 0, ASN1_ITEM_ref(CRL_DIST_POINTS), | ||
85 | 0,0,0,0, | ||
86 | 0,0, | ||
87 | 0, | ||
88 | v2i_crld, | ||
89 | i2r_crldp,0, | ||
90 | NULL | ||
91 | }; | ||
92 | |||
93 | static STACK_OF(GENERAL_NAME) *gnames_from_sectname(X509V3_CTX *ctx, char *sect) | ||
94 | { | ||
95 | STACK_OF(CONF_VALUE) *gnsect; | ||
96 | STACK_OF(GENERAL_NAME) *gens; | ||
97 | if (*sect == '@') | ||
98 | gnsect = X509V3_get_section(ctx, sect + 1); | ||
99 | else | ||
100 | gnsect = X509V3_parse_list(sect); | ||
101 | if (!gnsect) | ||
102 | { | ||
103 | X509V3err(X509V3_F_GNAMES_FROM_SECTNAME, | ||
104 | X509V3_R_SECTION_NOT_FOUND); | ||
105 | return NULL; | ||
106 | } | ||
107 | gens = v2i_GENERAL_NAMES(NULL, ctx, gnsect); | ||
108 | if (*sect == '@') | ||
109 | X509V3_section_free(ctx, gnsect); | ||
110 | else | ||
111 | sk_CONF_VALUE_pop_free(gnsect, X509V3_conf_free); | ||
112 | return gens; | ||
113 | } | ||
114 | |||
115 | static int set_dist_point_name(DIST_POINT_NAME **pdp, X509V3_CTX *ctx, | ||
116 | CONF_VALUE *cnf) | ||
117 | { | ||
118 | STACK_OF(GENERAL_NAME) *fnm = NULL; | ||
119 | STACK_OF(X509_NAME_ENTRY) *rnm = NULL; | ||
120 | if (!strncmp(cnf->name, "fullname", 9)) | ||
121 | { | ||
122 | fnm = gnames_from_sectname(ctx, cnf->value); | ||
123 | if (!fnm) | ||
124 | goto err; | ||
125 | } | ||
126 | else if (!strcmp(cnf->name, "relativename")) | ||
127 | { | ||
128 | int ret; | ||
129 | STACK_OF(CONF_VALUE) *dnsect; | ||
130 | X509_NAME *nm; | ||
131 | nm = X509_NAME_new(); | ||
132 | if (!nm) | ||
133 | return -1; | ||
134 | dnsect = X509V3_get_section(ctx, cnf->value); | ||
135 | if (!dnsect) | ||
136 | { | ||
137 | X509V3err(X509V3_F_SET_DIST_POINT_NAME, | ||
138 | X509V3_R_SECTION_NOT_FOUND); | ||
139 | return -1; | ||
140 | } | ||
141 | ret = X509V3_NAME_from_section(nm, dnsect, MBSTRING_ASC); | ||
142 | X509V3_section_free(ctx, dnsect); | ||
143 | rnm = nm->entries; | ||
144 | nm->entries = NULL; | ||
145 | X509_NAME_free(nm); | ||
146 | if (!ret || sk_X509_NAME_ENTRY_num(rnm) <= 0) | ||
147 | goto err; | ||
148 | /* Since its a name fragment can't have more than one | ||
149 | * RDNSequence | ||
150 | */ | ||
151 | if (sk_X509_NAME_ENTRY_value(rnm, | ||
152 | sk_X509_NAME_ENTRY_num(rnm) - 1)->set) | ||
153 | { | ||
154 | X509V3err(X509V3_F_SET_DIST_POINT_NAME, | ||
155 | X509V3_R_INVALID_MULTIPLE_RDNS); | ||
156 | goto err; | ||
157 | } | ||
158 | } | ||
159 | else | ||
160 | return 0; | ||
161 | |||
162 | if (*pdp) | ||
163 | { | ||
164 | X509V3err(X509V3_F_SET_DIST_POINT_NAME, | ||
165 | X509V3_R_DISTPOINT_ALREADY_SET); | ||
166 | goto err; | ||
167 | } | ||
168 | |||
169 | *pdp = DIST_POINT_NAME_new(); | ||
170 | if (!*pdp) | ||
171 | goto err; | ||
172 | if (fnm) | ||
173 | { | ||
174 | (*pdp)->type = 0; | ||
175 | (*pdp)->name.fullname = fnm; | ||
176 | } | ||
177 | else | ||
178 | { | ||
179 | (*pdp)->type = 1; | ||
180 | (*pdp)->name.relativename = rnm; | ||
181 | } | ||
182 | |||
183 | return 1; | ||
184 | |||
185 | err: | ||
186 | if (fnm) | ||
187 | sk_GENERAL_NAME_pop_free(fnm, GENERAL_NAME_free); | ||
188 | if (rnm) | ||
189 | sk_X509_NAME_ENTRY_pop_free(rnm, X509_NAME_ENTRY_free); | ||
190 | return -1; | ||
191 | } | ||
192 | |||
193 | static const BIT_STRING_BITNAME reason_flags[] = { | ||
194 | {0, "Unused", "unused"}, | ||
195 | {1, "Key Compromise", "keyCompromise"}, | ||
196 | {2, "CA Compromise", "CACompromise"}, | ||
197 | {3, "Affiliation Changed", "affiliationChanged"}, | ||
198 | {4, "Superseded", "superseded"}, | ||
199 | {5, "Cessation Of Operation", "cessationOfOperation"}, | ||
200 | {6, "Certificate Hold", "certificateHold"}, | ||
201 | {7, "Privilege Withdrawn", "privilegeWithdrawn"}, | ||
202 | {8, "AA Compromise", "AACompromise"}, | ||
203 | {-1, NULL, NULL} | ||
204 | }; | 79 | }; |
205 | 80 | ||
206 | static int set_reasons(ASN1_BIT_STRING **preas, char *value) | 81 | static STACK_OF(CONF_VALUE) *i2v_crld(X509V3_EXT_METHOD *method, |
207 | { | 82 | STACK_OF(DIST_POINT) *crld, STACK_OF(CONF_VALUE) *exts) |
208 | STACK_OF(CONF_VALUE) *rsk = NULL; | 83 | { |
209 | const BIT_STRING_BITNAME *pbn; | 84 | DIST_POINT *point; |
210 | const char *bnam; | ||
211 | int i, ret = 0; | ||
212 | rsk = X509V3_parse_list(value); | ||
213 | if (!rsk) | ||
214 | return 0; | ||
215 | if (*preas) | ||
216 | return 0; | ||
217 | for (i = 0; i < sk_CONF_VALUE_num(rsk); i++) | ||
218 | { | ||
219 | bnam = sk_CONF_VALUE_value(rsk, i)->name; | ||
220 | if (!*preas) | ||
221 | { | ||
222 | *preas = ASN1_BIT_STRING_new(); | ||
223 | if (!*preas) | ||
224 | goto err; | ||
225 | } | ||
226 | for (pbn = reason_flags; pbn->lname; pbn++) | ||
227 | { | ||
228 | if (!strcmp(pbn->sname, bnam)) | ||
229 | { | ||
230 | if (!ASN1_BIT_STRING_set_bit(*preas, | ||
231 | pbn->bitnum, 1)) | ||
232 | goto err; | ||
233 | break; | ||
234 | } | ||
235 | } | ||
236 | if (!pbn->lname) | ||
237 | goto err; | ||
238 | } | ||
239 | ret = 1; | ||
240 | |||
241 | err: | ||
242 | sk_CONF_VALUE_pop_free(rsk, X509V3_conf_free); | ||
243 | return ret; | ||
244 | } | ||
245 | |||
246 | static int print_reasons(BIO *out, const char *rname, | ||
247 | ASN1_BIT_STRING *rflags, int indent) | ||
248 | { | ||
249 | int first = 1; | ||
250 | const BIT_STRING_BITNAME *pbn; | ||
251 | BIO_printf(out, "%*s%s:\n%*s", indent, "", rname, indent + 2, ""); | ||
252 | for (pbn = reason_flags; pbn->lname; pbn++) | ||
253 | { | ||
254 | if (ASN1_BIT_STRING_get_bit(rflags, pbn->bitnum)) | ||
255 | { | ||
256 | if (first) | ||
257 | first = 0; | ||
258 | else | ||
259 | BIO_puts(out, ", "); | ||
260 | BIO_puts(out, pbn->lname); | ||
261 | } | ||
262 | } | ||
263 | if (first) | ||
264 | BIO_puts(out, "<EMPTY>\n"); | ||
265 | else | ||
266 | BIO_puts(out, "\n"); | ||
267 | return 1; | ||
268 | } | ||
269 | |||
270 | static DIST_POINT *crldp_from_section(X509V3_CTX *ctx, | ||
271 | STACK_OF(CONF_VALUE) *nval) | ||
272 | { | ||
273 | int i; | 85 | int i; |
274 | CONF_VALUE *cnf; | 86 | for(i = 0; i < sk_DIST_POINT_num(crld); i++) { |
275 | DIST_POINT *point = NULL; | 87 | point = sk_DIST_POINT_value(crld, i); |
276 | point = DIST_POINT_new(); | 88 | if(point->distpoint) { |
277 | if (!point) | 89 | if(point->distpoint->type == 0) |
278 | goto err; | 90 | exts = i2v_GENERAL_NAMES(NULL, |
279 | for(i = 0; i < sk_CONF_VALUE_num(nval); i++) | 91 | point->distpoint->name.fullname, exts); |
280 | { | 92 | else X509V3_add_value("RelativeName","<UNSUPPORTED>", &exts); |
281 | int ret; | ||
282 | cnf = sk_CONF_VALUE_value(nval, i); | ||
283 | ret = set_dist_point_name(&point->distpoint, ctx, cnf); | ||
284 | if (ret > 0) | ||
285 | continue; | ||
286 | if (ret < 0) | ||
287 | goto err; | ||
288 | if (!strcmp(cnf->name, "reasons")) | ||
289 | { | ||
290 | if (!set_reasons(&point->reasons, cnf->value)) | ||
291 | goto err; | ||
292 | } | ||
293 | else if (!strcmp(cnf->name, "CRLissuer")) | ||
294 | { | ||
295 | point->CRLissuer = | ||
296 | gnames_from_sectname(ctx, cnf->value); | ||
297 | if (!point->CRLissuer) | ||
298 | goto err; | ||
299 | } | ||
300 | } | 93 | } |
301 | 94 | if(point->reasons) | |
302 | return point; | 95 | X509V3_add_value("reasons","<UNSUPPORTED>", &exts); |
303 | 96 | if(point->CRLissuer) | |
304 | 97 | X509V3_add_value("CRLissuer","<UNSUPPORTED>", &exts); | |
305 | err: | ||
306 | if (point) | ||
307 | DIST_POINT_free(point); | ||
308 | return NULL; | ||
309 | } | 98 | } |
99 | return exts; | ||
100 | } | ||
310 | 101 | ||
311 | static void *v2i_crld(const X509V3_EXT_METHOD *method, | 102 | static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method, |
312 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) | 103 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) |
313 | { | 104 | { |
314 | STACK_OF(DIST_POINT) *crld = NULL; | 105 | STACK_OF(DIST_POINT) *crld = NULL; |
315 | GENERAL_NAMES *gens = NULL; | 106 | GENERAL_NAMES *gens = NULL; |
316 | GENERAL_NAME *gen = NULL; | 107 | GENERAL_NAME *gen = NULL; |
@@ -320,44 +111,19 @@ static void *v2i_crld(const X509V3_EXT_METHOD *method, | |||
320 | for(i = 0; i < sk_CONF_VALUE_num(nval); i++) { | 111 | for(i = 0; i < sk_CONF_VALUE_num(nval); i++) { |
321 | DIST_POINT *point; | 112 | DIST_POINT *point; |
322 | cnf = sk_CONF_VALUE_value(nval, i); | 113 | cnf = sk_CONF_VALUE_value(nval, i); |
323 | if (!cnf->value) | 114 | if(!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) goto err; |
324 | { | 115 | if(!(gens = GENERAL_NAMES_new())) goto merr; |
325 | STACK_OF(CONF_VALUE) *dpsect; | 116 | if(!sk_GENERAL_NAME_push(gens, gen)) goto merr; |
326 | dpsect = X509V3_get_section(ctx, cnf->name); | 117 | gen = NULL; |
327 | if (!dpsect) | 118 | if(!(point = DIST_POINT_new())) goto merr; |
328 | goto err; | 119 | if(!sk_DIST_POINT_push(crld, point)) { |
329 | point = crldp_from_section(ctx, dpsect); | 120 | DIST_POINT_free(point); |
330 | X509V3_section_free(ctx, dpsect); | 121 | goto merr; |
331 | if (!point) | 122 | } |
332 | goto err; | 123 | if(!(point->distpoint = DIST_POINT_NAME_new())) goto merr; |
333 | if(!sk_DIST_POINT_push(crld, point)) | 124 | point->distpoint->name.fullname = gens; |
334 | { | 125 | point->distpoint->type = 0; |
335 | DIST_POINT_free(point); | 126 | gens = NULL; |
336 | goto merr; | ||
337 | } | ||
338 | } | ||
339 | else | ||
340 | { | ||
341 | if(!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) | ||
342 | goto err; | ||
343 | if(!(gens = GENERAL_NAMES_new())) | ||
344 | goto merr; | ||
345 | if(!sk_GENERAL_NAME_push(gens, gen)) | ||
346 | goto merr; | ||
347 | gen = NULL; | ||
348 | if(!(point = DIST_POINT_new())) | ||
349 | goto merr; | ||
350 | if(!sk_DIST_POINT_push(crld, point)) | ||
351 | { | ||
352 | DIST_POINT_free(point); | ||
353 | goto merr; | ||
354 | } | ||
355 | if(!(point->distpoint = DIST_POINT_NAME_new())) | ||
356 | goto merr; | ||
357 | point->distpoint->name.fullname = gens; | ||
358 | point->distpoint->type = 0; | ||
359 | gens = NULL; | ||
360 | } | ||
361 | } | 127 | } |
362 | return crld; | 128 | return crld; |
363 | 129 | ||
@@ -373,31 +139,11 @@ static void *v2i_crld(const X509V3_EXT_METHOD *method, | |||
373 | IMPLEMENT_STACK_OF(DIST_POINT) | 139 | IMPLEMENT_STACK_OF(DIST_POINT) |
374 | IMPLEMENT_ASN1_SET_OF(DIST_POINT) | 140 | IMPLEMENT_ASN1_SET_OF(DIST_POINT) |
375 | 141 | ||
376 | static int dpn_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, | ||
377 | void *exarg) | ||
378 | { | ||
379 | DIST_POINT_NAME *dpn = (DIST_POINT_NAME *)*pval; | ||
380 | |||
381 | switch(operation) | ||
382 | { | ||
383 | case ASN1_OP_NEW_POST: | ||
384 | dpn->dpname = NULL; | ||
385 | break; | ||
386 | |||
387 | case ASN1_OP_FREE_POST: | ||
388 | if (dpn->dpname) | ||
389 | X509_NAME_free(dpn->dpname); | ||
390 | break; | ||
391 | } | ||
392 | return 1; | ||
393 | } | ||
394 | |||
395 | 142 | ||
396 | ASN1_CHOICE_cb(DIST_POINT_NAME, dpn_cb) = { | 143 | ASN1_CHOICE(DIST_POINT_NAME) = { |
397 | ASN1_IMP_SEQUENCE_OF(DIST_POINT_NAME, name.fullname, GENERAL_NAME, 0), | 144 | ASN1_IMP_SEQUENCE_OF(DIST_POINT_NAME, name.fullname, GENERAL_NAME, 0), |
398 | ASN1_IMP_SET_OF(DIST_POINT_NAME, name.relativename, X509_NAME_ENTRY, 1) | 145 | ASN1_IMP_SET_OF(DIST_POINT_NAME, name.relativename, X509_NAME_ENTRY, 1) |
399 | } ASN1_CHOICE_END_cb(DIST_POINT_NAME, DIST_POINT_NAME, type) | 146 | } ASN1_CHOICE_END(DIST_POINT_NAME) |
400 | |||
401 | 147 | ||
402 | IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT_NAME) | 148 | IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT_NAME) |
403 | 149 | ||
@@ -414,203 +160,3 @@ ASN1_ITEM_TEMPLATE(CRL_DIST_POINTS) = | |||
414 | ASN1_ITEM_TEMPLATE_END(CRL_DIST_POINTS) | 160 | ASN1_ITEM_TEMPLATE_END(CRL_DIST_POINTS) |
415 | 161 | ||
416 | IMPLEMENT_ASN1_FUNCTIONS(CRL_DIST_POINTS) | 162 | IMPLEMENT_ASN1_FUNCTIONS(CRL_DIST_POINTS) |
417 | |||
418 | ASN1_SEQUENCE(ISSUING_DIST_POINT) = { | ||
419 | ASN1_EXP_OPT(ISSUING_DIST_POINT, distpoint, DIST_POINT_NAME, 0), | ||
420 | ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyuser, ASN1_FBOOLEAN, 1), | ||
421 | ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyCA, ASN1_FBOOLEAN, 2), | ||
422 | ASN1_IMP_OPT(ISSUING_DIST_POINT, onlysomereasons, ASN1_BIT_STRING, 3), | ||
423 | ASN1_IMP_OPT(ISSUING_DIST_POINT, indirectCRL, ASN1_FBOOLEAN, 4), | ||
424 | ASN1_IMP_OPT(ISSUING_DIST_POINT, onlyattr, ASN1_FBOOLEAN, 5) | ||
425 | } ASN1_SEQUENCE_END(ISSUING_DIST_POINT) | ||
426 | |||
427 | IMPLEMENT_ASN1_FUNCTIONS(ISSUING_DIST_POINT) | ||
428 | |||
429 | static int i2r_idp(const X509V3_EXT_METHOD *method, void *pidp, BIO *out, | ||
430 | int indent); | ||
431 | static void *v2i_idp(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, | ||
432 | STACK_OF(CONF_VALUE) *nval); | ||
433 | |||
434 | const X509V3_EXT_METHOD v3_idp = | ||
435 | { | ||
436 | NID_issuing_distribution_point, X509V3_EXT_MULTILINE, | ||
437 | ASN1_ITEM_ref(ISSUING_DIST_POINT), | ||
438 | 0,0,0,0, | ||
439 | 0,0, | ||
440 | 0, | ||
441 | v2i_idp, | ||
442 | i2r_idp,0, | ||
443 | NULL | ||
444 | }; | ||
445 | |||
446 | static void *v2i_idp(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, | ||
447 | STACK_OF(CONF_VALUE) *nval) | ||
448 | { | ||
449 | ISSUING_DIST_POINT *idp = NULL; | ||
450 | CONF_VALUE *cnf; | ||
451 | char *name, *val; | ||
452 | int i, ret; | ||
453 | idp = ISSUING_DIST_POINT_new(); | ||
454 | if (!idp) | ||
455 | goto merr; | ||
456 | for(i = 0; i < sk_CONF_VALUE_num(nval); i++) | ||
457 | { | ||
458 | cnf = sk_CONF_VALUE_value(nval, i); | ||
459 | name = cnf->name; | ||
460 | val = cnf->value; | ||
461 | ret = set_dist_point_name(&idp->distpoint, ctx, cnf); | ||
462 | if (ret > 0) | ||
463 | continue; | ||
464 | if (ret < 0) | ||
465 | goto err; | ||
466 | if (!strcmp(name, "onlyuser")) | ||
467 | { | ||
468 | if (!X509V3_get_value_bool(cnf, &idp->onlyuser)) | ||
469 | goto err; | ||
470 | } | ||
471 | else if (!strcmp(name, "onlyCA")) | ||
472 | { | ||
473 | if (!X509V3_get_value_bool(cnf, &idp->onlyCA)) | ||
474 | goto err; | ||
475 | } | ||
476 | else if (!strcmp(name, "onlyAA")) | ||
477 | { | ||
478 | if (!X509V3_get_value_bool(cnf, &idp->onlyattr)) | ||
479 | goto err; | ||
480 | } | ||
481 | else if (!strcmp(name, "indirectCRL")) | ||
482 | { | ||
483 | if (!X509V3_get_value_bool(cnf, &idp->indirectCRL)) | ||
484 | goto err; | ||
485 | } | ||
486 | else if (!strcmp(name, "onlysomereasons")) | ||
487 | { | ||
488 | if (!set_reasons(&idp->onlysomereasons, val)) | ||
489 | goto err; | ||
490 | } | ||
491 | else | ||
492 | { | ||
493 | X509V3err(X509V3_F_V2I_IDP, X509V3_R_INVALID_NAME); | ||
494 | X509V3_conf_err(cnf); | ||
495 | goto err; | ||
496 | } | ||
497 | } | ||
498 | return idp; | ||
499 | |||
500 | merr: | ||
501 | X509V3err(X509V3_F_V2I_IDP,ERR_R_MALLOC_FAILURE); | ||
502 | err: | ||
503 | ISSUING_DIST_POINT_free(idp); | ||
504 | return NULL; | ||
505 | } | ||
506 | |||
507 | static int print_gens(BIO *out, STACK_OF(GENERAL_NAME) *gens, int indent) | ||
508 | { | ||
509 | int i; | ||
510 | for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) | ||
511 | { | ||
512 | BIO_printf(out, "%*s", indent + 2, ""); | ||
513 | GENERAL_NAME_print(out, sk_GENERAL_NAME_value(gens, i)); | ||
514 | BIO_puts(out, "\n"); | ||
515 | } | ||
516 | return 1; | ||
517 | } | ||
518 | |||
519 | static int print_distpoint(BIO *out, DIST_POINT_NAME *dpn, int indent) | ||
520 | { | ||
521 | if (dpn->type == 0) | ||
522 | { | ||
523 | BIO_printf(out, "%*sFull Name:\n", indent, ""); | ||
524 | print_gens(out, dpn->name.fullname, indent); | ||
525 | } | ||
526 | else | ||
527 | { | ||
528 | X509_NAME ntmp; | ||
529 | ntmp.entries = dpn->name.relativename; | ||
530 | BIO_printf(out, "%*sRelative Name:\n%*s", | ||
531 | indent, "", indent + 2, ""); | ||
532 | X509_NAME_print_ex(out, &ntmp, 0, XN_FLAG_ONELINE); | ||
533 | BIO_puts(out, "\n"); | ||
534 | } | ||
535 | return 1; | ||
536 | } | ||
537 | |||
538 | static int i2r_idp(const X509V3_EXT_METHOD *method, void *pidp, BIO *out, | ||
539 | int indent) | ||
540 | { | ||
541 | ISSUING_DIST_POINT *idp = pidp; | ||
542 | if (idp->distpoint) | ||
543 | print_distpoint(out, idp->distpoint, indent); | ||
544 | if (idp->onlyuser > 0) | ||
545 | BIO_printf(out, "%*sOnly User Certificates\n", indent, ""); | ||
546 | if (idp->onlyCA > 0) | ||
547 | BIO_printf(out, "%*sOnly CA Certificates\n", indent, ""); | ||
548 | if (idp->indirectCRL > 0) | ||
549 | BIO_printf(out, "%*sIndirect CRL\n", indent, ""); | ||
550 | if (idp->onlysomereasons) | ||
551 | print_reasons(out, "Only Some Reasons", | ||
552 | idp->onlysomereasons, indent); | ||
553 | if (idp->onlyattr > 0) | ||
554 | BIO_printf(out, "%*sOnly Attribute Certificates\n", indent, ""); | ||
555 | if (!idp->distpoint && (idp->onlyuser <= 0) && (idp->onlyCA <= 0) | ||
556 | && (idp->indirectCRL <= 0) && !idp->onlysomereasons | ||
557 | && (idp->onlyattr <= 0)) | ||
558 | BIO_printf(out, "%*s<EMPTY>\n", indent, ""); | ||
559 | |||
560 | return 1; | ||
561 | } | ||
562 | |||
563 | static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out, | ||
564 | int indent) | ||
565 | { | ||
566 | STACK_OF(DIST_POINT) *crld = pcrldp; | ||
567 | DIST_POINT *point; | ||
568 | int i; | ||
569 | for(i = 0; i < sk_DIST_POINT_num(crld); i++) | ||
570 | { | ||
571 | BIO_puts(out, "\n"); | ||
572 | point = sk_DIST_POINT_value(crld, i); | ||
573 | if(point->distpoint) | ||
574 | print_distpoint(out, point->distpoint, indent); | ||
575 | if(point->reasons) | ||
576 | print_reasons(out, "Reasons", point->reasons, | ||
577 | indent); | ||
578 | if(point->CRLissuer) | ||
579 | { | ||
580 | BIO_printf(out, "%*sCRL Issuer:\n", indent, ""); | ||
581 | print_gens(out, point->CRLissuer, indent); | ||
582 | } | ||
583 | } | ||
584 | return 1; | ||
585 | } | ||
586 | |||
587 | int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname) | ||
588 | { | ||
589 | int i; | ||
590 | STACK_OF(X509_NAME_ENTRY) *frag; | ||
591 | X509_NAME_ENTRY *ne; | ||
592 | if (!dpn || (dpn->type != 1)) | ||
593 | return 1; | ||
594 | frag = dpn->name.relativename; | ||
595 | dpn->dpname = X509_NAME_dup(iname); | ||
596 | if (!dpn->dpname) | ||
597 | return 0; | ||
598 | for (i = 0; i < sk_X509_NAME_ENTRY_num(frag); i++) | ||
599 | { | ||
600 | ne = sk_X509_NAME_ENTRY_value(frag, i); | ||
601 | if (!X509_NAME_add_entry(dpn->dpname, ne, -1, i ? 0 : 1)) | ||
602 | { | ||
603 | X509_NAME_free(dpn->dpname); | ||
604 | dpn->dpname = NULL; | ||
605 | return 0; | ||
606 | } | ||
607 | } | ||
608 | /* generate cached encoding of name */ | ||
609 | if (i2d_X509_NAME(dpn->dpname, NULL) < 0) | ||
610 | { | ||
611 | X509_NAME_free(dpn->dpname); | ||
612 | dpn->dpname = NULL; | ||
613 | return 0; | ||
614 | } | ||
615 | return 1; | ||
616 | } | ||
diff --git a/src/lib/libcrypto/x509v3/v3_enum.c b/src/lib/libcrypto/x509v3/v3_enum.c index c0575e368d..36576eaa4d 100644 --- a/src/lib/libcrypto/x509v3/v3_enum.c +++ b/src/lib/libcrypto/x509v3/v3_enum.c | |||
@@ -61,17 +61,14 @@ | |||
61 | #include <openssl/x509v3.h> | 61 | #include <openssl/x509v3.h> |
62 | 62 | ||
63 | static ENUMERATED_NAMES crl_reasons[] = { | 63 | static ENUMERATED_NAMES crl_reasons[] = { |
64 | {CRL_REASON_UNSPECIFIED, "Unspecified", "unspecified"}, | 64 | {0, "Unspecified", "unspecified"}, |
65 | {CRL_REASON_KEY_COMPROMISE, "Key Compromise", "keyCompromise"}, | 65 | {1, "Key Compromise", "keyCompromise"}, |
66 | {CRL_REASON_CA_COMPROMISE, "CA Compromise", "CACompromise"}, | 66 | {2, "CA Compromise", "CACompromise"}, |
67 | {CRL_REASON_AFFILIATION_CHANGED, "Affiliation Changed", "affiliationChanged"}, | 67 | {3, "Affiliation Changed", "affiliationChanged"}, |
68 | {CRL_REASON_SUPERSEDED, "Superseded", "superseded"}, | 68 | {4, "Superseded", "superseded"}, |
69 | {CRL_REASON_CESSATION_OF_OPERATION, | 69 | {5, "Cessation Of Operation", "cessationOfOperation"}, |
70 | "Cessation Of Operation", "cessationOfOperation"}, | 70 | {6, "Certificate Hold", "certificateHold"}, |
71 | {CRL_REASON_CERTIFICATE_HOLD, "Certificate Hold", "certificateHold"}, | 71 | {8, "Remove From CRL", "removeFromCRL"}, |
72 | {CRL_REASON_REMOVE_FROM_CRL, "Remove From CRL", "removeFromCRL"}, | ||
73 | {CRL_REASON_PRIVILEGE_WITHDRAWN, "Privilege Withdrawn", "privilegeWithdrawn"}, | ||
74 | {CRL_REASON_AA_COMPROMISE, "AA Compromise", "AACompromise"}, | ||
75 | {-1, NULL, NULL} | 72 | {-1, NULL, NULL} |
76 | }; | 73 | }; |
77 | 74 | ||
diff --git a/src/lib/libcrypto/x509v3/v3_extku.c b/src/lib/libcrypto/x509v3/v3_extku.c index 1c66532757..c0d14500ed 100644 --- a/src/lib/libcrypto/x509v3/v3_extku.c +++ b/src/lib/libcrypto/x509v3/v3_extku.c | |||
@@ -63,10 +63,9 @@ | |||
63 | #include <openssl/conf.h> | 63 | #include <openssl/conf.h> |
64 | #include <openssl/x509v3.h> | 64 | #include <openssl/x509v3.h> |
65 | 65 | ||
66 | static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, | 66 | static void *v2i_EXTENDED_KEY_USAGE(X509V3_EXT_METHOD *method, |
67 | X509V3_CTX *ctx, | 67 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); |
68 | STACK_OF(CONF_VALUE) *nval); | 68 | static STACK_OF(CONF_VALUE) *i2v_EXTENDED_KEY_USAGE(X509V3_EXT_METHOD *method, |
69 | static STACK_OF(CONF_VALUE) *i2v_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, | ||
70 | void *eku, STACK_OF(CONF_VALUE) *extlist); | 69 | void *eku, STACK_OF(CONF_VALUE) *extlist); |
71 | 70 | ||
72 | const X509V3_EXT_METHOD v3_ext_ku = { | 71 | const X509V3_EXT_METHOD v3_ext_ku = { |
@@ -98,9 +97,8 @@ ASN1_ITEM_TEMPLATE_END(EXTENDED_KEY_USAGE) | |||
98 | 97 | ||
99 | IMPLEMENT_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) | 98 | IMPLEMENT_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) |
100 | 99 | ||
101 | static STACK_OF(CONF_VALUE) * | 100 | static STACK_OF(CONF_VALUE) *i2v_EXTENDED_KEY_USAGE(X509V3_EXT_METHOD *method, |
102 | i2v_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, void *a, | 101 | void *a, STACK_OF(CONF_VALUE) *ext_list) |
103 | STACK_OF(CONF_VALUE) *ext_list) | ||
104 | { | 102 | { |
105 | EXTENDED_KEY_USAGE *eku = a; | 103 | EXTENDED_KEY_USAGE *eku = a; |
106 | int i; | 104 | int i; |
@@ -114,8 +112,8 @@ static STACK_OF(CONF_VALUE) * | |||
114 | return ext_list; | 112 | return ext_list; |
115 | } | 113 | } |
116 | 114 | ||
117 | static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, | 115 | static void *v2i_EXTENDED_KEY_USAGE(X509V3_EXT_METHOD *method, |
118 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) | 116 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) |
119 | { | 117 | { |
120 | EXTENDED_KEY_USAGE *extku; | 118 | EXTENDED_KEY_USAGE *extku; |
121 | char *extval; | 119 | char *extval; |
diff --git a/src/lib/libcrypto/x509v3/v3_genn.c b/src/lib/libcrypto/x509v3/v3_genn.c index b628357301..84b4b1c881 100644 --- a/src/lib/libcrypto/x509v3/v3_genn.c +++ b/src/lib/libcrypto/x509v3/v3_genn.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * project 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
5 | /* ==================================================================== | 5 | /* ==================================================================== |
6 | * Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. | 6 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. |
7 | * | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions |
@@ -99,154 +99,3 @@ ASN1_ITEM_TEMPLATE(GENERAL_NAMES) = | |||
99 | ASN1_ITEM_TEMPLATE_END(GENERAL_NAMES) | 99 | ASN1_ITEM_TEMPLATE_END(GENERAL_NAMES) |
100 | 100 | ||
101 | IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAMES) | 101 | IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAMES) |
102 | |||
103 | GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a) | ||
104 | { | ||
105 | return (GENERAL_NAME *) ASN1_dup((i2d_of_void *) i2d_GENERAL_NAME, | ||
106 | (d2i_of_void *) d2i_GENERAL_NAME, | ||
107 | (char *) a); | ||
108 | } | ||
109 | |||
110 | /* Returns 0 if they are equal, != 0 otherwise. */ | ||
111 | int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b) | ||
112 | { | ||
113 | int result = -1; | ||
114 | |||
115 | if (!a || !b || a->type != b->type) return -1; | ||
116 | switch(a->type) | ||
117 | { | ||
118 | case GEN_X400: | ||
119 | case GEN_EDIPARTY: | ||
120 | result = ASN1_TYPE_cmp(a->d.other, b->d.other); | ||
121 | break; | ||
122 | |||
123 | case GEN_OTHERNAME: | ||
124 | result = OTHERNAME_cmp(a->d.otherName, b->d.otherName); | ||
125 | break; | ||
126 | |||
127 | case GEN_EMAIL: | ||
128 | case GEN_DNS: | ||
129 | case GEN_URI: | ||
130 | result = ASN1_STRING_cmp(a->d.ia5, b->d.ia5); | ||
131 | break; | ||
132 | |||
133 | case GEN_DIRNAME: | ||
134 | result = X509_NAME_cmp(a->d.dirn, b->d.dirn); | ||
135 | break; | ||
136 | |||
137 | case GEN_IPADD: | ||
138 | result = ASN1_OCTET_STRING_cmp(a->d.ip, b->d.ip); | ||
139 | break; | ||
140 | |||
141 | case GEN_RID: | ||
142 | result = OBJ_cmp(a->d.rid, b->d.rid); | ||
143 | break; | ||
144 | } | ||
145 | return result; | ||
146 | } | ||
147 | |||
148 | /* Returns 0 if they are equal, != 0 otherwise. */ | ||
149 | int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b) | ||
150 | { | ||
151 | int result = -1; | ||
152 | |||
153 | if (!a || !b) return -1; | ||
154 | /* Check their type first. */ | ||
155 | if ((result = OBJ_cmp(a->type_id, b->type_id)) != 0) | ||
156 | return result; | ||
157 | /* Check the value. */ | ||
158 | result = ASN1_TYPE_cmp(a->value, b->value); | ||
159 | return result; | ||
160 | } | ||
161 | |||
162 | void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value) | ||
163 | { | ||
164 | switch(type) | ||
165 | { | ||
166 | case GEN_X400: | ||
167 | case GEN_EDIPARTY: | ||
168 | a->d.other = value; | ||
169 | break; | ||
170 | |||
171 | case GEN_OTHERNAME: | ||
172 | a->d.otherName = value; | ||
173 | break; | ||
174 | |||
175 | case GEN_EMAIL: | ||
176 | case GEN_DNS: | ||
177 | case GEN_URI: | ||
178 | a->d.ia5 = value; | ||
179 | break; | ||
180 | |||
181 | case GEN_DIRNAME: | ||
182 | a->d.dirn = value; | ||
183 | break; | ||
184 | |||
185 | case GEN_IPADD: | ||
186 | a->d.ip = value; | ||
187 | break; | ||
188 | |||
189 | case GEN_RID: | ||
190 | a->d.rid = value; | ||
191 | break; | ||
192 | } | ||
193 | a->type = type; | ||
194 | } | ||
195 | |||
196 | void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype) | ||
197 | { | ||
198 | if (ptype) | ||
199 | *ptype = a->type; | ||
200 | switch(a->type) | ||
201 | { | ||
202 | case GEN_X400: | ||
203 | case GEN_EDIPARTY: | ||
204 | return a->d.other; | ||
205 | |||
206 | case GEN_OTHERNAME: | ||
207 | return a->d.otherName; | ||
208 | |||
209 | case GEN_EMAIL: | ||
210 | case GEN_DNS: | ||
211 | case GEN_URI: | ||
212 | return a->d.ia5; | ||
213 | |||
214 | case GEN_DIRNAME: | ||
215 | return a->d.dirn; | ||
216 | |||
217 | case GEN_IPADD: | ||
218 | return a->d.ip; | ||
219 | |||
220 | case GEN_RID: | ||
221 | return a->d.rid; | ||
222 | |||
223 | default: | ||
224 | return NULL; | ||
225 | } | ||
226 | } | ||
227 | |||
228 | int GENERAL_NAME_set0_othername(GENERAL_NAME *gen, | ||
229 | ASN1_OBJECT *oid, ASN1_TYPE *value) | ||
230 | { | ||
231 | OTHERNAME *oth; | ||
232 | oth = OTHERNAME_new(); | ||
233 | if (!oth) | ||
234 | return 0; | ||
235 | oth->type_id = oid; | ||
236 | oth->value = value; | ||
237 | GENERAL_NAME_set0_value(gen, GEN_OTHERNAME, oth); | ||
238 | return 1; | ||
239 | } | ||
240 | |||
241 | int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen, | ||
242 | ASN1_OBJECT **poid, ASN1_TYPE **pvalue) | ||
243 | { | ||
244 | if (gen->type != GEN_OTHERNAME) | ||
245 | return 0; | ||
246 | if (poid) | ||
247 | *poid = gen->d.otherName->type_id; | ||
248 | if (pvalue) | ||
249 | *pvalue = gen->d.otherName->value; | ||
250 | return 1; | ||
251 | } | ||
252 | |||
diff --git a/src/lib/libcrypto/x509v3/v3_lib.c b/src/lib/libcrypto/x509v3/v3_lib.c index 0f1e1d4422..df3a48f43e 100644 --- a/src/lib/libcrypto/x509v3/v3_lib.c +++ b/src/lib/libcrypto/x509v3/v3_lib.c | |||
@@ -84,24 +84,20 @@ int X509V3_EXT_add(X509V3_EXT_METHOD *ext) | |||
84 | } | 84 | } |
85 | 85 | ||
86 | static int ext_cmp(const X509V3_EXT_METHOD * const *a, | 86 | static int ext_cmp(const X509V3_EXT_METHOD * const *a, |
87 | const X509V3_EXT_METHOD * const *b) | 87 | const X509V3_EXT_METHOD * const *b) |
88 | { | 88 | { |
89 | return ((*a)->ext_nid - (*b)->ext_nid); | 89 | return ((*a)->ext_nid - (*b)->ext_nid); |
90 | } | 90 | } |
91 | 91 | ||
92 | DECLARE_OBJ_BSEARCH_CMP_FN(const X509V3_EXT_METHOD *, const X509V3_EXT_METHOD *, | 92 | X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid) |
93 | ext); | ||
94 | IMPLEMENT_OBJ_BSEARCH_CMP_FN(const X509V3_EXT_METHOD *, | ||
95 | const X509V3_EXT_METHOD *, ext); | ||
96 | |||
97 | const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid) | ||
98 | { | 93 | { |
99 | X509V3_EXT_METHOD tmp; | 94 | X509V3_EXT_METHOD tmp, *t = &tmp, **ret; |
100 | const X509V3_EXT_METHOD *t = &tmp, * const *ret; | ||
101 | int idx; | 95 | int idx; |
102 | if(nid < 0) return NULL; | 96 | if(nid < 0) return NULL; |
103 | tmp.ext_nid = nid; | 97 | tmp.ext_nid = nid; |
104 | ret = OBJ_bsearch_ext(&t, standard_exts, STANDARD_EXTENSION_COUNT); | 98 | ret = (X509V3_EXT_METHOD **) OBJ_bsearch((char *)&t, |
99 | (char *)standard_exts, STANDARD_EXTENSION_COUNT, | ||
100 | sizeof(X509V3_EXT_METHOD *), (int (*)(const void *, const void *))ext_cmp); | ||
105 | if(ret) return *ret; | 101 | if(ret) return *ret; |
106 | if(!ext_list) return NULL; | 102 | if(!ext_list) return NULL; |
107 | idx = sk_X509V3_EXT_METHOD_find(ext_list, &tmp); | 103 | idx = sk_X509V3_EXT_METHOD_find(ext_list, &tmp); |
@@ -109,7 +105,7 @@ const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid) | |||
109 | return sk_X509V3_EXT_METHOD_value(ext_list, idx); | 105 | return sk_X509V3_EXT_METHOD_value(ext_list, idx); |
110 | } | 106 | } |
111 | 107 | ||
112 | const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext) | 108 | X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext) |
113 | { | 109 | { |
114 | int nid; | 110 | int nid; |
115 | if((nid = OBJ_obj2nid(ext->object)) == NID_undef) return NULL; | 111 | if((nid = OBJ_obj2nid(ext->object)) == NID_undef) return NULL; |
@@ -126,9 +122,7 @@ int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist) | |||
126 | 122 | ||
127 | int X509V3_EXT_add_alias(int nid_to, int nid_from) | 123 | int X509V3_EXT_add_alias(int nid_to, int nid_from) |
128 | { | 124 | { |
129 | const X509V3_EXT_METHOD *ext; | 125 | X509V3_EXT_METHOD *ext, *tmpext; |
130 | X509V3_EXT_METHOD *tmpext; | ||
131 | |||
132 | if(!(ext = X509V3_EXT_get_nid(nid_from))) { | 126 | if(!(ext = X509V3_EXT_get_nid(nid_from))) { |
133 | X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS,X509V3_R_EXTENSION_NOT_FOUND); | 127 | X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS,X509V3_R_EXTENSION_NOT_FOUND); |
134 | return 0; | 128 | return 0; |
@@ -167,7 +161,7 @@ int X509V3_add_standard_extensions(void) | |||
167 | 161 | ||
168 | void *X509V3_EXT_d2i(X509_EXTENSION *ext) | 162 | void *X509V3_EXT_d2i(X509_EXTENSION *ext) |
169 | { | 163 | { |
170 | const X509V3_EXT_METHOD *method; | 164 | X509V3_EXT_METHOD *method; |
171 | const unsigned char *p; | 165 | const unsigned char *p; |
172 | 166 | ||
173 | if(!(method = X509V3_EXT_get(ext))) return NULL; | 167 | if(!(method = X509V3_EXT_get(ext))) return NULL; |
diff --git a/src/lib/libcrypto/x509v3/v3_ocsp.c b/src/lib/libcrypto/x509v3/v3_ocsp.c index 0c165af314..e426ea930c 100644 --- a/src/lib/libcrypto/x509v3/v3_ocsp.c +++ b/src/lib/libcrypto/x509v3/v3_ocsp.c | |||
@@ -68,26 +68,19 @@ | |||
68 | /* OCSP extensions and a couple of CRL entry extensions | 68 | /* OCSP extensions and a couple of CRL entry extensions |
69 | */ | 69 | */ |
70 | 70 | ||
71 | static int i2r_ocsp_crlid(const X509V3_EXT_METHOD *method, void *nonce, | 71 | static int i2r_ocsp_crlid(X509V3_EXT_METHOD *method, void *nonce, BIO *out, int indent); |
72 | BIO *out, int indent); | 72 | static int i2r_ocsp_acutoff(X509V3_EXT_METHOD *method, void *nonce, BIO *out, int indent); |
73 | static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *nonce, | 73 | static int i2r_object(X509V3_EXT_METHOD *method, void *obj, BIO *out, int indent); |
74 | BIO *out, int indent); | ||
75 | static int i2r_object(const X509V3_EXT_METHOD *method, void *obj, BIO *out, | ||
76 | int indent); | ||
77 | 74 | ||
78 | static void *ocsp_nonce_new(void); | 75 | static void *ocsp_nonce_new(void); |
79 | static int i2d_ocsp_nonce(void *a, unsigned char **pp); | 76 | static int i2d_ocsp_nonce(void *a, unsigned char **pp); |
80 | static void *d2i_ocsp_nonce(void *a, const unsigned char **pp, long length); | 77 | static void *d2i_ocsp_nonce(void *a, const unsigned char **pp, long length); |
81 | static void ocsp_nonce_free(void *a); | 78 | static void ocsp_nonce_free(void *a); |
82 | static int i2r_ocsp_nonce(const X509V3_EXT_METHOD *method, void *nonce, | 79 | static int i2r_ocsp_nonce(X509V3_EXT_METHOD *method, void *nonce, BIO *out, int indent); |
83 | BIO *out, int indent); | ||
84 | 80 | ||
85 | static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, | 81 | static int i2r_ocsp_nocheck(X509V3_EXT_METHOD *method, void *nocheck, BIO *out, int indent); |
86 | void *nocheck, BIO *out, int indent); | 82 | static void *s2i_ocsp_nocheck(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, const char *str); |
87 | static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, | 83 | static int i2r_ocsp_serviceloc(X509V3_EXT_METHOD *method, void *in, BIO *bp, int ind); |
88 | const char *str); | ||
89 | static int i2r_ocsp_serviceloc(const X509V3_EXT_METHOD *method, void *in, | ||
90 | BIO *bp, int ind); | ||
91 | 84 | ||
92 | const X509V3_EXT_METHOD v3_ocsp_crlid = { | 85 | const X509V3_EXT_METHOD v3_ocsp_crlid = { |
93 | NID_id_pkix_OCSP_CrlID, 0, ASN1_ITEM_ref(OCSP_CRLID), | 86 | NID_id_pkix_OCSP_CrlID, 0, ASN1_ITEM_ref(OCSP_CRLID), |
@@ -155,47 +148,44 @@ const X509V3_EXT_METHOD v3_ocsp_serviceloc = { | |||
155 | NULL | 148 | NULL |
156 | }; | 149 | }; |
157 | 150 | ||
158 | static int i2r_ocsp_crlid(const X509V3_EXT_METHOD *method, void *in, BIO *bp, | 151 | static int i2r_ocsp_crlid(X509V3_EXT_METHOD *method, void *in, BIO *bp, int ind) |
159 | int ind) | ||
160 | { | 152 | { |
161 | OCSP_CRLID *a = in; | 153 | OCSP_CRLID *a = in; |
162 | if (a->crlUrl) | 154 | if (a->crlUrl) |
163 | { | 155 | { |
164 | if (BIO_printf(bp, "%*scrlUrl: ", ind, "") <= 0) goto err; | 156 | if (!BIO_printf(bp, "%*scrlUrl: ", ind, "")) goto err; |
165 | if (!ASN1_STRING_print(bp, (ASN1_STRING*)a->crlUrl)) goto err; | 157 | if (!ASN1_STRING_print(bp, (ASN1_STRING*)a->crlUrl)) goto err; |
166 | if (BIO_write(bp, "\n", 1) <= 0) goto err; | 158 | if (!BIO_write(bp, "\n", 1)) goto err; |
167 | } | 159 | } |
168 | if (a->crlNum) | 160 | if (a->crlNum) |
169 | { | 161 | { |
170 | if (BIO_printf(bp, "%*scrlNum: ", ind, "") <= 0) goto err; | 162 | if (!BIO_printf(bp, "%*scrlNum: ", ind, "")) goto err; |
171 | if (i2a_ASN1_INTEGER(bp, a->crlNum) <= 0) goto err; | 163 | if (!i2a_ASN1_INTEGER(bp, a->crlNum)) goto err; |
172 | if (BIO_write(bp, "\n", 1) <= 0) goto err; | 164 | if (!BIO_write(bp, "\n", 1)) goto err; |
173 | } | 165 | } |
174 | if (a->crlTime) | 166 | if (a->crlTime) |
175 | { | 167 | { |
176 | if (BIO_printf(bp, "%*scrlTime: ", ind, "") <= 0) goto err; | 168 | if (!BIO_printf(bp, "%*scrlTime: ", ind, "")) goto err; |
177 | if (!ASN1_GENERALIZEDTIME_print(bp, a->crlTime)) goto err; | 169 | if (!ASN1_GENERALIZEDTIME_print(bp, a->crlTime)) goto err; |
178 | if (BIO_write(bp, "\n", 1) <= 0) goto err; | 170 | if (!BIO_write(bp, "\n", 1)) goto err; |
179 | } | 171 | } |
180 | return 1; | 172 | return 1; |
181 | err: | 173 | err: |
182 | return 0; | 174 | return 0; |
183 | } | 175 | } |
184 | 176 | ||
185 | static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *cutoff, | 177 | static int i2r_ocsp_acutoff(X509V3_EXT_METHOD *method, void *cutoff, BIO *bp, int ind) |
186 | BIO *bp, int ind) | ||
187 | { | 178 | { |
188 | if (BIO_printf(bp, "%*s", ind, "") <= 0) return 0; | 179 | if (!BIO_printf(bp, "%*s", ind, "")) return 0; |
189 | if(!ASN1_GENERALIZEDTIME_print(bp, cutoff)) return 0; | 180 | if(!ASN1_GENERALIZEDTIME_print(bp, cutoff)) return 0; |
190 | return 1; | 181 | return 1; |
191 | } | 182 | } |
192 | 183 | ||
193 | 184 | ||
194 | static int i2r_object(const X509V3_EXT_METHOD *method, void *oid, BIO *bp, | 185 | static int i2r_object(X509V3_EXT_METHOD *method, void *oid, BIO *bp, int ind) |
195 | int ind) | ||
196 | { | 186 | { |
197 | if (BIO_printf(bp, "%*s", ind, "") <= 0) return 0; | 187 | if (!BIO_printf(bp, "%*s", ind, "")) return 0; |
198 | if(i2a_ASN1_OBJECT(bp, oid) <= 0) return 0; | 188 | if(!i2a_ASN1_OBJECT(bp, oid)) return 0; |
199 | return 1; | 189 | return 1; |
200 | } | 190 | } |
201 | 191 | ||
@@ -242,8 +232,7 @@ static void ocsp_nonce_free(void *a) | |||
242 | M_ASN1_OCTET_STRING_free(a); | 232 | M_ASN1_OCTET_STRING_free(a); |
243 | } | 233 | } |
244 | 234 | ||
245 | static int i2r_ocsp_nonce(const X509V3_EXT_METHOD *method, void *nonce, | 235 | static int i2r_ocsp_nonce(X509V3_EXT_METHOD *method, void *nonce, BIO *out, int indent) |
246 | BIO *out, int indent) | ||
247 | { | 236 | { |
248 | if(BIO_printf(out, "%*s", indent, "") <= 0) return 0; | 237 | if(BIO_printf(out, "%*s", indent, "") <= 0) return 0; |
249 | if(i2a_ASN1_STRING(out, nonce, V_ASN1_OCTET_STRING) <= 0) return 0; | 238 | if(i2a_ASN1_STRING(out, nonce, V_ASN1_OCTET_STRING) <= 0) return 0; |
@@ -252,20 +241,17 @@ static int i2r_ocsp_nonce(const X509V3_EXT_METHOD *method, void *nonce, | |||
252 | 241 | ||
253 | /* Nocheck is just a single NULL. Don't print anything and always set it */ | 242 | /* Nocheck is just a single NULL. Don't print anything and always set it */ |
254 | 243 | ||
255 | static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, void *nocheck, | 244 | static int i2r_ocsp_nocheck(X509V3_EXT_METHOD *method, void *nocheck, BIO *out, int indent) |
256 | BIO *out, int indent) | ||
257 | { | 245 | { |
258 | return 1; | 246 | return 1; |
259 | } | 247 | } |
260 | 248 | ||
261 | static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, | 249 | static void *s2i_ocsp_nocheck(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, const char *str) |
262 | const char *str) | ||
263 | { | 250 | { |
264 | return ASN1_NULL_new(); | 251 | return ASN1_NULL_new(); |
265 | } | 252 | } |
266 | 253 | ||
267 | static int i2r_ocsp_serviceloc(const X509V3_EXT_METHOD *method, void *in, | 254 | static int i2r_ocsp_serviceloc(X509V3_EXT_METHOD *method, void *in, BIO *bp, int ind) |
268 | BIO *bp, int ind) | ||
269 | { | 255 | { |
270 | int i; | 256 | int i; |
271 | OCSP_SERVICELOC *a = in; | 257 | OCSP_SERVICELOC *a = in; |
diff --git a/src/lib/libcrypto/x509v3/v3_prn.c b/src/lib/libcrypto/x509v3/v3_prn.c index 3146218708..c1bb17f105 100644 --- a/src/lib/libcrypto/x509v3/v3_prn.c +++ b/src/lib/libcrypto/x509v3/v3_prn.c | |||
@@ -110,7 +110,7 @@ int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int inde | |||
110 | void *ext_str = NULL; | 110 | void *ext_str = NULL; |
111 | char *value = NULL; | 111 | char *value = NULL; |
112 | const unsigned char *p; | 112 | const unsigned char *p; |
113 | const X509V3_EXT_METHOD *method; | 113 | X509V3_EXT_METHOD *method; |
114 | STACK_OF(CONF_VALUE) *nval = NULL; | 114 | STACK_OF(CONF_VALUE) *nval = NULL; |
115 | int ok = 1; | 115 | int ok = 1; |
116 | 116 | ||
diff --git a/src/lib/libcrypto/x509v3/v3_purp.c b/src/lib/libcrypto/x509v3/v3_purp.c index 181bd34979..e18751e01c 100644 --- a/src/lib/libcrypto/x509v3/v3_purp.c +++ b/src/lib/libcrypto/x509v3/v3_purp.c | |||
@@ -71,7 +71,6 @@ static int purpose_smime(const X509 *x, int ca); | |||
71 | static int check_purpose_smime_sign(const X509_PURPOSE *xp, const X509 *x, int ca); | 71 | static int check_purpose_smime_sign(const X509_PURPOSE *xp, const X509 *x, int ca); |
72 | static int check_purpose_smime_encrypt(const X509_PURPOSE *xp, const X509 *x, int ca); | 72 | static int check_purpose_smime_encrypt(const X509_PURPOSE *xp, const X509 *x, int ca); |
73 | static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, int ca); | 73 | static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, int ca); |
74 | static int check_purpose_timestamp_sign(const X509_PURPOSE *xp, const X509 *x, int ca); | ||
75 | static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca); | 74 | static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca); |
76 | static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca); | 75 | static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca); |
77 | 76 | ||
@@ -88,7 +87,6 @@ static X509_PURPOSE xstandard[] = { | |||
88 | {X509_PURPOSE_CRL_SIGN, X509_TRUST_COMPAT, 0, check_purpose_crl_sign, "CRL signing", "crlsign", NULL}, | 87 | {X509_PURPOSE_CRL_SIGN, X509_TRUST_COMPAT, 0, check_purpose_crl_sign, "CRL signing", "crlsign", NULL}, |
89 | {X509_PURPOSE_ANY, X509_TRUST_DEFAULT, 0, no_check, "Any Purpose", "any", NULL}, | 88 | {X509_PURPOSE_ANY, X509_TRUST_DEFAULT, 0, no_check, "Any Purpose", "any", NULL}, |
90 | {X509_PURPOSE_OCSP_HELPER, X509_TRUST_COMPAT, 0, ocsp_helper, "OCSP helper", "ocsphelper", NULL}, | 89 | {X509_PURPOSE_OCSP_HELPER, X509_TRUST_COMPAT, 0, ocsp_helper, "OCSP helper", "ocsphelper", NULL}, |
91 | {X509_PURPOSE_TIMESTAMP_SIGN, X509_TRUST_TSA, 0, check_purpose_timestamp_sign, "Time Stamp signing", "timestampsign", NULL}, | ||
92 | }; | 90 | }; |
93 | 91 | ||
94 | #define X509_PURPOSE_COUNT (sizeof(xstandard)/sizeof(X509_PURPOSE)) | 92 | #define X509_PURPOSE_COUNT (sizeof(xstandard)/sizeof(X509_PURPOSE)) |
@@ -267,14 +265,11 @@ int X509_PURPOSE_get_trust(X509_PURPOSE *xp) | |||
267 | return xp->trust; | 265 | return xp->trust; |
268 | } | 266 | } |
269 | 267 | ||
270 | static int nid_cmp(const int *a, const int *b) | 268 | static int nid_cmp(int *a, int *b) |
271 | { | 269 | { |
272 | return *a - *b; | 270 | return *a - *b; |
273 | } | 271 | } |
274 | 272 | ||
275 | DECLARE_OBJ_BSEARCH_CMP_FN(int, int, nid); | ||
276 | IMPLEMENT_OBJ_BSEARCH_CMP_FN(int, int, nid); | ||
277 | |||
278 | int X509_supported_extension(X509_EXTENSION *ex) | 273 | int X509_supported_extension(X509_EXTENSION *ex) |
279 | { | 274 | { |
280 | /* This table is a list of the NIDs of supported extensions: | 275 | /* This table is a list of the NIDs of supported extensions: |
@@ -285,7 +280,7 @@ int X509_supported_extension(X509_EXTENSION *ex) | |||
285 | * searched using bsearch. | 280 | * searched using bsearch. |
286 | */ | 281 | */ |
287 | 282 | ||
288 | static const int supported_nids[] = { | 283 | static int supported_nids[] = { |
289 | NID_netscape_cert_type, /* 71 */ | 284 | NID_netscape_cert_type, /* 71 */ |
290 | NID_key_usage, /* 83 */ | 285 | NID_key_usage, /* 83 */ |
291 | NID_subject_alt_name, /* 85 */ | 286 | NID_subject_alt_name, /* 85 */ |
@@ -297,62 +292,24 @@ int X509_supported_extension(X509_EXTENSION *ex) | |||
297 | NID_sbgp_autonomousSysNum, /* 291 */ | 292 | NID_sbgp_autonomousSysNum, /* 291 */ |
298 | #endif | 293 | #endif |
299 | NID_policy_constraints, /* 401 */ | 294 | NID_policy_constraints, /* 401 */ |
300 | NID_proxyCertInfo, /* 663 */ | 295 | NID_proxyCertInfo, /* 661 */ |
301 | NID_name_constraints, /* 666 */ | ||
302 | NID_policy_mappings, /* 747 */ | ||
303 | NID_inhibit_any_policy /* 748 */ | 296 | NID_inhibit_any_policy /* 748 */ |
304 | }; | 297 | }; |
305 | 298 | ||
306 | int ex_nid = OBJ_obj2nid(X509_EXTENSION_get_object(ex)); | 299 | int ex_nid; |
300 | |||
301 | ex_nid = OBJ_obj2nid(X509_EXTENSION_get_object(ex)); | ||
307 | 302 | ||
308 | if (ex_nid == NID_undef) | 303 | if (ex_nid == NID_undef) |
309 | return 0; | 304 | return 0; |
310 | 305 | ||
311 | if (OBJ_bsearch_nid(&ex_nid, supported_nids, | 306 | if (OBJ_bsearch((char *)&ex_nid, (char *)supported_nids, |
312 | sizeof(supported_nids)/sizeof(int))) | 307 | sizeof(supported_nids)/sizeof(int), sizeof(int), |
308 | (int (*)(const void *, const void *))nid_cmp)) | ||
313 | return 1; | 309 | return 1; |
314 | return 0; | 310 | return 0; |
315 | } | 311 | } |
316 | 312 | ||
317 | static void setup_dp(X509 *x, DIST_POINT *dp) | ||
318 | { | ||
319 | X509_NAME *iname = NULL; | ||
320 | int i; | ||
321 | if (dp->reasons) | ||
322 | { | ||
323 | if (dp->reasons->length > 0) | ||
324 | dp->dp_reasons = dp->reasons->data[0]; | ||
325 | if (dp->reasons->length > 1) | ||
326 | dp->dp_reasons |= (dp->reasons->data[1] << 8); | ||
327 | dp->dp_reasons &= CRLDP_ALL_REASONS; | ||
328 | } | ||
329 | else | ||
330 | dp->dp_reasons = CRLDP_ALL_REASONS; | ||
331 | if (!dp->distpoint || (dp->distpoint->type != 1)) | ||
332 | return; | ||
333 | for (i = 0; i < sk_GENERAL_NAME_num(dp->CRLissuer); i++) | ||
334 | { | ||
335 | GENERAL_NAME *gen = sk_GENERAL_NAME_value(dp->CRLissuer, i); | ||
336 | if (gen->type == GEN_DIRNAME) | ||
337 | { | ||
338 | iname = gen->d.directoryName; | ||
339 | break; | ||
340 | } | ||
341 | } | ||
342 | if (!iname) | ||
343 | iname = X509_get_issuer_name(x); | ||
344 | |||
345 | DIST_POINT_set_dpname(dp->distpoint, iname); | ||
346 | |||
347 | } | ||
348 | |||
349 | static void setup_crldp(X509 *x) | ||
350 | { | ||
351 | int i; | ||
352 | x->crldp = X509_get_ext_d2i(x, NID_crl_distribution_points, NULL, NULL); | ||
353 | for (i = 0; i < sk_DIST_POINT_num(x->crldp); i++) | ||
354 | setup_dp(x, sk_DIST_POINT_value(x->crldp, i)); | ||
355 | } | ||
356 | 313 | ||
357 | static void x509v3_cache_extensions(X509 *x) | 314 | static void x509v3_cache_extensions(X509 *x) |
358 | { | 315 | { |
@@ -460,25 +417,16 @@ static void x509v3_cache_extensions(X509 *x) | |||
460 | } | 417 | } |
461 | x->skid =X509_get_ext_d2i(x, NID_subject_key_identifier, NULL, NULL); | 418 | x->skid =X509_get_ext_d2i(x, NID_subject_key_identifier, NULL, NULL); |
462 | x->akid =X509_get_ext_d2i(x, NID_authority_key_identifier, NULL, NULL); | 419 | x->akid =X509_get_ext_d2i(x, NID_authority_key_identifier, NULL, NULL); |
463 | x->altname = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); | ||
464 | x->nc = X509_get_ext_d2i(x, NID_name_constraints, &i, NULL); | ||
465 | if (!x->nc && (i != -1)) | ||
466 | x->ex_flags |= EXFLAG_INVALID; | ||
467 | setup_crldp(x); | ||
468 | |||
469 | #ifndef OPENSSL_NO_RFC3779 | 420 | #ifndef OPENSSL_NO_RFC3779 |
470 | x->rfc3779_addr =X509_get_ext_d2i(x, NID_sbgp_ipAddrBlock, NULL, NULL); | 421 | x->rfc3779_addr =X509_get_ext_d2i(x, NID_sbgp_ipAddrBlock, NULL, NULL); |
471 | x->rfc3779_asid =X509_get_ext_d2i(x, NID_sbgp_autonomousSysNum, | 422 | x->rfc3779_asid =X509_get_ext_d2i(x, NID_sbgp_autonomousSysNum, |
472 | NULL, NULL); | 423 | NULL, NULL); |
473 | #endif | 424 | #endif |
474 | for (i = 0; i < X509_get_ext_count(x); i++) | 425 | for (i = 0; i < X509_get_ext_count(x); i++) |
475 | { | 426 | { |
476 | ex = X509_get_ext(x, i); | 427 | ex = X509_get_ext(x, i); |
477 | if (!X509_EXTENSION_get_critical(ex)) | 428 | if (!X509_EXTENSION_get_critical(ex)) |
478 | continue; | 429 | continue; |
479 | if (OBJ_obj2nid(X509_EXTENSION_get_object(ex)) | ||
480 | == NID_freshest_crl) | ||
481 | x->ex_flags |= EXFLAG_FRESHEST; | ||
482 | if (!X509_supported_extension(ex)) | 430 | if (!X509_supported_extension(ex)) |
483 | { | 431 | { |
484 | x->ex_flags |= EXFLAG_CRITICAL; | 432 | x->ex_flags |= EXFLAG_CRITICAL; |
@@ -646,41 +594,6 @@ static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca) | |||
646 | return 1; | 594 | return 1; |
647 | } | 595 | } |
648 | 596 | ||
649 | static int check_purpose_timestamp_sign(const X509_PURPOSE *xp, const X509 *x, | ||
650 | int ca) | ||
651 | { | ||
652 | int i_ext; | ||
653 | |||
654 | /* If ca is true we must return if this is a valid CA certificate. */ | ||
655 | if (ca) return check_ca(x); | ||
656 | |||
657 | /* | ||
658 | * Check the optional key usage field: | ||
659 | * if Key Usage is present, it must be one of digitalSignature | ||
660 | * and/or nonRepudiation (other values are not consistent and shall | ||
661 | * be rejected). | ||
662 | */ | ||
663 | if ((x->ex_flags & EXFLAG_KUSAGE) | ||
664 | && ((x->ex_kusage & ~(KU_NON_REPUDIATION | KU_DIGITAL_SIGNATURE)) || | ||
665 | !(x->ex_kusage & (KU_NON_REPUDIATION | KU_DIGITAL_SIGNATURE)))) | ||
666 | return 0; | ||
667 | |||
668 | /* Only time stamp key usage is permitted and it's required. */ | ||
669 | if (!(x->ex_flags & EXFLAG_XKUSAGE) || x->ex_xkusage != XKU_TIMESTAMP) | ||
670 | return 0; | ||
671 | |||
672 | /* Extended Key Usage MUST be critical */ | ||
673 | i_ext = X509_get_ext_by_NID((X509 *) x, NID_ext_key_usage, 0); | ||
674 | if (i_ext >= 0) | ||
675 | { | ||
676 | X509_EXTENSION *ext = X509_get_ext((X509 *) x, i_ext); | ||
677 | if (!X509_EXTENSION_get_critical(ext)) | ||
678 | return 0; | ||
679 | } | ||
680 | |||
681 | return 1; | ||
682 | } | ||
683 | |||
684 | static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca) | 597 | static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca) |
685 | { | 598 | { |
686 | return 1; | 599 | return 1; |
@@ -705,14 +618,39 @@ int X509_check_issued(X509 *issuer, X509 *subject) | |||
705 | return X509_V_ERR_SUBJECT_ISSUER_MISMATCH; | 618 | return X509_V_ERR_SUBJECT_ISSUER_MISMATCH; |
706 | x509v3_cache_extensions(issuer); | 619 | x509v3_cache_extensions(issuer); |
707 | x509v3_cache_extensions(subject); | 620 | x509v3_cache_extensions(subject); |
708 | 621 | if(subject->akid) { | |
709 | if(subject->akid) | 622 | /* Check key ids (if present) */ |
710 | { | 623 | if(subject->akid->keyid && issuer->skid && |
711 | int ret = X509_check_akid(issuer, subject->akid); | 624 | ASN1_OCTET_STRING_cmp(subject->akid->keyid, issuer->skid) ) |
712 | if (ret != X509_V_OK) | 625 | return X509_V_ERR_AKID_SKID_MISMATCH; |
713 | return ret; | 626 | /* Check serial number */ |
627 | if(subject->akid->serial && | ||
628 | ASN1_INTEGER_cmp(X509_get_serialNumber(issuer), | ||
629 | subject->akid->serial)) | ||
630 | return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; | ||
631 | /* Check issuer name */ | ||
632 | if(subject->akid->issuer) { | ||
633 | /* Ugh, for some peculiar reason AKID includes | ||
634 | * SEQUENCE OF GeneralName. So look for a DirName. | ||
635 | * There may be more than one but we only take any | ||
636 | * notice of the first. | ||
637 | */ | ||
638 | GENERAL_NAMES *gens; | ||
639 | GENERAL_NAME *gen; | ||
640 | X509_NAME *nm = NULL; | ||
641 | int i; | ||
642 | gens = subject->akid->issuer; | ||
643 | for(i = 0; i < sk_GENERAL_NAME_num(gens); i++) { | ||
644 | gen = sk_GENERAL_NAME_value(gens, i); | ||
645 | if(gen->type == GEN_DIRNAME) { | ||
646 | nm = gen->d.dirn; | ||
647 | break; | ||
648 | } | ||
649 | } | ||
650 | if(nm && X509_NAME_cmp(nm, X509_get_issuer_name(issuer))) | ||
651 | return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; | ||
714 | } | 652 | } |
715 | 653 | } | |
716 | if(subject->ex_flags & EXFLAG_PROXY) | 654 | if(subject->ex_flags & EXFLAG_PROXY) |
717 | { | 655 | { |
718 | if(ku_reject(issuer, KU_DIGITAL_SIGNATURE)) | 656 | if(ku_reject(issuer, KU_DIGITAL_SIGNATURE)) |
@@ -723,45 +661,3 @@ int X509_check_issued(X509 *issuer, X509 *subject) | |||
723 | return X509_V_OK; | 661 | return X509_V_OK; |
724 | } | 662 | } |
725 | 663 | ||
726 | int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid) | ||
727 | { | ||
728 | |||
729 | if(!akid) | ||
730 | return X509_V_OK; | ||
731 | |||
732 | /* Check key ids (if present) */ | ||
733 | if(akid->keyid && issuer->skid && | ||
734 | ASN1_OCTET_STRING_cmp(akid->keyid, issuer->skid) ) | ||
735 | return X509_V_ERR_AKID_SKID_MISMATCH; | ||
736 | /* Check serial number */ | ||
737 | if(akid->serial && | ||
738 | ASN1_INTEGER_cmp(X509_get_serialNumber(issuer), akid->serial)) | ||
739 | return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; | ||
740 | /* Check issuer name */ | ||
741 | if(akid->issuer) | ||
742 | { | ||
743 | /* Ugh, for some peculiar reason AKID includes | ||
744 | * SEQUENCE OF GeneralName. So look for a DirName. | ||
745 | * There may be more than one but we only take any | ||
746 | * notice of the first. | ||
747 | */ | ||
748 | GENERAL_NAMES *gens; | ||
749 | GENERAL_NAME *gen; | ||
750 | X509_NAME *nm = NULL; | ||
751 | int i; | ||
752 | gens = akid->issuer; | ||
753 | for(i = 0; i < sk_GENERAL_NAME_num(gens); i++) | ||
754 | { | ||
755 | gen = sk_GENERAL_NAME_value(gens, i); | ||
756 | if(gen->type == GEN_DIRNAME) | ||
757 | { | ||
758 | nm = gen->d.dirn; | ||
759 | break; | ||
760 | } | ||
761 | } | ||
762 | if(nm && X509_NAME_cmp(nm, X509_get_issuer_name(issuer))) | ||
763 | return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; | ||
764 | } | ||
765 | return X509_V_OK; | ||
766 | } | ||
767 | |||
diff --git a/src/lib/libcrypto/x509v3/v3_utl.c b/src/lib/libcrypto/x509v3/v3_utl.c index e030234540..2cb53008e3 100644 --- a/src/lib/libcrypto/x509v3/v3_utl.c +++ b/src/lib/libcrypto/x509v3/v3_utl.c | |||
@@ -67,9 +67,9 @@ | |||
67 | 67 | ||
68 | static char *strip_spaces(char *name); | 68 | static char *strip_spaces(char *name); |
69 | static int sk_strcmp(const char * const *a, const char * const *b); | 69 | static int sk_strcmp(const char * const *a, const char * const *b); |
70 | static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens); | 70 | static STACK *get_email(X509_NAME *name, GENERAL_NAMES *gens); |
71 | static void str_free(OPENSSL_STRING str); | 71 | static void str_free(void *str); |
72 | static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email); | 72 | static int append_ia5(STACK **sk, ASN1_IA5STRING *email); |
73 | 73 | ||
74 | static int ipv4_from_asc(unsigned char *v4, const char *in); | 74 | static int ipv4_from_asc(unsigned char *v4, const char *in); |
75 | static int ipv6_from_asc(unsigned char *v6, const char *in); | 75 | static int ipv6_from_asc(unsigned char *v6, const char *in); |
@@ -344,7 +344,7 @@ static char *strip_spaces(char *name) | |||
344 | char *p, *q; | 344 | char *p, *q; |
345 | /* Skip over leading spaces */ | 345 | /* Skip over leading spaces */ |
346 | p = name; | 346 | p = name; |
347 | while(*p && isspace((unsigned char)*p)) p++; | 347 | while(isspace((unsigned char)*p)) p++; |
348 | if(!*p) return NULL; | 348 | if(!*p) return NULL; |
349 | q = p + strlen(p) - 1; | 349 | q = p + strlen(p) - 1; |
350 | while((q != p) && isspace((unsigned char)*q)) q--; | 350 | while((q != p) && isspace((unsigned char)*q)) q--; |
@@ -360,10 +360,10 @@ static char *strip_spaces(char *name) | |||
360 | * @@@ (Contents of buffer are always kept in ASCII, also on EBCDIC machines) | 360 | * @@@ (Contents of buffer are always kept in ASCII, also on EBCDIC machines) |
361 | */ | 361 | */ |
362 | 362 | ||
363 | char *hex_to_string(const unsigned char *buffer, long len) | 363 | char *hex_to_string(unsigned char *buffer, long len) |
364 | { | 364 | { |
365 | char *tmp, *q; | 365 | char *tmp, *q; |
366 | const unsigned char *p; | 366 | unsigned char *p; |
367 | int i; | 367 | int i; |
368 | const static char hexdig[] = "0123456789ABCDEF"; | 368 | const static char hexdig[] = "0123456789ABCDEF"; |
369 | if(!buffer || !len) return NULL; | 369 | if(!buffer || !len) return NULL; |
@@ -389,7 +389,7 @@ char *hex_to_string(const unsigned char *buffer, long len) | |||
389 | * a buffer | 389 | * a buffer |
390 | */ | 390 | */ |
391 | 391 | ||
392 | unsigned char *string_to_hex(const char *str, long *len) | 392 | unsigned char *string_to_hex(char *str, long *len) |
393 | { | 393 | { |
394 | unsigned char *hexbuf, *q; | 394 | unsigned char *hexbuf, *q; |
395 | unsigned char ch, cl, *p; | 395 | unsigned char ch, cl, *p; |
@@ -463,23 +463,21 @@ static int sk_strcmp(const char * const *a, const char * const *b) | |||
463 | return strcmp(*a, *b); | 463 | return strcmp(*a, *b); |
464 | } | 464 | } |
465 | 465 | ||
466 | STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x) | 466 | STACK *X509_get1_email(X509 *x) |
467 | { | 467 | { |
468 | GENERAL_NAMES *gens; | 468 | GENERAL_NAMES *gens; |
469 | STACK_OF(OPENSSL_STRING) *ret; | 469 | STACK *ret; |
470 | |||
471 | gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); | 470 | gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); |
472 | ret = get_email(X509_get_subject_name(x), gens); | 471 | ret = get_email(X509_get_subject_name(x), gens); |
473 | sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); | 472 | sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free); |
474 | return ret; | 473 | return ret; |
475 | } | 474 | } |
476 | 475 | ||
477 | STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x) | 476 | STACK *X509_get1_ocsp(X509 *x) |
478 | { | 477 | { |
479 | AUTHORITY_INFO_ACCESS *info; | 478 | AUTHORITY_INFO_ACCESS *info; |
480 | STACK_OF(OPENSSL_STRING) *ret = NULL; | 479 | STACK *ret = NULL; |
481 | int i; | 480 | int i; |
482 | |||
483 | info = X509_get_ext_d2i(x, NID_info_access, NULL, NULL); | 481 | info = X509_get_ext_d2i(x, NID_info_access, NULL, NULL); |
484 | if (!info) | 482 | if (!info) |
485 | return NULL; | 483 | return NULL; |
@@ -499,12 +497,11 @@ STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x) | |||
499 | return ret; | 497 | return ret; |
500 | } | 498 | } |
501 | 499 | ||
502 | STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x) | 500 | STACK *X509_REQ_get1_email(X509_REQ *x) |
503 | { | 501 | { |
504 | GENERAL_NAMES *gens; | 502 | GENERAL_NAMES *gens; |
505 | STACK_OF(X509_EXTENSION) *exts; | 503 | STACK_OF(X509_EXTENSION) *exts; |
506 | STACK_OF(OPENSSL_STRING) *ret; | 504 | STACK *ret; |
507 | |||
508 | exts = X509_REQ_get_extensions(x); | 505 | exts = X509_REQ_get_extensions(x); |
509 | gens = X509V3_get_d2i(exts, NID_subject_alt_name, NULL, NULL); | 506 | gens = X509V3_get_d2i(exts, NID_subject_alt_name, NULL, NULL); |
510 | ret = get_email(X509_REQ_get_subject_name(x), gens); | 507 | ret = get_email(X509_REQ_get_subject_name(x), gens); |
@@ -514,9 +511,9 @@ STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x) | |||
514 | } | 511 | } |
515 | 512 | ||
516 | 513 | ||
517 | static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens) | 514 | static STACK *get_email(X509_NAME *name, GENERAL_NAMES *gens) |
518 | { | 515 | { |
519 | STACK_OF(OPENSSL_STRING) *ret = NULL; | 516 | STACK *ret = NULL; |
520 | X509_NAME_ENTRY *ne; | 517 | X509_NAME_ENTRY *ne; |
521 | ASN1_IA5STRING *email; | 518 | ASN1_IA5STRING *email; |
522 | GENERAL_NAME *gen; | 519 | GENERAL_NAME *gen; |
@@ -539,23 +536,23 @@ static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens) | |||
539 | return ret; | 536 | return ret; |
540 | } | 537 | } |
541 | 538 | ||
542 | static void str_free(OPENSSL_STRING str) | 539 | static void str_free(void *str) |
543 | { | 540 | { |
544 | OPENSSL_free(str); | 541 | OPENSSL_free(str); |
545 | } | 542 | } |
546 | 543 | ||
547 | static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email) | 544 | static int append_ia5(STACK **sk, ASN1_IA5STRING *email) |
548 | { | 545 | { |
549 | char *emtmp; | 546 | char *emtmp; |
550 | /* First some sanity checks */ | 547 | /* First some sanity checks */ |
551 | if(email->type != V_ASN1_IA5STRING) return 1; | 548 | if(email->type != V_ASN1_IA5STRING) return 1; |
552 | if(!email->data || !email->length) return 1; | 549 | if(!email->data || !email->length) return 1; |
553 | if(!*sk) *sk = sk_OPENSSL_STRING_new(sk_strcmp); | 550 | if(!*sk) *sk = sk_new(sk_strcmp); |
554 | if(!*sk) return 0; | 551 | if(!*sk) return 0; |
555 | /* Don't add duplicates */ | 552 | /* Don't add duplicates */ |
556 | if(sk_OPENSSL_STRING_find(*sk, (char *)email->data) != -1) return 1; | 553 | if(sk_find(*sk, (char *)email->data) != -1) return 1; |
557 | emtmp = BUF_strdup((char *)email->data); | 554 | emtmp = BUF_strdup((char *)email->data); |
558 | if(!emtmp || !sk_OPENSSL_STRING_push(*sk, emtmp)) { | 555 | if(!emtmp || !sk_push(*sk, emtmp)) { |
559 | X509_email_free(*sk); | 556 | X509_email_free(*sk); |
560 | *sk = NULL; | 557 | *sk = NULL; |
561 | return 0; | 558 | return 0; |
@@ -563,9 +560,9 @@ static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email) | |||
563 | return 1; | 560 | return 1; |
564 | } | 561 | } |
565 | 562 | ||
566 | void X509_email_free(STACK_OF(OPENSSL_STRING) *sk) | 563 | void X509_email_free(STACK *sk) |
567 | { | 564 | { |
568 | sk_OPENSSL_STRING_pop_free(sk, str_free); | 565 | sk_pop_free(sk, str_free); |
569 | } | 566 | } |
570 | 567 | ||
571 | /* Convert IP addresses both IPv4 and IPv6 into an | 568 | /* Convert IP addresses both IPv4 and IPv6 into an |
diff --git a/src/lib/libcrypto/x509v3/v3conf.c b/src/lib/libcrypto/x509v3/v3conf.c new file mode 100644 index 0000000000..a9e6ca3542 --- /dev/null +++ b/src/lib/libcrypto/x509v3/v3conf.c | |||
@@ -0,0 +1,127 @@ | |||
1 | /* v3conf.c */ | ||
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | ||
3 | * project 1999. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | |||
60 | #include <stdio.h> | ||
61 | #include "cryptlib.h" | ||
62 | #include <openssl/asn1.h> | ||
63 | #include <openssl/conf.h> | ||
64 | #include <openssl/x509.h> | ||
65 | #include <openssl/x509v3.h> | ||
66 | |||
67 | /* Test application to add extensions from a config file */ | ||
68 | |||
69 | int main(int argc, char **argv) | ||
70 | { | ||
71 | LHASH *conf; | ||
72 | X509 *cert; | ||
73 | FILE *inf; | ||
74 | char *conf_file; | ||
75 | int i; | ||
76 | int count; | ||
77 | X509_EXTENSION *ext; | ||
78 | X509V3_add_standard_extensions(); | ||
79 | ERR_load_crypto_strings(); | ||
80 | if(!argv[1]) { | ||
81 | fprintf(stderr, "Usage: v3conf cert.pem [file.cnf]\n"); | ||
82 | exit(1); | ||
83 | } | ||
84 | conf_file = argv[2]; | ||
85 | if(!conf_file) conf_file = "test.cnf"; | ||
86 | conf = CONF_load(NULL, "test.cnf", NULL); | ||
87 | if(!conf) { | ||
88 | fprintf(stderr, "Error opening Config file %s\n", conf_file); | ||
89 | ERR_print_errors_fp(stderr); | ||
90 | exit(1); | ||
91 | } | ||
92 | |||
93 | inf = fopen(argv[1], "r"); | ||
94 | if(!inf) { | ||
95 | fprintf(stderr, "Can't open certificate file %s\n", argv[1]); | ||
96 | exit(1); | ||
97 | } | ||
98 | cert = PEM_read_X509(inf, NULL, NULL); | ||
99 | if(!cert) { | ||
100 | fprintf(stderr, "Error reading certificate file %s\n", argv[1]); | ||
101 | exit(1); | ||
102 | } | ||
103 | fclose(inf); | ||
104 | |||
105 | sk_pop_free(cert->cert_info->extensions, X509_EXTENSION_free); | ||
106 | cert->cert_info->extensions = NULL; | ||
107 | |||
108 | if(!X509V3_EXT_add_conf(conf, NULL, "test_section", cert)) { | ||
109 | fprintf(stderr, "Error adding extensions\n"); | ||
110 | ERR_print_errors_fp(stderr); | ||
111 | exit(1); | ||
112 | } | ||
113 | |||
114 | count = X509_get_ext_count(cert); | ||
115 | printf("%d extensions\n", count); | ||
116 | for(i = 0; i < count; i++) { | ||
117 | ext = X509_get_ext(cert, i); | ||
118 | printf("%s", OBJ_nid2ln(OBJ_obj2nid(ext->object))); | ||
119 | if(ext->critical) printf(",critical:\n"); | ||
120 | else printf(":\n"); | ||
121 | X509V3_EXT_print_fp(stdout, ext, 0, 0); | ||
122 | printf("\n"); | ||
123 | |||
124 | } | ||
125 | return 0; | ||
126 | } | ||
127 | |||
diff --git a/src/lib/libcrypto/x509v3/v3err.c b/src/lib/libcrypto/x509v3/v3err.c index f9f6f1f91f..d538ad8b80 100644 --- a/src/lib/libcrypto/x509v3/v3err.c +++ b/src/lib/libcrypto/x509v3/v3err.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* crypto/x509v3/v3err.c */ | 1 | /* crypto/x509v3/v3err.c */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
@@ -70,7 +70,6 @@ | |||
70 | 70 | ||
71 | static ERR_STRING_DATA X509V3_str_functs[]= | 71 | static ERR_STRING_DATA X509V3_str_functs[]= |
72 | { | 72 | { |
73 | {ERR_FUNC(X509V3_F_A2I_GENERAL_NAME), "A2I_GENERAL_NAME"}, | ||
74 | {ERR_FUNC(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE), "ASIDENTIFIERCHOICE_CANONIZE"}, | 73 | {ERR_FUNC(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE), "ASIDENTIFIERCHOICE_CANONIZE"}, |
75 | {ERR_FUNC(X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL), "ASIDENTIFIERCHOICE_IS_CANONICAL"}, | 74 | {ERR_FUNC(X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL), "ASIDENTIFIERCHOICE_IS_CANONICAL"}, |
76 | {ERR_FUNC(X509V3_F_COPY_EMAIL), "COPY_EMAIL"}, | 75 | {ERR_FUNC(X509V3_F_COPY_EMAIL), "COPY_EMAIL"}, |
@@ -80,7 +79,6 @@ static ERR_STRING_DATA X509V3_str_functs[]= | |||
80 | {ERR_FUNC(X509V3_F_DO_EXT_I2D), "DO_EXT_I2D"}, | 79 | {ERR_FUNC(X509V3_F_DO_EXT_I2D), "DO_EXT_I2D"}, |
81 | {ERR_FUNC(X509V3_F_DO_EXT_NCONF), "DO_EXT_NCONF"}, | 80 | {ERR_FUNC(X509V3_F_DO_EXT_NCONF), "DO_EXT_NCONF"}, |
82 | {ERR_FUNC(X509V3_F_DO_I2V_NAME_CONSTRAINTS), "DO_I2V_NAME_CONSTRAINTS"}, | 81 | {ERR_FUNC(X509V3_F_DO_I2V_NAME_CONSTRAINTS), "DO_I2V_NAME_CONSTRAINTS"}, |
83 | {ERR_FUNC(X509V3_F_GNAMES_FROM_SECTNAME), "GNAMES_FROM_SECTNAME"}, | ||
84 | {ERR_FUNC(X509V3_F_HEX_TO_STRING), "hex_to_string"}, | 82 | {ERR_FUNC(X509V3_F_HEX_TO_STRING), "hex_to_string"}, |
85 | {ERR_FUNC(X509V3_F_I2S_ASN1_ENUMERATED), "i2s_ASN1_ENUMERATED"}, | 83 | {ERR_FUNC(X509V3_F_I2S_ASN1_ENUMERATED), "i2s_ASN1_ENUMERATED"}, |
86 | {ERR_FUNC(X509V3_F_I2S_ASN1_IA5STRING), "I2S_ASN1_IA5STRING"}, | 84 | {ERR_FUNC(X509V3_F_I2S_ASN1_IA5STRING), "I2S_ASN1_IA5STRING"}, |
@@ -97,7 +95,6 @@ static ERR_STRING_DATA X509V3_str_functs[]= | |||
97 | {ERR_FUNC(X509V3_F_S2I_ASN1_OCTET_STRING), "s2i_ASN1_OCTET_STRING"}, | 95 | {ERR_FUNC(X509V3_F_S2I_ASN1_OCTET_STRING), "s2i_ASN1_OCTET_STRING"}, |
98 | {ERR_FUNC(X509V3_F_S2I_ASN1_SKEY_ID), "S2I_ASN1_SKEY_ID"}, | 96 | {ERR_FUNC(X509V3_F_S2I_ASN1_SKEY_ID), "S2I_ASN1_SKEY_ID"}, |
99 | {ERR_FUNC(X509V3_F_S2I_SKEY_ID), "S2I_SKEY_ID"}, | 97 | {ERR_FUNC(X509V3_F_S2I_SKEY_ID), "S2I_SKEY_ID"}, |
100 | {ERR_FUNC(X509V3_F_SET_DIST_POINT_NAME), "SET_DIST_POINT_NAME"}, | ||
101 | {ERR_FUNC(X509V3_F_STRING_TO_HEX), "string_to_hex"}, | 98 | {ERR_FUNC(X509V3_F_STRING_TO_HEX), "string_to_hex"}, |
102 | {ERR_FUNC(X509V3_F_SXNET_ADD_ID_ASC), "SXNET_add_id_asc"}, | 99 | {ERR_FUNC(X509V3_F_SXNET_ADD_ID_ASC), "SXNET_add_id_asc"}, |
103 | {ERR_FUNC(X509V3_F_SXNET_ADD_ID_INTEGER), "SXNET_add_id_INTEGER"}, | 100 | {ERR_FUNC(X509V3_F_SXNET_ADD_ID_INTEGER), "SXNET_add_id_INTEGER"}, |
@@ -113,7 +110,6 @@ static ERR_STRING_DATA X509V3_str_functs[]= | |||
113 | {ERR_FUNC(X509V3_F_V2I_EXTENDED_KEY_USAGE), "V2I_EXTENDED_KEY_USAGE"}, | 110 | {ERR_FUNC(X509V3_F_V2I_EXTENDED_KEY_USAGE), "V2I_EXTENDED_KEY_USAGE"}, |
114 | {ERR_FUNC(X509V3_F_V2I_GENERAL_NAMES), "v2i_GENERAL_NAMES"}, | 111 | {ERR_FUNC(X509V3_F_V2I_GENERAL_NAMES), "v2i_GENERAL_NAMES"}, |
115 | {ERR_FUNC(X509V3_F_V2I_GENERAL_NAME_EX), "v2i_GENERAL_NAME_ex"}, | 112 | {ERR_FUNC(X509V3_F_V2I_GENERAL_NAME_EX), "v2i_GENERAL_NAME_ex"}, |
116 | {ERR_FUNC(X509V3_F_V2I_IDP), "V2I_IDP"}, | ||
117 | {ERR_FUNC(X509V3_F_V2I_IPADDRBLOCKS), "V2I_IPADDRBLOCKS"}, | 113 | {ERR_FUNC(X509V3_F_V2I_IPADDRBLOCKS), "V2I_IPADDRBLOCKS"}, |
118 | {ERR_FUNC(X509V3_F_V2I_ISSUER_ALT), "V2I_ISSUER_ALT"}, | 114 | {ERR_FUNC(X509V3_F_V2I_ISSUER_ALT), "V2I_ISSUER_ALT"}, |
119 | {ERR_FUNC(X509V3_F_V2I_NAME_CONSTRAINTS), "V2I_NAME_CONSTRAINTS"}, | 115 | {ERR_FUNC(X509V3_F_V2I_NAME_CONSTRAINTS), "V2I_NAME_CONSTRAINTS"}, |
@@ -145,7 +141,6 @@ static ERR_STRING_DATA X509V3_str_reasons[]= | |||
145 | {ERR_REASON(X509V3_R_BN_DEC2BN_ERROR) ,"bn dec2bn error"}, | 141 | {ERR_REASON(X509V3_R_BN_DEC2BN_ERROR) ,"bn dec2bn error"}, |
146 | {ERR_REASON(X509V3_R_BN_TO_ASN1_INTEGER_ERROR),"bn to asn1 integer error"}, | 142 | {ERR_REASON(X509V3_R_BN_TO_ASN1_INTEGER_ERROR),"bn to asn1 integer error"}, |
147 | {ERR_REASON(X509V3_R_DIRNAME_ERROR) ,"dirname error"}, | 143 | {ERR_REASON(X509V3_R_DIRNAME_ERROR) ,"dirname error"}, |
148 | {ERR_REASON(X509V3_R_DISTPOINT_ALREADY_SET),"distpoint already set"}, | ||
149 | {ERR_REASON(X509V3_R_DUPLICATE_ZONE_ID) ,"duplicate zone id"}, | 144 | {ERR_REASON(X509V3_R_DUPLICATE_ZONE_ID) ,"duplicate zone id"}, |
150 | {ERR_REASON(X509V3_R_ERROR_CONVERTING_ZONE),"error converting zone"}, | 145 | {ERR_REASON(X509V3_R_ERROR_CONVERTING_ZONE),"error converting zone"}, |
151 | {ERR_REASON(X509V3_R_ERROR_CREATING_EXTENSION),"error creating extension"}, | 146 | {ERR_REASON(X509V3_R_ERROR_CREATING_EXTENSION),"error creating extension"}, |
@@ -159,7 +154,6 @@ static ERR_STRING_DATA X509V3_str_reasons[]= | |||
159 | {ERR_REASON(X509V3_R_ILLEGAL_EMPTY_EXTENSION),"illegal empty extension"}, | 154 | {ERR_REASON(X509V3_R_ILLEGAL_EMPTY_EXTENSION),"illegal empty extension"}, |
160 | {ERR_REASON(X509V3_R_ILLEGAL_HEX_DIGIT) ,"illegal hex digit"}, | 155 | {ERR_REASON(X509V3_R_ILLEGAL_HEX_DIGIT) ,"illegal hex digit"}, |
161 | {ERR_REASON(X509V3_R_INCORRECT_POLICY_SYNTAX_TAG),"incorrect policy syntax tag"}, | 156 | {ERR_REASON(X509V3_R_INCORRECT_POLICY_SYNTAX_TAG),"incorrect policy syntax tag"}, |
162 | {ERR_REASON(X509V3_R_INVALID_MULTIPLE_RDNS),"invalid multiple rdns"}, | ||
163 | {ERR_REASON(X509V3_R_INVALID_ASNUMBER) ,"invalid asnumber"}, | 157 | {ERR_REASON(X509V3_R_INVALID_ASNUMBER) ,"invalid asnumber"}, |
164 | {ERR_REASON(X509V3_R_INVALID_ASRANGE) ,"invalid asrange"}, | 158 | {ERR_REASON(X509V3_R_INVALID_ASRANGE) ,"invalid asrange"}, |
165 | {ERR_REASON(X509V3_R_INVALID_BOOLEAN_STRING),"invalid boolean string"}, | 159 | {ERR_REASON(X509V3_R_INVALID_BOOLEAN_STRING),"invalid boolean string"}, |
@@ -193,9 +187,9 @@ static ERR_STRING_DATA X509V3_str_reasons[]= | |||
193 | {ERR_REASON(X509V3_R_ODD_NUMBER_OF_DIGITS),"odd number of digits"}, | 187 | {ERR_REASON(X509V3_R_ODD_NUMBER_OF_DIGITS),"odd number of digits"}, |
194 | {ERR_REASON(X509V3_R_OPERATION_NOT_DEFINED),"operation not defined"}, | 188 | {ERR_REASON(X509V3_R_OPERATION_NOT_DEFINED),"operation not defined"}, |
195 | {ERR_REASON(X509V3_R_OTHERNAME_ERROR) ,"othername error"}, | 189 | {ERR_REASON(X509V3_R_OTHERNAME_ERROR) ,"othername error"}, |
196 | {ERR_REASON(X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED),"policy language already defined"}, | 190 | {ERR_REASON(X509V3_R_POLICY_LANGUAGE_ALREADTY_DEFINED),"policy language alreadty defined"}, |
197 | {ERR_REASON(X509V3_R_POLICY_PATH_LENGTH) ,"policy path length"}, | 191 | {ERR_REASON(X509V3_R_POLICY_PATH_LENGTH) ,"policy path length"}, |
198 | {ERR_REASON(X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED),"policy path length already defined"}, | 192 | {ERR_REASON(X509V3_R_POLICY_PATH_LENGTH_ALREADTY_DEFINED),"policy path length alreadty defined"}, |
199 | {ERR_REASON(X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED),"policy syntax not currently supported"}, | 193 | {ERR_REASON(X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED),"policy syntax not currently supported"}, |
200 | {ERR_REASON(X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY),"policy when proxy language requires no policy"}, | 194 | {ERR_REASON(X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY),"policy when proxy language requires no policy"}, |
201 | {ERR_REASON(X509V3_R_SECTION_NOT_FOUND) ,"section not found"}, | 195 | {ERR_REASON(X509V3_R_SECTION_NOT_FOUND) ,"section not found"}, |
@@ -206,7 +200,6 @@ static ERR_STRING_DATA X509V3_str_reasons[]= | |||
206 | {ERR_REASON(X509V3_R_UNKNOWN_EXTENSION_NAME),"unknown extension name"}, | 200 | {ERR_REASON(X509V3_R_UNKNOWN_EXTENSION_NAME),"unknown extension name"}, |
207 | {ERR_REASON(X509V3_R_UNKNOWN_OPTION) ,"unknown option"}, | 201 | {ERR_REASON(X509V3_R_UNKNOWN_OPTION) ,"unknown option"}, |
208 | {ERR_REASON(X509V3_R_UNSUPPORTED_OPTION) ,"unsupported option"}, | 202 | {ERR_REASON(X509V3_R_UNSUPPORTED_OPTION) ,"unsupported option"}, |
209 | {ERR_REASON(X509V3_R_UNSUPPORTED_TYPE) ,"unsupported type"}, | ||
210 | {ERR_REASON(X509V3_R_USER_TOO_LONG) ,"user too long"}, | 203 | {ERR_REASON(X509V3_R_USER_TOO_LONG) ,"user too long"}, |
211 | {0,NULL} | 204 | {0,NULL} |
212 | }; | 205 | }; |
diff --git a/src/lib/libcrypto/x509v3/v3prin.c b/src/lib/libcrypto/x509v3/v3prin.c new file mode 100644 index 0000000000..d5ff268296 --- /dev/null +++ b/src/lib/libcrypto/x509v3/v3prin.c | |||
@@ -0,0 +1,99 @@ | |||
1 | /* v3prin.c */ | ||
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | ||
3 | * project 1999. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | |||
60 | |||
61 | #include <stdio.h> | ||
62 | #include <openssl/asn1.h> | ||
63 | #include <openssl/conf.h> | ||
64 | #include <openssl/x509.h> | ||
65 | #include <openssl/x509v3.h> | ||
66 | |||
67 | int main(int argc, char **argv) | ||
68 | { | ||
69 | X509 *cert; | ||
70 | FILE *inf; | ||
71 | int i, count; | ||
72 | X509_EXTENSION *ext; | ||
73 | X509V3_add_standard_extensions(); | ||
74 | ERR_load_crypto_strings(); | ||
75 | if(!argv[1]) { | ||
76 | fprintf(stderr, "Usage v3prin cert.pem\n"); | ||
77 | exit(1); | ||
78 | } | ||
79 | if(!(inf = fopen(argv[1], "r"))) { | ||
80 | fprintf(stderr, "Can't open %s\n", argv[1]); | ||
81 | exit(1); | ||
82 | } | ||
83 | if(!(cert = PEM_read_X509(inf, NULL, NULL))) { | ||
84 | fprintf(stderr, "Can't read certificate %s\n", argv[1]); | ||
85 | ERR_print_errors_fp(stderr); | ||
86 | exit(1); | ||
87 | } | ||
88 | fclose(inf); | ||
89 | count = X509_get_ext_count(cert); | ||
90 | printf("%d extensions\n", count); | ||
91 | for(i = 0; i < count; i++) { | ||
92 | ext = X509_get_ext(cert, i); | ||
93 | printf("%s\n", OBJ_nid2ln(OBJ_obj2nid(ext->object))); | ||
94 | if(!X509V3_EXT_print_fp(stdout, ext, 0, 0)) ERR_print_errors_fp(stderr); | ||
95 | printf("\n"); | ||
96 | |||
97 | } | ||
98 | return 0; | ||
99 | } | ||
diff --git a/src/lib/libcrypto/x509v3/x509v3.h b/src/lib/libcrypto/x509v3/x509v3.h index b308abe7cd..9ef83da755 100644 --- a/src/lib/libcrypto/x509v3/x509v3.h +++ b/src/lib/libcrypto/x509v3/x509v3.h | |||
@@ -76,19 +76,12 @@ typedef void * (*X509V3_EXT_NEW)(void); | |||
76 | typedef void (*X509V3_EXT_FREE)(void *); | 76 | typedef void (*X509V3_EXT_FREE)(void *); |
77 | typedef void * (*X509V3_EXT_D2I)(void *, const unsigned char ** , long); | 77 | typedef void * (*X509V3_EXT_D2I)(void *, const unsigned char ** , long); |
78 | typedef int (*X509V3_EXT_I2D)(void *, unsigned char **); | 78 | typedef int (*X509V3_EXT_I2D)(void *, unsigned char **); |
79 | typedef STACK_OF(CONF_VALUE) * | 79 | typedef STACK_OF(CONF_VALUE) * (*X509V3_EXT_I2V)(struct v3_ext_method *method, void *ext, STACK_OF(CONF_VALUE) *extlist); |
80 | (*X509V3_EXT_I2V)(const struct v3_ext_method *method, void *ext, | 80 | typedef void * (*X509V3_EXT_V2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, STACK_OF(CONF_VALUE) *values); |
81 | STACK_OF(CONF_VALUE) *extlist); | 81 | typedef char * (*X509V3_EXT_I2S)(struct v3_ext_method *method, void *ext); |
82 | typedef void * (*X509V3_EXT_V2I)(const struct v3_ext_method *method, | 82 | typedef void * (*X509V3_EXT_S2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, const char *str); |
83 | struct v3_ext_ctx *ctx, | 83 | typedef int (*X509V3_EXT_I2R)(struct v3_ext_method *method, void *ext, BIO *out, int indent); |
84 | STACK_OF(CONF_VALUE) *values); | 84 | typedef void * (*X509V3_EXT_R2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, const char *str); |
85 | typedef char * (*X509V3_EXT_I2S)(const struct v3_ext_method *method, void *ext); | ||
86 | typedef void * (*X509V3_EXT_S2I)(const struct v3_ext_method *method, | ||
87 | struct v3_ext_ctx *ctx, const char *str); | ||
88 | typedef int (*X509V3_EXT_I2R)(const struct v3_ext_method *method, void *ext, | ||
89 | BIO *out, int indent); | ||
90 | typedef void * (*X509V3_EXT_R2I)(const struct v3_ext_method *method, | ||
91 | struct v3_ext_ctx *ctx, const char *str); | ||
92 | 85 | ||
93 | /* V3 extension structure */ | 86 | /* V3 extension structure */ |
94 | 87 | ||
@@ -227,41 +220,24 @@ union { | |||
227 | GENERAL_NAMES *fullname; | 220 | GENERAL_NAMES *fullname; |
228 | STACK_OF(X509_NAME_ENTRY) *relativename; | 221 | STACK_OF(X509_NAME_ENTRY) *relativename; |
229 | } name; | 222 | } name; |
230 | /* If relativename then this contains the full distribution point name */ | ||
231 | X509_NAME *dpname; | ||
232 | } DIST_POINT_NAME; | 223 | } DIST_POINT_NAME; |
233 | /* All existing reasons */ | 224 | |
234 | #define CRLDP_ALL_REASONS 0x807f | 225 | typedef struct DIST_POINT_st { |
235 | |||
236 | #define CRL_REASON_NONE -1 | ||
237 | #define CRL_REASON_UNSPECIFIED 0 | ||
238 | #define CRL_REASON_KEY_COMPROMISE 1 | ||
239 | #define CRL_REASON_CA_COMPROMISE 2 | ||
240 | #define CRL_REASON_AFFILIATION_CHANGED 3 | ||
241 | #define CRL_REASON_SUPERSEDED 4 | ||
242 | #define CRL_REASON_CESSATION_OF_OPERATION 5 | ||
243 | #define CRL_REASON_CERTIFICATE_HOLD 6 | ||
244 | #define CRL_REASON_REMOVE_FROM_CRL 8 | ||
245 | #define CRL_REASON_PRIVILEGE_WITHDRAWN 9 | ||
246 | #define CRL_REASON_AA_COMPROMISE 10 | ||
247 | |||
248 | struct DIST_POINT_st { | ||
249 | DIST_POINT_NAME *distpoint; | 226 | DIST_POINT_NAME *distpoint; |
250 | ASN1_BIT_STRING *reasons; | 227 | ASN1_BIT_STRING *reasons; |
251 | GENERAL_NAMES *CRLissuer; | 228 | GENERAL_NAMES *CRLissuer; |
252 | int dp_reasons; | 229 | } DIST_POINT; |
253 | }; | ||
254 | 230 | ||
255 | typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS; | 231 | typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS; |
256 | 232 | ||
257 | DECLARE_STACK_OF(DIST_POINT) | 233 | DECLARE_STACK_OF(DIST_POINT) |
258 | DECLARE_ASN1_SET_OF(DIST_POINT) | 234 | DECLARE_ASN1_SET_OF(DIST_POINT) |
259 | 235 | ||
260 | struct AUTHORITY_KEYID_st { | 236 | typedef struct AUTHORITY_KEYID_st { |
261 | ASN1_OCTET_STRING *keyid; | 237 | ASN1_OCTET_STRING *keyid; |
262 | GENERAL_NAMES *issuer; | 238 | GENERAL_NAMES *issuer; |
263 | ASN1_INTEGER *serial; | 239 | ASN1_INTEGER *serial; |
264 | }; | 240 | } AUTHORITY_KEYID; |
265 | 241 | ||
266 | /* Strong extranet structures */ | 242 | /* Strong extranet structures */ |
267 | 243 | ||
@@ -327,10 +303,10 @@ typedef struct GENERAL_SUBTREE_st { | |||
327 | 303 | ||
328 | DECLARE_STACK_OF(GENERAL_SUBTREE) | 304 | DECLARE_STACK_OF(GENERAL_SUBTREE) |
329 | 305 | ||
330 | struct NAME_CONSTRAINTS_st { | 306 | typedef struct NAME_CONSTRAINTS_st { |
331 | STACK_OF(GENERAL_SUBTREE) *permittedSubtrees; | 307 | STACK_OF(GENERAL_SUBTREE) *permittedSubtrees; |
332 | STACK_OF(GENERAL_SUBTREE) *excludedSubtrees; | 308 | STACK_OF(GENERAL_SUBTREE) *excludedSubtrees; |
333 | }; | 309 | } NAME_CONSTRAINTS; |
334 | 310 | ||
335 | typedef struct POLICY_CONSTRAINTS_st { | 311 | typedef struct POLICY_CONSTRAINTS_st { |
336 | ASN1_INTEGER *requireExplicitPolicy; | 312 | ASN1_INTEGER *requireExplicitPolicy; |
@@ -353,31 +329,6 @@ typedef struct PROXY_CERT_INFO_EXTENSION_st | |||
353 | DECLARE_ASN1_FUNCTIONS(PROXY_POLICY) | 329 | DECLARE_ASN1_FUNCTIONS(PROXY_POLICY) |
354 | DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION) | 330 | DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION) |
355 | 331 | ||
356 | struct ISSUING_DIST_POINT_st | ||
357 | { | ||
358 | DIST_POINT_NAME *distpoint; | ||
359 | int onlyuser; | ||
360 | int onlyCA; | ||
361 | ASN1_BIT_STRING *onlysomereasons; | ||
362 | int indirectCRL; | ||
363 | int onlyattr; | ||
364 | }; | ||
365 | |||
366 | /* Values in idp_flags field */ | ||
367 | /* IDP present */ | ||
368 | #define IDP_PRESENT 0x1 | ||
369 | /* IDP values inconsistent */ | ||
370 | #define IDP_INVALID 0x2 | ||
371 | /* onlyuser true */ | ||
372 | #define IDP_ONLYUSER 0x4 | ||
373 | /* onlyCA true */ | ||
374 | #define IDP_ONLYCA 0x8 | ||
375 | /* onlyattr true */ | ||
376 | #define IDP_ONLYATTR 0x10 | ||
377 | /* indirectCRL true */ | ||
378 | #define IDP_INDIRECT 0x20 | ||
379 | /* onlysomereasons present */ | ||
380 | #define IDP_REASONS 0x40 | ||
381 | 332 | ||
382 | #define X509V3_conf_err(val) ERR_add_error_data(6, "section:", val->section, \ | 333 | #define X509V3_conf_err(val) ERR_add_error_data(6, "section:", val->section, \ |
383 | ",name:", val->name, ",value:", val->value); | 334 | ",name:", val->name, ",value:", val->value); |
@@ -422,7 +373,6 @@ struct ISSUING_DIST_POINT_st | |||
422 | #define EXFLAG_PROXY 0x400 | 373 | #define EXFLAG_PROXY 0x400 |
423 | 374 | ||
424 | #define EXFLAG_INVALID_POLICY 0x800 | 375 | #define EXFLAG_INVALID_POLICY 0x800 |
425 | #define EXFLAG_FRESHEST 0x1000 | ||
426 | 376 | ||
427 | #define KU_DIGITAL_SIGNATURE 0x0080 | 377 | #define KU_DIGITAL_SIGNATURE 0x0080 |
428 | #define KU_NON_REPUDIATION 0x0040 | 378 | #define KU_NON_REPUDIATION 0x0040 |
@@ -474,10 +424,9 @@ typedef struct x509_purpose_st { | |||
474 | #define X509_PURPOSE_CRL_SIGN 6 | 424 | #define X509_PURPOSE_CRL_SIGN 6 |
475 | #define X509_PURPOSE_ANY 7 | 425 | #define X509_PURPOSE_ANY 7 |
476 | #define X509_PURPOSE_OCSP_HELPER 8 | 426 | #define X509_PURPOSE_OCSP_HELPER 8 |
477 | #define X509_PURPOSE_TIMESTAMP_SIGN 9 | ||
478 | 427 | ||
479 | #define X509_PURPOSE_MIN 1 | 428 | #define X509_PURPOSE_MIN 1 |
480 | #define X509_PURPOSE_MAX 9 | 429 | #define X509_PURPOSE_MAX 8 |
481 | 430 | ||
482 | /* Flags for X509V3_EXT_print() */ | 431 | /* Flags for X509V3_EXT_print() */ |
483 | 432 | ||
@@ -522,9 +471,6 @@ DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID) | |||
522 | DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD) | 471 | DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD) |
523 | 472 | ||
524 | DECLARE_ASN1_FUNCTIONS(GENERAL_NAME) | 473 | DECLARE_ASN1_FUNCTIONS(GENERAL_NAME) |
525 | GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a); | ||
526 | int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b); | ||
527 | |||
528 | 474 | ||
529 | 475 | ||
530 | ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, | 476 | ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, |
@@ -540,18 +486,11 @@ DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES) | |||
540 | 486 | ||
541 | STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, | 487 | STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, |
542 | GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist); | 488 | GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist); |
543 | GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method, | 489 | GENERAL_NAMES *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method, |
544 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); | 490 | X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); |
545 | 491 | ||
546 | DECLARE_ASN1_FUNCTIONS(OTHERNAME) | 492 | DECLARE_ASN1_FUNCTIONS(OTHERNAME) |
547 | DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME) | 493 | DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME) |
548 | int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b); | ||
549 | void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value); | ||
550 | void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype); | ||
551 | int GENERAL_NAME_set0_othername(GENERAL_NAME *gen, | ||
552 | ASN1_OBJECT *oid, ASN1_TYPE *value); | ||
553 | int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen, | ||
554 | ASN1_OBJECT **poid, ASN1_TYPE **pvalue); | ||
555 | 494 | ||
556 | char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5); | 495 | char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5); |
557 | ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); | 496 | ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); |
@@ -568,11 +507,6 @@ DECLARE_ASN1_FUNCTIONS(NOTICEREF) | |||
568 | DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS) | 507 | DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS) |
569 | DECLARE_ASN1_FUNCTIONS(DIST_POINT) | 508 | DECLARE_ASN1_FUNCTIONS(DIST_POINT) |
570 | DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME) | 509 | DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME) |
571 | DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT) | ||
572 | |||
573 | int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname); | ||
574 | |||
575 | int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc); | ||
576 | 510 | ||
577 | DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) | 511 | DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) |
578 | DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) | 512 | DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) |
@@ -590,16 +524,11 @@ DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS) | |||
590 | DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) | 524 | DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) |
591 | DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS) | 525 | DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS) |
592 | 526 | ||
593 | GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, | ||
594 | const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, | ||
595 | int gen_type, char *value, int is_nc); | ||
596 | |||
597 | #ifdef HEADER_CONF_H | 527 | #ifdef HEADER_CONF_H |
598 | GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, | 528 | GENERAL_NAME *v2i_GENERAL_NAME(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, |
599 | CONF_VALUE *cnf); | 529 | CONF_VALUE *cnf); |
600 | GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, | 530 | GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, X509V3_EXT_METHOD *method, |
601 | const X509V3_EXT_METHOD *method, | 531 | X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc); |
602 | X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc); | ||
603 | void X509V3_conf_free(CONF_VALUE *val); | 532 | void X509V3_conf_free(CONF_VALUE *val); |
604 | 533 | ||
605 | X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value); | 534 | X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value); |
@@ -609,23 +538,18 @@ int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509 *cert) | |||
609 | int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); | 538 | int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); |
610 | int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); | 539 | int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); |
611 | 540 | ||
612 | X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | 541 | X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, char *value); |
613 | int ext_nid, char *value); | 542 | X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, char *value); |
614 | X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | 543 | int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509 *cert); |
615 | char *name, char *value); | 544 | int X509V3_EXT_REQ_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); |
616 | int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | 545 | int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); |
617 | char *section, X509 *cert); | ||
618 | int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | ||
619 | char *section, X509_REQ *req); | ||
620 | int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, | ||
621 | char *section, X509_CRL *crl); | ||
622 | 546 | ||
623 | int X509V3_add_value_bool_nf(char *name, int asn1_bool, | 547 | int X509V3_add_value_bool_nf(char *name, int asn1_bool, |
624 | STACK_OF(CONF_VALUE) **extlist); | 548 | STACK_OF(CONF_VALUE) **extlist); |
625 | int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool); | 549 | int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool); |
626 | int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint); | 550 | int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint); |
627 | void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf); | 551 | void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf); |
628 | void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash); | 552 | void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash); |
629 | #endif | 553 | #endif |
630 | 554 | ||
631 | char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section); | 555 | char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section); |
@@ -652,8 +576,8 @@ int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist); | |||
652 | int X509V3_EXT_add_alias(int nid_to, int nid_from); | 576 | int X509V3_EXT_add_alias(int nid_to, int nid_from); |
653 | void X509V3_EXT_cleanup(void); | 577 | void X509V3_EXT_cleanup(void); |
654 | 578 | ||
655 | const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext); | 579 | X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext); |
656 | const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid); | 580 | X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid); |
657 | int X509V3_add_standard_extensions(void); | 581 | int X509V3_add_standard_extensions(void); |
658 | STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line); | 582 | STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line); |
659 | void *X509V3_EXT_d2i(X509_EXTENSION *ext); | 583 | void *X509V3_EXT_d2i(X509_EXTENSION *ext); |
@@ -663,8 +587,8 @@ void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx); | |||
663 | X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); | 587 | X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); |
664 | int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags); | 588 | int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags); |
665 | 589 | ||
666 | char *hex_to_string(const unsigned char *buffer, long len); | 590 | char *hex_to_string(unsigned char *buffer, long len); |
667 | unsigned char *string_to_hex(const char *str, long *len); | 591 | unsigned char *string_to_hex(char *str, long *len); |
668 | int name_cmp(const char *name, const char *cmp); | 592 | int name_cmp(const char *name, const char *cmp); |
669 | 593 | ||
670 | void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, | 594 | void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, |
@@ -679,7 +603,6 @@ int X509_check_purpose(X509 *x, int id, int ca); | |||
679 | int X509_supported_extension(X509_EXTENSION *ex); | 603 | int X509_supported_extension(X509_EXTENSION *ex); |
680 | int X509_PURPOSE_set(int *p, int purpose); | 604 | int X509_PURPOSE_set(int *p, int purpose); |
681 | int X509_check_issued(X509 *issuer, X509 *subject); | 605 | int X509_check_issued(X509 *issuer, X509 *subject); |
682 | int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); | ||
683 | int X509_PURPOSE_get_count(void); | 606 | int X509_PURPOSE_get_count(void); |
684 | X509_PURPOSE * X509_PURPOSE_get0(int idx); | 607 | X509_PURPOSE * X509_PURPOSE_get0(int idx); |
685 | int X509_PURPOSE_get_by_sname(char *sname); | 608 | int X509_PURPOSE_get_by_sname(char *sname); |
@@ -693,10 +616,10 @@ int X509_PURPOSE_get_trust(X509_PURPOSE *xp); | |||
693 | void X509_PURPOSE_cleanup(void); | 616 | void X509_PURPOSE_cleanup(void); |
694 | int X509_PURPOSE_get_id(X509_PURPOSE *); | 617 | int X509_PURPOSE_get_id(X509_PURPOSE *); |
695 | 618 | ||
696 | STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x); | 619 | STACK *X509_get1_email(X509 *x); |
697 | STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x); | 620 | STACK *X509_REQ_get1_email(X509_REQ *x); |
698 | void X509_email_free(STACK_OF(OPENSSL_STRING) *sk); | 621 | void X509_email_free(STACK *sk); |
699 | STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x); | 622 | STACK *X509_get1_ocsp(X509 *x); |
700 | 623 | ||
701 | ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc); | 624 | ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc); |
702 | ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc); | 625 | ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc); |
@@ -705,7 +628,6 @@ int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk, | |||
705 | unsigned long chtype); | 628 | unsigned long chtype); |
706 | 629 | ||
707 | void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent); | 630 | void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent); |
708 | DECLARE_STACK_OF(X509_POLICY_NODE) | ||
709 | 631 | ||
710 | #ifndef OPENSSL_NO_RFC3779 | 632 | #ifndef OPENSSL_NO_RFC3779 |
711 | 633 | ||
@@ -865,9 +787,8 @@ void ERR_load_X509V3_strings(void); | |||
865 | /* Error codes for the X509V3 functions. */ | 787 | /* Error codes for the X509V3 functions. */ |
866 | 788 | ||
867 | /* Function codes. */ | 789 | /* Function codes. */ |
868 | #define X509V3_F_A2I_GENERAL_NAME 164 | 790 | #define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 156 |
869 | #define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 161 | 791 | #define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 157 |
870 | #define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 162 | ||
871 | #define X509V3_F_COPY_EMAIL 122 | 792 | #define X509V3_F_COPY_EMAIL 122 |
872 | #define X509V3_F_COPY_ISSUER 123 | 793 | #define X509V3_F_COPY_ISSUER 123 |
873 | #define X509V3_F_DO_DIRNAME 144 | 794 | #define X509V3_F_DO_DIRNAME 144 |
@@ -875,7 +796,6 @@ void ERR_load_X509V3_strings(void); | |||
875 | #define X509V3_F_DO_EXT_I2D 135 | 796 | #define X509V3_F_DO_EXT_I2D 135 |
876 | #define X509V3_F_DO_EXT_NCONF 151 | 797 | #define X509V3_F_DO_EXT_NCONF 151 |
877 | #define X509V3_F_DO_I2V_NAME_CONSTRAINTS 148 | 798 | #define X509V3_F_DO_I2V_NAME_CONSTRAINTS 148 |
878 | #define X509V3_F_GNAMES_FROM_SECTNAME 156 | ||
879 | #define X509V3_F_HEX_TO_STRING 111 | 799 | #define X509V3_F_HEX_TO_STRING 111 |
880 | #define X509V3_F_I2S_ASN1_ENUMERATED 121 | 800 | #define X509V3_F_I2S_ASN1_ENUMERATED 121 |
881 | #define X509V3_F_I2S_ASN1_IA5STRING 149 | 801 | #define X509V3_F_I2S_ASN1_IA5STRING 149 |
@@ -892,14 +812,13 @@ void ERR_load_X509V3_strings(void); | |||
892 | #define X509V3_F_S2I_ASN1_OCTET_STRING 112 | 812 | #define X509V3_F_S2I_ASN1_OCTET_STRING 112 |
893 | #define X509V3_F_S2I_ASN1_SKEY_ID 114 | 813 | #define X509V3_F_S2I_ASN1_SKEY_ID 114 |
894 | #define X509V3_F_S2I_SKEY_ID 115 | 814 | #define X509V3_F_S2I_SKEY_ID 115 |
895 | #define X509V3_F_SET_DIST_POINT_NAME 158 | ||
896 | #define X509V3_F_STRING_TO_HEX 113 | 815 | #define X509V3_F_STRING_TO_HEX 113 |
897 | #define X509V3_F_SXNET_ADD_ID_ASC 125 | 816 | #define X509V3_F_SXNET_ADD_ID_ASC 125 |
898 | #define X509V3_F_SXNET_ADD_ID_INTEGER 126 | 817 | #define X509V3_F_SXNET_ADD_ID_INTEGER 126 |
899 | #define X509V3_F_SXNET_ADD_ID_ULONG 127 | 818 | #define X509V3_F_SXNET_ADD_ID_ULONG 127 |
900 | #define X509V3_F_SXNET_GET_ID_ASC 128 | 819 | #define X509V3_F_SXNET_GET_ID_ASC 128 |
901 | #define X509V3_F_SXNET_GET_ID_ULONG 129 | 820 | #define X509V3_F_SXNET_GET_ID_ULONG 129 |
902 | #define X509V3_F_V2I_ASIDENTIFIERS 163 | 821 | #define X509V3_F_V2I_ASIDENTIFIERS 158 |
903 | #define X509V3_F_V2I_ASN1_BIT_STRING 101 | 822 | #define X509V3_F_V2I_ASN1_BIT_STRING 101 |
904 | #define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 139 | 823 | #define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 139 |
905 | #define X509V3_F_V2I_AUTHORITY_KEYID 119 | 824 | #define X509V3_F_V2I_AUTHORITY_KEYID 119 |
@@ -908,7 +827,6 @@ void ERR_load_X509V3_strings(void); | |||
908 | #define X509V3_F_V2I_EXTENDED_KEY_USAGE 103 | 827 | #define X509V3_F_V2I_EXTENDED_KEY_USAGE 103 |
909 | #define X509V3_F_V2I_GENERAL_NAMES 118 | 828 | #define X509V3_F_V2I_GENERAL_NAMES 118 |
910 | #define X509V3_F_V2I_GENERAL_NAME_EX 117 | 829 | #define X509V3_F_V2I_GENERAL_NAME_EX 117 |
911 | #define X509V3_F_V2I_IDP 157 | ||
912 | #define X509V3_F_V2I_IPADDRBLOCKS 159 | 830 | #define X509V3_F_V2I_IPADDRBLOCKS 159 |
913 | #define X509V3_F_V2I_ISSUER_ALT 153 | 831 | #define X509V3_F_V2I_ISSUER_ALT 153 |
914 | #define X509V3_F_V2I_NAME_CONSTRAINTS 147 | 832 | #define X509V3_F_V2I_NAME_CONSTRAINTS 147 |
@@ -937,7 +855,6 @@ void ERR_load_X509V3_strings(void); | |||
937 | #define X509V3_R_BN_DEC2BN_ERROR 100 | 855 | #define X509V3_R_BN_DEC2BN_ERROR 100 |
938 | #define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101 | 856 | #define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101 |
939 | #define X509V3_R_DIRNAME_ERROR 149 | 857 | #define X509V3_R_DIRNAME_ERROR 149 |
940 | #define X509V3_R_DISTPOINT_ALREADY_SET 160 | ||
941 | #define X509V3_R_DUPLICATE_ZONE_ID 133 | 858 | #define X509V3_R_DUPLICATE_ZONE_ID 133 |
942 | #define X509V3_R_ERROR_CONVERTING_ZONE 131 | 859 | #define X509V3_R_ERROR_CONVERTING_ZONE 131 |
943 | #define X509V3_R_ERROR_CREATING_EXTENSION 144 | 860 | #define X509V3_R_ERROR_CREATING_EXTENSION 144 |
@@ -951,13 +868,12 @@ void ERR_load_X509V3_strings(void); | |||
951 | #define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151 | 868 | #define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151 |
952 | #define X509V3_R_ILLEGAL_HEX_DIGIT 113 | 869 | #define X509V3_R_ILLEGAL_HEX_DIGIT 113 |
953 | #define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152 | 870 | #define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152 |
954 | #define X509V3_R_INVALID_MULTIPLE_RDNS 161 | 871 | #define X509V3_R_INVALID_ASNUMBER 160 |
955 | #define X509V3_R_INVALID_ASNUMBER 162 | 872 | #define X509V3_R_INVALID_ASRANGE 161 |
956 | #define X509V3_R_INVALID_ASRANGE 163 | ||
957 | #define X509V3_R_INVALID_BOOLEAN_STRING 104 | 873 | #define X509V3_R_INVALID_BOOLEAN_STRING 104 |
958 | #define X509V3_R_INVALID_EXTENSION_STRING 105 | 874 | #define X509V3_R_INVALID_EXTENSION_STRING 105 |
959 | #define X509V3_R_INVALID_INHERITANCE 165 | 875 | #define X509V3_R_INVALID_INHERITANCE 162 |
960 | #define X509V3_R_INVALID_IPADDRESS 166 | 876 | #define X509V3_R_INVALID_IPADDRESS 163 |
961 | #define X509V3_R_INVALID_NAME 106 | 877 | #define X509V3_R_INVALID_NAME 106 |
962 | #define X509V3_R_INVALID_NULL_ARGUMENT 107 | 878 | #define X509V3_R_INVALID_NULL_ARGUMENT 107 |
963 | #define X509V3_R_INVALID_NULL_NAME 108 | 879 | #define X509V3_R_INVALID_NULL_NAME 108 |
@@ -985,9 +901,9 @@ void ERR_load_X509V3_strings(void); | |||
985 | #define X509V3_R_ODD_NUMBER_OF_DIGITS 112 | 901 | #define X509V3_R_ODD_NUMBER_OF_DIGITS 112 |
986 | #define X509V3_R_OPERATION_NOT_DEFINED 148 | 902 | #define X509V3_R_OPERATION_NOT_DEFINED 148 |
987 | #define X509V3_R_OTHERNAME_ERROR 147 | 903 | #define X509V3_R_OTHERNAME_ERROR 147 |
988 | #define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED 155 | 904 | #define X509V3_R_POLICY_LANGUAGE_ALREADTY_DEFINED 155 |
989 | #define X509V3_R_POLICY_PATH_LENGTH 156 | 905 | #define X509V3_R_POLICY_PATH_LENGTH 156 |
990 | #define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED 157 | 906 | #define X509V3_R_POLICY_PATH_LENGTH_ALREADTY_DEFINED 157 |
991 | #define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED 158 | 907 | #define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED 158 |
992 | #define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159 | 908 | #define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159 |
993 | #define X509V3_R_SECTION_NOT_FOUND 150 | 909 | #define X509V3_R_SECTION_NOT_FOUND 150 |
@@ -998,7 +914,6 @@ void ERR_load_X509V3_strings(void); | |||
998 | #define X509V3_R_UNKNOWN_EXTENSION_NAME 130 | 914 | #define X509V3_R_UNKNOWN_EXTENSION_NAME 130 |
999 | #define X509V3_R_UNKNOWN_OPTION 120 | 915 | #define X509V3_R_UNKNOWN_OPTION 120 |
1000 | #define X509V3_R_UNSUPPORTED_OPTION 117 | 916 | #define X509V3_R_UNSUPPORTED_OPTION 117 |
1001 | #define X509V3_R_UNSUPPORTED_TYPE 167 | ||
1002 | #define X509V3_R_USER_TOO_LONG 132 | 917 | #define X509V3_R_USER_TOO_LONG 132 |
1003 | 918 | ||
1004 | #ifdef __cplusplus | 919 | #ifdef __cplusplus |