summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509v3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509v3')
-rw-r--r--src/lib/libcrypto/x509v3/Makefile591
-rw-r--r--src/lib/libcrypto/x509v3/Makefile.ssl603
-rw-r--r--src/lib/libcrypto/x509v3/ext_dat.h13
-rw-r--r--src/lib/libcrypto/x509v3/pcy_data.c12
-rw-r--r--src/lib/libcrypto/x509v3/pcy_tree.c235
-rw-r--r--src/lib/libcrypto/x509v3/tabtest.c88
-rw-r--r--src/lib/libcrypto/x509v3/v3_addr.c1286
-rw-r--r--src/lib/libcrypto/x509v3/v3_alt.c140
-rw-r--r--src/lib/libcrypto/x509v3/v3_asid.c842
-rw-r--r--src/lib/libcrypto/x509v3/v3_conf.c51
-rw-r--r--src/lib/libcrypto/x509v3/v3_cpols.c5
-rw-r--r--src/lib/libcrypto/x509v3/v3_crld.c552
-rw-r--r--src/lib/libcrypto/x509v3/v3_enum.c19
-rw-r--r--src/lib/libcrypto/x509v3/v3_extku.c16
-rw-r--r--src/lib/libcrypto/x509v3/v3_genn.c153
-rw-r--r--src/lib/libcrypto/x509v3/v3_lib.c24
-rw-r--r--src/lib/libcrypto/x509v3/v3_ocsp.c62
-rw-r--r--src/lib/libcrypto/x509v3/v3_prn.c2
-rw-r--r--src/lib/libcrypto/x509v3/v3_purp.c194
-rw-r--r--src/lib/libcrypto/x509v3/v3_utl.c47
-rw-r--r--src/lib/libcrypto/x509v3/v3conf.c127
-rw-r--r--src/lib/libcrypto/x509v3/v3err.c13
-rw-r--r--src/lib/libcrypto/x509v3/v3prin.c99
-rw-r--r--src/lib/libcrypto/x509v3/x509v3.h173
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
5DIR= x509v3
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I$(TOP) -I../../include
9CFLAG=-g
10MAKEFILE= Makefile
11AR= ar r
12
13CFLAGS= $(INCLUDES) $(CFLAG)
14
15GENERAL=Makefile README
16TEST=
17APPS=
18
19LIB=$(TOP)/libcrypto.a
20LIBSRC= v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c v3_lib.c \
21v3_prn.c v3_utl.c v3err.c v3_genn.c v3_alt.c v3_skey.c v3_akey.c v3_pku.c \
22v3_int.c v3_enum.c v3_sxnet.c v3_cpols.c v3_crld.c v3_purp.c v3_info.c \
23v3_ocsp.c v3_akeya.c v3_pmaps.c v3_pcons.c v3_ncons.c v3_pcia.c v3_pci.c \
24pcy_cache.c pcy_node.c pcy_data.c pcy_map.c pcy_tree.c pcy_lib.c \
25v3_asid.c v3_addr.c
26LIBOBJ= v3_bcons.o v3_bitst.o v3_conf.o v3_extku.o v3_ia5.o v3_lib.o \
27v3_prn.o v3_utl.o v3err.o v3_genn.o v3_alt.o v3_skey.o v3_akey.o v3_pku.o \
28v3_int.o v3_enum.o v3_sxnet.o v3_cpols.o v3_crld.o v3_purp.o v3_info.o \
29v3_ocsp.o v3_akeya.o v3_pmaps.o v3_pcons.o v3_ncons.o v3_pcia.o v3_pci.o \
30pcy_cache.o pcy_node.o pcy_data.o pcy_map.o pcy_tree.o pcy_lib.o \
31v3_asid.o v3_addr.o
32
33SRC= $(LIBSRC)
34
35EXHEADER= x509v3.h
36HEADER= $(EXHEADER) pcy_int.h
37
38ALL= $(GENERAL) $(SRC) $(HEADER)
39
40top:
41 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
42
43all: lib
44
45lib: $(LIBOBJ)
46 $(AR) $(LIB) $(LIBOBJ)
47 $(RANLIB) $(LIB) || echo Never mind.
48 @touch lib
49
50files:
51 $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
52
53links:
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
58install:
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
66tags:
67 ctags $(SRC)
68
69tests:
70
71lint:
72 lint -DLINT $(INCLUDES) $(SRC)>fluff
73
74depend:
75 @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
76 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
77
78dclean:
79 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
80 mv -f Makefile.new $(MAKEFILE)
81
82clean:
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
87pcy_cache.o: ../../e_os.h ../../include/openssl/asn1.h
88pcy_cache.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
89pcy_cache.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
90pcy_cache.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
91pcy_cache.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
92pcy_cache.o: ../../include/openssl/err.h ../../include/openssl/evp.h
93pcy_cache.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
94pcy_cache.o: ../../include/openssl/objects.h
95pcy_cache.o: ../../include/openssl/opensslconf.h
96pcy_cache.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
97pcy_cache.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
98pcy_cache.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
99pcy_cache.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
100pcy_cache.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
101pcy_cache.o: ../cryptlib.h pcy_cache.c pcy_int.h
102pcy_data.o: ../../e_os.h ../../include/openssl/asn1.h
103pcy_data.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
104pcy_data.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
105pcy_data.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
106pcy_data.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
107pcy_data.o: ../../include/openssl/err.h ../../include/openssl/evp.h
108pcy_data.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
109pcy_data.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
110pcy_data.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
111pcy_data.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
112pcy_data.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
113pcy_data.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
114pcy_data.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
115pcy_data.o: ../cryptlib.h pcy_data.c pcy_int.h
116pcy_lib.o: ../../e_os.h ../../include/openssl/asn1.h
117pcy_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
118pcy_lib.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
119pcy_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
120pcy_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
121pcy_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
122pcy_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
123pcy_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
124pcy_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
125pcy_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
126pcy_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
127pcy_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
128pcy_lib.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
129pcy_lib.o: ../cryptlib.h pcy_int.h pcy_lib.c
130pcy_map.o: ../../e_os.h ../../include/openssl/asn1.h
131pcy_map.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
132pcy_map.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
133pcy_map.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
134pcy_map.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
135pcy_map.o: ../../include/openssl/err.h ../../include/openssl/evp.h
136pcy_map.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
137pcy_map.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
138pcy_map.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
139pcy_map.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
140pcy_map.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
141pcy_map.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
142pcy_map.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
143pcy_map.o: ../cryptlib.h pcy_int.h pcy_map.c
144pcy_node.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
145pcy_node.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
146pcy_node.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
147pcy_node.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
148pcy_node.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h
149pcy_node.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
150pcy_node.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
151pcy_node.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
152pcy_node.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
153pcy_node.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
154pcy_node.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
155pcy_node.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
156pcy_node.o: pcy_int.h pcy_node.c
157pcy_tree.o: ../../e_os.h ../../include/openssl/asn1.h
158pcy_tree.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
159pcy_tree.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
160pcy_tree.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
161pcy_tree.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
162pcy_tree.o: ../../include/openssl/err.h ../../include/openssl/evp.h
163pcy_tree.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
164pcy_tree.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
165pcy_tree.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
166pcy_tree.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
167pcy_tree.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
168pcy_tree.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
169pcy_tree.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
170pcy_tree.o: ../cryptlib.h pcy_int.h pcy_tree.c
171v3_addr.o: ../../e_os.h ../../include/openssl/asn1.h
172v3_addr.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
173v3_addr.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
174v3_addr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
175v3_addr.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
176v3_addr.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
177v3_addr.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
178v3_addr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
179v3_addr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
180v3_addr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
181v3_addr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
182v3_addr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
183v3_addr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
184v3_addr.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_addr.c
185v3_akey.o: ../../e_os.h ../../include/openssl/asn1.h
186v3_akey.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
187v3_akey.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
188v3_akey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
189v3_akey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
190v3_akey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
191v3_akey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
192v3_akey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
193v3_akey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
194v3_akey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
195v3_akey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
196v3_akey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
197v3_akey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
198v3_akey.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_akey.c
199v3_akeya.o: ../../e_os.h ../../include/openssl/asn1.h
200v3_akeya.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
201v3_akeya.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
202v3_akeya.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
203v3_akeya.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
204v3_akeya.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
205v3_akeya.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
206v3_akeya.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
207v3_akeya.o: ../../include/openssl/opensslconf.h
208v3_akeya.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
209v3_akeya.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
210v3_akeya.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
211v3_akeya.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
212v3_akeya.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
213v3_akeya.o: ../cryptlib.h v3_akeya.c
214v3_alt.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
215v3_alt.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
216v3_alt.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
217v3_alt.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
218v3_alt.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
219v3_alt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
220v3_alt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
221v3_alt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
222v3_alt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
223v3_alt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
224v3_alt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
225v3_alt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
226v3_alt.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_alt.c
227v3_asid.o: ../../e_os.h ../../include/openssl/asn1.h
228v3_asid.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
229v3_asid.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
230v3_asid.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
231v3_asid.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
232v3_asid.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
233v3_asid.o: ../../include/openssl/err.h ../../include/openssl/evp.h
234v3_asid.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
235v3_asid.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
236v3_asid.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
237v3_asid.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
238v3_asid.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
239v3_asid.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
240v3_asid.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
241v3_asid.o: ../cryptlib.h v3_asid.c
242v3_bcons.o: ../../e_os.h ../../include/openssl/asn1.h
243v3_bcons.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
244v3_bcons.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
245v3_bcons.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
246v3_bcons.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
247v3_bcons.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
248v3_bcons.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
249v3_bcons.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
250v3_bcons.o: ../../include/openssl/opensslconf.h
251v3_bcons.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
252v3_bcons.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
253v3_bcons.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
254v3_bcons.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
255v3_bcons.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
256v3_bcons.o: ../cryptlib.h v3_bcons.c
257v3_bitst.o: ../../e_os.h ../../include/openssl/asn1.h
258v3_bitst.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
259v3_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
260v3_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
261v3_bitst.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
262v3_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h
263v3_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
264v3_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
265v3_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
266v3_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
267v3_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
268v3_bitst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
269v3_bitst.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
270v3_bitst.o: ../cryptlib.h v3_bitst.c
271v3_conf.o: ../../e_os.h ../../include/openssl/asn1.h
272v3_conf.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
273v3_conf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
274v3_conf.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
275v3_conf.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
276v3_conf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
277v3_conf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
278v3_conf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
279v3_conf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
280v3_conf.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
281v3_conf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
282v3_conf.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
283v3_conf.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
284v3_conf.o: ../cryptlib.h v3_conf.c
285v3_cpols.o: ../../e_os.h ../../include/openssl/asn1.h
286v3_cpols.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
287v3_cpols.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
288v3_cpols.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
289v3_cpols.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
290v3_cpols.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
291v3_cpols.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
292v3_cpols.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
293v3_cpols.o: ../../include/openssl/opensslconf.h
294v3_cpols.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
295v3_cpols.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
296v3_cpols.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
297v3_cpols.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
298v3_cpols.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
299v3_cpols.o: ../cryptlib.h pcy_int.h v3_cpols.c
300v3_crld.o: ../../e_os.h ../../include/openssl/asn1.h
301v3_crld.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
302v3_crld.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
303v3_crld.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
304v3_crld.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
305v3_crld.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
306v3_crld.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
307v3_crld.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
308v3_crld.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
309v3_crld.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
310v3_crld.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
311v3_crld.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
312v3_crld.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
313v3_crld.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_crld.c
314v3_enum.o: ../../e_os.h ../../include/openssl/asn1.h
315v3_enum.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
316v3_enum.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
317v3_enum.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
318v3_enum.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
319v3_enum.o: ../../include/openssl/err.h ../../include/openssl/evp.h
320v3_enum.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
321v3_enum.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
322v3_enum.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
323v3_enum.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
324v3_enum.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
325v3_enum.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
326v3_enum.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
327v3_enum.o: ../cryptlib.h v3_enum.c
328v3_extku.o: ../../e_os.h ../../include/openssl/asn1.h
329v3_extku.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
330v3_extku.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
331v3_extku.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
332v3_extku.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
333v3_extku.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
334v3_extku.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
335v3_extku.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
336v3_extku.o: ../../include/openssl/opensslconf.h
337v3_extku.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
338v3_extku.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
339v3_extku.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
340v3_extku.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
341v3_extku.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
342v3_extku.o: ../cryptlib.h v3_extku.c
343v3_genn.o: ../../e_os.h ../../include/openssl/asn1.h
344v3_genn.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
345v3_genn.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
346v3_genn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
347v3_genn.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
348v3_genn.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
349v3_genn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
350v3_genn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
351v3_genn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
352v3_genn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
353v3_genn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
354v3_genn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
355v3_genn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
356v3_genn.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_genn.c
357v3_ia5.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
358v3_ia5.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
359v3_ia5.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
360v3_ia5.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
361v3_ia5.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
362v3_ia5.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
363v3_ia5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
364v3_ia5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
365v3_ia5.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
366v3_ia5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
367v3_ia5.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
368v3_ia5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
369v3_ia5.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_ia5.c
370v3_info.o: ../../e_os.h ../../include/openssl/asn1.h
371v3_info.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
372v3_info.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
373v3_info.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
374v3_info.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
375v3_info.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
376v3_info.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
377v3_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
378v3_info.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
379v3_info.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
380v3_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
381v3_info.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
382v3_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
383v3_info.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_info.c
384v3_int.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
385v3_int.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
386v3_int.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
387v3_int.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
388v3_int.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
389v3_int.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
390v3_int.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
391v3_int.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
392v3_int.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
393v3_int.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
394v3_int.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
395v3_int.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
396v3_int.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_int.c
397v3_lib.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
398v3_lib.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
399v3_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
400v3_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
401v3_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
402v3_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
403v3_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
404v3_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
405v3_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
406v3_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
407v3_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
408v3_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
409v3_lib.o: ../../include/openssl/x509v3.h ../cryptlib.h ext_dat.h v3_lib.c
410v3_ncons.o: ../../e_os.h ../../include/openssl/asn1.h
411v3_ncons.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
412v3_ncons.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
413v3_ncons.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
414v3_ncons.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
415v3_ncons.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
416v3_ncons.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
417v3_ncons.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
418v3_ncons.o: ../../include/openssl/opensslconf.h
419v3_ncons.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
420v3_ncons.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
421v3_ncons.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
422v3_ncons.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
423v3_ncons.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
424v3_ncons.o: ../cryptlib.h v3_ncons.c
425v3_ocsp.o: ../../e_os.h ../../include/openssl/asn1.h
426v3_ocsp.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
427v3_ocsp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
428v3_ocsp.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
429v3_ocsp.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
430v3_ocsp.o: ../../include/openssl/err.h ../../include/openssl/evp.h
431v3_ocsp.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
432v3_ocsp.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
433v3_ocsp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
434v3_ocsp.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
435v3_ocsp.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
436v3_ocsp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
437v3_ocsp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
438v3_ocsp.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_ocsp.c
439v3_pci.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
440v3_pci.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
441v3_pci.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
442v3_pci.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
443v3_pci.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
444v3_pci.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
445v3_pci.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
446v3_pci.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
447v3_pci.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
448v3_pci.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
449v3_pci.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
450v3_pci.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
451v3_pci.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_pci.c
452v3_pcia.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
453v3_pcia.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
454v3_pcia.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
455v3_pcia.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
456v3_pcia.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
457v3_pcia.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
458v3_pcia.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
459v3_pcia.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
460v3_pcia.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
461v3_pcia.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
462v3_pcia.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
463v3_pcia.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
464v3_pcia.o: ../../include/openssl/x509v3.h v3_pcia.c
465v3_pcons.o: ../../e_os.h ../../include/openssl/asn1.h
466v3_pcons.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
467v3_pcons.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
468v3_pcons.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
469v3_pcons.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
470v3_pcons.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
471v3_pcons.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
472v3_pcons.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
473v3_pcons.o: ../../include/openssl/opensslconf.h
474v3_pcons.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
475v3_pcons.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
476v3_pcons.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
477v3_pcons.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
478v3_pcons.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
479v3_pcons.o: ../cryptlib.h v3_pcons.c
480v3_pku.o: ../../e_os.h ../../include/openssl/asn1.h
481v3_pku.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
482v3_pku.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
483v3_pku.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
484v3_pku.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
485v3_pku.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
486v3_pku.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
487v3_pku.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
488v3_pku.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
489v3_pku.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
490v3_pku.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
491v3_pku.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
492v3_pku.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
493v3_pku.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_pku.c
494v3_pmaps.o: ../../e_os.h ../../include/openssl/asn1.h
495v3_pmaps.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
496v3_pmaps.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
497v3_pmaps.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
498v3_pmaps.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
499v3_pmaps.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
500v3_pmaps.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
501v3_pmaps.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
502v3_pmaps.o: ../../include/openssl/opensslconf.h
503v3_pmaps.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
504v3_pmaps.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
505v3_pmaps.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
506v3_pmaps.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
507v3_pmaps.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
508v3_pmaps.o: ../cryptlib.h v3_pmaps.c
509v3_prn.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
510v3_prn.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
511v3_prn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
512v3_prn.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
513v3_prn.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
514v3_prn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
515v3_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
516v3_prn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
517v3_prn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
518v3_prn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
519v3_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
520v3_prn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
521v3_prn.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_prn.c
522v3_purp.o: ../../e_os.h ../../include/openssl/asn1.h
523v3_purp.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
524v3_purp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
525v3_purp.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
526v3_purp.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
527v3_purp.o: ../../include/openssl/err.h ../../include/openssl/evp.h
528v3_purp.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
529v3_purp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
530v3_purp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
531v3_purp.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
532v3_purp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
533v3_purp.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
534v3_purp.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
535v3_purp.o: ../cryptlib.h v3_purp.c
536v3_skey.o: ../../e_os.h ../../include/openssl/asn1.h
537v3_skey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
538v3_skey.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
539v3_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
540v3_skey.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
541v3_skey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
542v3_skey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
543v3_skey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
544v3_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
545v3_skey.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
546v3_skey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
547v3_skey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
548v3_skey.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
549v3_skey.o: ../cryptlib.h v3_skey.c
550v3_sxnet.o: ../../e_os.h ../../include/openssl/asn1.h
551v3_sxnet.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
552v3_sxnet.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
553v3_sxnet.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
554v3_sxnet.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
555v3_sxnet.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
556v3_sxnet.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
557v3_sxnet.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
558v3_sxnet.o: ../../include/openssl/opensslconf.h
559v3_sxnet.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
560v3_sxnet.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
561v3_sxnet.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
562v3_sxnet.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
563v3_sxnet.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
564v3_sxnet.o: ../cryptlib.h v3_sxnet.c
565v3_utl.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
566v3_utl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
567v3_utl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
568v3_utl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
569v3_utl.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
570v3_utl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
571v3_utl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
572v3_utl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
573v3_utl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
574v3_utl.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
575v3_utl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
576v3_utl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
577v3_utl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
578v3_utl.o: ../cryptlib.h v3_utl.c
579v3err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
580v3err.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
581v3err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
582v3err.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
583v3err.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
584v3err.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
585v3err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
586v3err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
587v3err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
588v3err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
589v3err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
590v3err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
591v3err.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
5DIR= x509v3
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I$(TOP) -I../../include
9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl
12INSTALLTOP=/usr/local/ssl
13MAKE= make -f Makefile.ssl
14MAKEDEPPROG= makedepend
15MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
16MAKEFILE= Makefile.ssl
17AR= ar r
18
19CFLAGS= $(INCLUDES) $(CFLAG)
20
21GENERAL=Makefile README
22TEST=
23APPS=
24
25LIB=$(TOP)/libcrypto.a
26LIBSRC= v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c v3_lib.c \
27v3_prn.c v3_utl.c v3err.c v3_genn.c v3_alt.c v3_skey.c v3_akey.c v3_pku.c \
28v3_int.c v3_enum.c v3_sxnet.c v3_cpols.c v3_crld.c v3_purp.c v3_info.c \
29v3_ocsp.c v3_akeya.c
30LIBOBJ= v3_bcons.o v3_bitst.o v3_conf.o v3_extku.o v3_ia5.o v3_lib.o \
31v3_prn.o v3_utl.o v3err.o v3_genn.o v3_alt.o v3_skey.o v3_akey.o v3_pku.o \
32v3_int.o v3_enum.o v3_sxnet.o v3_cpols.o v3_crld.o v3_purp.o v3_info.o \
33v3_ocsp.o v3_akeya.o
34
35SRC= $(LIBSRC)
36
37EXHEADER= x509v3.h
38HEADER= $(EXHEADER)
39
40ALL= $(GENERAL) $(SRC) $(HEADER)
41
42top:
43 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
44
45all: lib
46
47lib: $(LIBOBJ)
48 $(AR) $(LIB) $(LIBOBJ)
49 $(RANLIB) $(LIB) || echo Never mind.
50 @touch lib
51
52files:
53 $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
54
55links:
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
61install:
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
68tags:
69 ctags $(SRC)
70
71tests:
72
73lint:
74 lint -DLINT $(INCLUDES) $(SRC)>fluff
75
76depend:
77 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
78
79dclean:
80 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
81 mv -f Makefile.new $(MAKEFILE)
82
83clean:
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
88v3_akey.o: ../../e_os.h ../../include/openssl/aes.h
89v3_akey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
90v3_akey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
91v3_akey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
92v3_akey.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
93v3_akey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
94v3_akey.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
95v3_akey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
96v3_akey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
97v3_akey.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
98v3_akey.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
99v3_akey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
100v3_akey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
101v3_akey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
102v3_akey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
103v3_akey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
104v3_akey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
105v3_akey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
106v3_akey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
107v3_akey.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
108v3_akey.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
109v3_akey.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
110v3_akey.o: ../cryptlib.h v3_akey.c
111v3_akeya.o: ../../e_os.h ../../include/openssl/aes.h
112v3_akeya.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
113v3_akeya.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
114v3_akeya.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
115v3_akeya.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
116v3_akeya.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
117v3_akeya.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
118v3_akeya.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
119v3_akeya.o: ../../include/openssl/err.h ../../include/openssl/evp.h
120v3_akeya.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
121v3_akeya.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
122v3_akeya.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
123v3_akeya.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
124v3_akeya.o: ../../include/openssl/opensslconf.h
125v3_akeya.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
126v3_akeya.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
127v3_akeya.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
128v3_akeya.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
129v3_akeya.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
130v3_akeya.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
131v3_akeya.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
132v3_akeya.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
133v3_akeya.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_akeya.c
134v3_alt.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
135v3_alt.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
136v3_alt.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
137v3_alt.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
138v3_alt.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
139v3_alt.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
140v3_alt.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
141v3_alt.o: ../../include/openssl/err.h ../../include/openssl/evp.h
142v3_alt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
143v3_alt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
144v3_alt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
145v3_alt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
146v3_alt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
147v3_alt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
148v3_alt.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
149v3_alt.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
150v3_alt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
151v3_alt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
152v3_alt.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
153v3_alt.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
154v3_alt.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
155v3_alt.o: ../cryptlib.h v3_alt.c
156v3_bcons.o: ../../e_os.h ../../include/openssl/aes.h
157v3_bcons.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
158v3_bcons.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
159v3_bcons.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
160v3_bcons.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
161v3_bcons.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
162v3_bcons.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
163v3_bcons.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
164v3_bcons.o: ../../include/openssl/err.h ../../include/openssl/evp.h
165v3_bcons.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
166v3_bcons.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
167v3_bcons.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
168v3_bcons.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
169v3_bcons.o: ../../include/openssl/opensslconf.h
170v3_bcons.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
171v3_bcons.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
172v3_bcons.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
173v3_bcons.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
174v3_bcons.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
175v3_bcons.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
176v3_bcons.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
177v3_bcons.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
178v3_bcons.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_bcons.c
179v3_bitst.o: ../../e_os.h ../../include/openssl/aes.h
180v3_bitst.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
181v3_bitst.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
182v3_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
183v3_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
184v3_bitst.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
185v3_bitst.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
186v3_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
187v3_bitst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
188v3_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
189v3_bitst.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
190v3_bitst.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
191v3_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
192v3_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
193v3_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
194v3_bitst.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
195v3_bitst.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
196v3_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
197v3_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
198v3_bitst.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
199v3_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
200v3_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_bitst.c
201v3_conf.o: ../../e_os.h ../../include/openssl/aes.h
202v3_conf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
203v3_conf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
204v3_conf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
205v3_conf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
206v3_conf.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
207v3_conf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
208v3_conf.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
209v3_conf.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
210v3_conf.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
211v3_conf.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
212v3_conf.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
213v3_conf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
214v3_conf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
215v3_conf.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
216v3_conf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
217v3_conf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
218v3_conf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
219v3_conf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
220v3_conf.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
221v3_conf.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
222v3_conf.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_conf.c
223v3_cpols.o: ../../e_os.h ../../include/openssl/aes.h
224v3_cpols.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
225v3_cpols.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
226v3_cpols.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
227v3_cpols.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
228v3_cpols.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
229v3_cpols.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
230v3_cpols.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
231v3_cpols.o: ../../include/openssl/err.h ../../include/openssl/evp.h
232v3_cpols.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
233v3_cpols.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
234v3_cpols.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
235v3_cpols.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
236v3_cpols.o: ../../include/openssl/opensslconf.h
237v3_cpols.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
238v3_cpols.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
239v3_cpols.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
240v3_cpols.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
241v3_cpols.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
242v3_cpols.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
243v3_cpols.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
244v3_cpols.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
245v3_cpols.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_cpols.c
246v3_crld.o: ../../e_os.h ../../include/openssl/aes.h
247v3_crld.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
248v3_crld.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
249v3_crld.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
250v3_crld.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
251v3_crld.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
252v3_crld.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
253v3_crld.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
254v3_crld.o: ../../include/openssl/err.h ../../include/openssl/evp.h
255v3_crld.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
256v3_crld.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
257v3_crld.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
258v3_crld.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
259v3_crld.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
260v3_crld.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
261v3_crld.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
262v3_crld.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
263v3_crld.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
264v3_crld.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
265v3_crld.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
266v3_crld.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
267v3_crld.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
268v3_crld.o: ../cryptlib.h v3_crld.c
269v3_enum.o: ../../e_os.h ../../include/openssl/aes.h
270v3_enum.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
271v3_enum.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
272v3_enum.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
273v3_enum.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
274v3_enum.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
275v3_enum.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
276v3_enum.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
277v3_enum.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
278v3_enum.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
279v3_enum.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
280v3_enum.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
281v3_enum.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
282v3_enum.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
283v3_enum.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
284v3_enum.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
285v3_enum.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
286v3_enum.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
287v3_enum.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
288v3_enum.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
289v3_enum.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
290v3_enum.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_enum.c
291v3_extku.o: ../../e_os.h ../../include/openssl/aes.h
292v3_extku.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
293v3_extku.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
294v3_extku.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
295v3_extku.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
296v3_extku.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
297v3_extku.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
298v3_extku.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
299v3_extku.o: ../../include/openssl/err.h ../../include/openssl/evp.h
300v3_extku.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
301v3_extku.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
302v3_extku.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
303v3_extku.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
304v3_extku.o: ../../include/openssl/opensslconf.h
305v3_extku.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
306v3_extku.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
307v3_extku.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
308v3_extku.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
309v3_extku.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
310v3_extku.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
311v3_extku.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
312v3_extku.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
313v3_extku.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_extku.c
314v3_genn.o: ../../e_os.h ../../include/openssl/aes.h
315v3_genn.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
316v3_genn.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
317v3_genn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
318v3_genn.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
319v3_genn.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
320v3_genn.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
321v3_genn.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
322v3_genn.o: ../../include/openssl/err.h ../../include/openssl/evp.h
323v3_genn.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
324v3_genn.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
325v3_genn.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
326v3_genn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
327v3_genn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
328v3_genn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
329v3_genn.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
330v3_genn.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
331v3_genn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
332v3_genn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
333v3_genn.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
334v3_genn.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
335v3_genn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
336v3_genn.o: ../cryptlib.h v3_genn.c
337v3_ia5.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
338v3_ia5.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
339v3_ia5.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
340v3_ia5.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
341v3_ia5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
342v3_ia5.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
343v3_ia5.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
344v3_ia5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
345v3_ia5.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
346v3_ia5.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
347v3_ia5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
348v3_ia5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
349v3_ia5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
350v3_ia5.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
351v3_ia5.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
352v3_ia5.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
353v3_ia5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
354v3_ia5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
355v3_ia5.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
356v3_ia5.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
357v3_ia5.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
358v3_ia5.o: ../cryptlib.h v3_ia5.c
359v3_info.o: ../../e_os.h ../../include/openssl/aes.h
360v3_info.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
361v3_info.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
362v3_info.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
363v3_info.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
364v3_info.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
365v3_info.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
366v3_info.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
367v3_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h
368v3_info.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
369v3_info.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
370v3_info.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
371v3_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
372v3_info.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
373v3_info.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
374v3_info.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
375v3_info.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
376v3_info.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
377v3_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
378v3_info.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
379v3_info.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
380v3_info.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
381v3_info.o: ../cryptlib.h v3_info.c
382v3_int.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
383v3_int.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
384v3_int.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
385v3_int.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
386v3_int.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
387v3_int.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
388v3_int.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
389v3_int.o: ../../include/openssl/err.h ../../include/openssl/evp.h
390v3_int.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
391v3_int.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
392v3_int.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
393v3_int.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
394v3_int.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
395v3_int.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
396v3_int.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
397v3_int.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
398v3_int.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
399v3_int.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
400v3_int.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
401v3_int.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
402v3_int.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
403v3_int.o: ../cryptlib.h v3_int.c
404v3_lib.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
405v3_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
406v3_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
407v3_lib.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
408v3_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
409v3_lib.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
410v3_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
411v3_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
412v3_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
413v3_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
414v3_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
415v3_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
416v3_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
417v3_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
418v3_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
419v3_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
420v3_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
421v3_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
422v3_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
423v3_lib.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
424v3_lib.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
425v3_lib.o: ../cryptlib.h ext_dat.h v3_lib.c
426v3_ocsp.o: ../../e_os.h ../../include/openssl/aes.h
427v3_ocsp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
428v3_ocsp.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
429v3_ocsp.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
430v3_ocsp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
431v3_ocsp.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
432v3_ocsp.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
433v3_ocsp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
434v3_ocsp.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
435v3_ocsp.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
436v3_ocsp.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
437v3_ocsp.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
438v3_ocsp.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
439v3_ocsp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
440v3_ocsp.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
441v3_ocsp.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
442v3_ocsp.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
443v3_ocsp.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
444v3_ocsp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
445v3_ocsp.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
446v3_ocsp.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
447v3_ocsp.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
448v3_ocsp.o: ../cryptlib.h v3_ocsp.c
449v3_pku.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
450v3_pku.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
451v3_pku.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
452v3_pku.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
453v3_pku.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
454v3_pku.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
455v3_pku.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
456v3_pku.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
457v3_pku.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
458v3_pku.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
459v3_pku.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
460v3_pku.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
461v3_pku.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
462v3_pku.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
463v3_pku.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
464v3_pku.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
465v3_pku.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
466v3_pku.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
467v3_pku.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
468v3_pku.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
469v3_pku.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
470v3_pku.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_pku.c
471v3_prn.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
472v3_prn.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
473v3_prn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
474v3_prn.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
475v3_prn.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
476v3_prn.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
477v3_prn.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
478v3_prn.o: ../../include/openssl/err.h ../../include/openssl/evp.h
479v3_prn.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
480v3_prn.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
481v3_prn.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
482v3_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
483v3_prn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
484v3_prn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
485v3_prn.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
486v3_prn.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
487v3_prn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
488v3_prn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
489v3_prn.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
490v3_prn.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
491v3_prn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
492v3_prn.o: ../cryptlib.h v3_prn.c
493v3_purp.o: ../../e_os.h ../../include/openssl/aes.h
494v3_purp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
495v3_purp.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
496v3_purp.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
497v3_purp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
498v3_purp.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
499v3_purp.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
500v3_purp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
501v3_purp.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
502v3_purp.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
503v3_purp.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
504v3_purp.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
505v3_purp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
506v3_purp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
507v3_purp.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
508v3_purp.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
509v3_purp.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
510v3_purp.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
511v3_purp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
512v3_purp.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
513v3_purp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
514v3_purp.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_purp.c
515v3_skey.o: ../../e_os.h ../../include/openssl/aes.h
516v3_skey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
517v3_skey.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
518v3_skey.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
519v3_skey.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
520v3_skey.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
521v3_skey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
522v3_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
523v3_skey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
524v3_skey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
525v3_skey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
526v3_skey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
527v3_skey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
528v3_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
529v3_skey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
530v3_skey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
531v3_skey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
532v3_skey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
533v3_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
534v3_skey.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
535v3_skey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
536v3_skey.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_skey.c
537v3_sxnet.o: ../../e_os.h ../../include/openssl/aes.h
538v3_sxnet.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
539v3_sxnet.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
540v3_sxnet.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
541v3_sxnet.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
542v3_sxnet.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
543v3_sxnet.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
544v3_sxnet.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
545v3_sxnet.o: ../../include/openssl/err.h ../../include/openssl/evp.h
546v3_sxnet.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
547v3_sxnet.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
548v3_sxnet.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
549v3_sxnet.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
550v3_sxnet.o: ../../include/openssl/opensslconf.h
551v3_sxnet.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
552v3_sxnet.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
553v3_sxnet.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
554v3_sxnet.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
555v3_sxnet.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
556v3_sxnet.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
557v3_sxnet.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
558v3_sxnet.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
559v3_sxnet.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_sxnet.c
560v3_utl.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h
561v3_utl.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
562v3_utl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
563v3_utl.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
564v3_utl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
565v3_utl.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
566v3_utl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
567v3_utl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
568v3_utl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
569v3_utl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
570v3_utl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
571v3_utl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
572v3_utl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
573v3_utl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
574v3_utl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
575v3_utl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
576v3_utl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
577v3_utl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
578v3_utl.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
579v3_utl.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
580v3_utl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
581v3_utl.o: ../cryptlib.h v3_utl.c
582v3err.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
583v3err.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
584v3err.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
585v3err.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
586v3err.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
587v3err.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
588v3err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
589v3err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
590v3err.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
591v3err.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
592v3err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
593v3err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
594v3err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
595v3err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
596v3err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
597v3err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
598v3err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
599v3err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
600v3err.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
601v3err.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
602v3err.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
603v3err.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;
61extern X509V3_EXT_METHOD v3_pkey_usage_period, v3_sxnet, v3_info, v3_sinfo; 61extern X509V3_EXT_METHOD v3_pkey_usage_period, v3_sxnet, v3_info, v3_sinfo;
62extern X509V3_EXT_METHOD v3_ns_ia5_list[], v3_alt[], v3_skey_id, v3_akey_id; 62extern X509V3_EXT_METHOD v3_ns_ia5_list[], v3_alt[], v3_skey_id, v3_akey_id;
63extern X509V3_EXT_METHOD v3_crl_num, v3_crl_reason, v3_crl_invdate; 63extern X509V3_EXT_METHOD v3_crl_num, v3_crl_reason, v3_crl_invdate;
64extern X509V3_EXT_METHOD v3_delta_crl, v3_cpols, v3_crld, v3_freshest_crl; 64extern X509V3_EXT_METHOD v3_delta_crl, v3_cpols, v3_crld;
65extern X509V3_EXT_METHOD v3_ocsp_nonce, v3_ocsp_accresp, v3_ocsp_acutoff; 65extern X509V3_EXT_METHOD v3_ocsp_nonce, v3_ocsp_accresp, v3_ocsp_acutoff;
66extern X509V3_EXT_METHOD v3_ocsp_crlid, v3_ocsp_nocheck, v3_ocsp_serviceloc; 66extern X509V3_EXT_METHOD v3_ocsp_crlid, v3_ocsp_nocheck, v3_ocsp_serviceloc;
67extern X509V3_EXT_METHOD v3_crl_hold, v3_pci; 67extern X509V3_EXT_METHOD v3_crl_hold, v3_pci;
68extern X509V3_EXT_METHOD v3_policy_mappings, v3_policy_constraints; 68extern X509V3_EXT_METHOD v3_policy_mappings, v3_policy_constraints;
69extern X509V3_EXT_METHOD v3_name_constraints, v3_inhibit_anyp, v3_idp; 69extern X509V3_EXT_METHOD v3_name_constraints, v3_inhibit_anyp;
70#ifndef OPENSSL_NO_RFC3779
70extern X509V3_EXT_METHOD v3_addr, v3_asid; 71extern 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
76static const X509V3_EXT_METHOD *standard_exts[] = { 78static 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
85X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, 85X509_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
73static 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
96static 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
310static 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
375static 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
403static 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
443static int tree_link_any(X509_POLICY_LEVEL *curr, 283static 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
505static int tree_prune(X509_POLICY_TREE *tree, X509_POLICY_LEVEL *curr) 338static 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
69main()
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
78ASN1_SEQUENCE(IPAddressRange) = {
79 ASN1_SIMPLE(IPAddressRange, min, ASN1_BIT_STRING),
80 ASN1_SIMPLE(IPAddressRange, max, ASN1_BIT_STRING)
81} ASN1_SEQUENCE_END(IPAddressRange)
82
83ASN1_CHOICE(IPAddressOrRange) = {
84 ASN1_SIMPLE(IPAddressOrRange, u.addressPrefix, ASN1_BIT_STRING),
85 ASN1_SIMPLE(IPAddressOrRange, u.addressRange, IPAddressRange)
86} ASN1_CHOICE_END(IPAddressOrRange)
87
88ASN1_CHOICE(IPAddressChoice) = {
89 ASN1_SIMPLE(IPAddressChoice, u.inherit, ASN1_NULL),
90 ASN1_SEQUENCE_OF(IPAddressChoice, u.addressesOrRanges, IPAddressOrRange)
91} ASN1_CHOICE_END(IPAddressChoice)
92
93ASN1_SEQUENCE(IPAddressFamily) = {
94 ASN1_SIMPLE(IPAddressFamily, addressFamily, ASN1_OCTET_STRING),
95 ASN1_SIMPLE(IPAddressFamily, ipAddressChoice, IPAddressChoice)
96} ASN1_SEQUENCE_END(IPAddressFamily)
97
98ASN1_ITEM_TEMPLATE(IPAddrBlocks) =
99 ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0,
100 IPAddrBlocks, IPAddressFamily)
101ASN1_ITEM_TEMPLATE_END(IPAddrBlocks)
102
103IMPLEMENT_ASN1_FUNCTIONS(IPAddressRange)
104IMPLEMENT_ASN1_FUNCTIONS(IPAddressOrRange)
105IMPLEMENT_ASN1_FUNCTIONS(IPAddressChoice)
106IMPLEMENT_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 */
116static 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 */
131unsigned 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 */
145static 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 */
172static 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 */
208static 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 */
239static 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 */
313static 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 */
354static 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 */
364static 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 */
374static 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 */
409static 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 */
444static 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 */
507static 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 */
556int 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 */
579static 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 */
613int 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 */
632int 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 */
654static 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 */
675int 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 */
701static 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 */
714int 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 */
820static 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 */
873int 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 */
892static 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 */
1052const 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 */
1069int 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 */
1085static 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 */
1121int 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 */
1164static 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 */
1264int 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 */
1273int 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,
84NULL, NULL, NULL}, 84NULL, NULL, NULL},
85
86{ NID_certificate_issuer, 0, ASN1_ITEM_ref(GENERAL_NAMES),
870,0,0,0,
880,0,
89(X509V3_EXT_I2V)i2v_GENERAL_NAMES,
90NULL, NULL, NULL, NULL},
91}; 85};
92 86
93STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, 87STACK_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
396GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method, 389GENERAL_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
418GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, 411GENERAL_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
424GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, 417GENERAL_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
524GENERAL_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
566static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) 535static 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
79ASN1_SEQUENCE(ASRange) = {
80 ASN1_SIMPLE(ASRange, min, ASN1_INTEGER),
81 ASN1_SIMPLE(ASRange, max, ASN1_INTEGER)
82} ASN1_SEQUENCE_END(ASRange)
83
84ASN1_CHOICE(ASIdOrRange) = {
85 ASN1_SIMPLE(ASIdOrRange, u.id, ASN1_INTEGER),
86 ASN1_SIMPLE(ASIdOrRange, u.range, ASRange)
87} ASN1_CHOICE_END(ASIdOrRange)
88
89ASN1_CHOICE(ASIdentifierChoice) = {
90 ASN1_SIMPLE(ASIdentifierChoice, u.inherit, ASN1_NULL),
91 ASN1_SEQUENCE_OF(ASIdentifierChoice, u.asIdsOrRanges, ASIdOrRange)
92} ASN1_CHOICE_END(ASIdentifierChoice)
93
94ASN1_SEQUENCE(ASIdentifiers) = {
95 ASN1_EXP_OPT(ASIdentifiers, asnum, ASIdentifierChoice, 0),
96 ASN1_EXP_OPT(ASIdentifiers, rdi, ASIdentifierChoice, 1)
97} ASN1_SEQUENCE_END(ASIdentifiers)
98
99IMPLEMENT_ASN1_FUNCTIONS(ASRange)
100IMPLEMENT_ASN1_FUNCTIONS(ASIdOrRange)
101IMPLEMENT_ASN1_FUNCTIONS(ASIdentifierChoice)
102IMPLEMENT_ASN1_FUNCTIONS(ASIdentifiers)
103
104/*
105 * i2r method for an ASIdentifierChoice.
106 */
107static 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 */
155static 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 */
170static 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 */
200int 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 */
229int 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 */
285static 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 */
305static 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 */
373int 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 */
383static 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 */
488int 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 */
498static 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 */
611const 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 */
628int 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 */
640static 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 */
671int 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 */
704static 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 */
820int 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 */
829int 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
72static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, int crit, int type, X509V3_CTX *ctx); 72static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, int crit, int type, X509V3_CTX *ctx);
73static char *conf_lhash_get_string(void *db, char *section, char *value); 73static char *conf_lhash_get_string(void *db, char *section, char *value);
74static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db, char *section); 74static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db, char *section);
75static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, 75static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid,
76 int crit, void *ext_struc); 76 int crit, void *ext_struc);
77static unsigned char *generic_asn1(char *value, X509V3_CTX *ctx, long *ext_len); 77static 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 */
81X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, 81X509_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 */
101X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, 101X509_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 */
115static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, 115static 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
175static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, 175static 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
215X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc) 215X509_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 */
260static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, 260static 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
325int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, 324int 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
346int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, 345int 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
357int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, 356int 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
446void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req, 445void 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
458X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, 457X509_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 */
468X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, 467X509_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,
490NULL 489NULL
491}; 490};
492 491
493void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash) 492void 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
499int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, 498int 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
509int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, 508int 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
519int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, 518int 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
455IMPLEMENT_STACK_OF(X509_POLICY_NODE) 454IMPLEMENT_STACK_OF(X509_POLICY_NODE)
456IMPLEMENT_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
66static void *v2i_crld(const X509V3_EXT_METHOD *method, 66static 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);
68static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out, 68static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method,
69 int indent); 69 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
70 70
71const X509V3_EXT_METHOD v3_crld = 71const X509V3_EXT_METHOD v3_crld = {
72 { 72NID_crl_distribution_points, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(CRL_DIST_POINTS),
73 NID_crl_distribution_points, 0, ASN1_ITEM_ref(CRL_DIST_POINTS), 730,0,0,0,
74 0,0,0,0, 740,0,
75 0,0, 75(X509V3_EXT_I2V)i2v_crld,
76 0, 76(X509V3_EXT_V2I)v2i_crld,
77 v2i_crld, 770,0,
78 i2r_crldp,0, 78NULL
79 NULL
80 };
81
82const 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
93static 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
115static 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
193static 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
206static int set_reasons(ASN1_BIT_STRING **preas, char *value) 81static 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
246static 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
270static 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
311static void *v2i_crld(const X509V3_EXT_METHOD *method, 102static 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,
373IMPLEMENT_STACK_OF(DIST_POINT) 139IMPLEMENT_STACK_OF(DIST_POINT)
374IMPLEMENT_ASN1_SET_OF(DIST_POINT) 140IMPLEMENT_ASN1_SET_OF(DIST_POINT)
375 141
376static 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
396ASN1_CHOICE_cb(DIST_POINT_NAME, dpn_cb) = { 143ASN1_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
402IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT_NAME) 148IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT_NAME)
403 149
@@ -414,203 +160,3 @@ ASN1_ITEM_TEMPLATE(CRL_DIST_POINTS) =
414ASN1_ITEM_TEMPLATE_END(CRL_DIST_POINTS) 160ASN1_ITEM_TEMPLATE_END(CRL_DIST_POINTS)
415 161
416IMPLEMENT_ASN1_FUNCTIONS(CRL_DIST_POINTS) 162IMPLEMENT_ASN1_FUNCTIONS(CRL_DIST_POINTS)
417
418ASN1_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
427IMPLEMENT_ASN1_FUNCTIONS(ISSUING_DIST_POINT)
428
429static int i2r_idp(const X509V3_EXT_METHOD *method, void *pidp, BIO *out,
430 int indent);
431static void *v2i_idp(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
432 STACK_OF(CONF_VALUE) *nval);
433
434const 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
446static 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
507static 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
519static 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
538static 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
563static 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
587int 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
63static ENUMERATED_NAMES crl_reasons[] = { 63static 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
66static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, 66static 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); 68static STACK_OF(CONF_VALUE) *i2v_EXTENDED_KEY_USAGE(X509V3_EXT_METHOD *method,
69static 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
72const X509V3_EXT_METHOD v3_ext_ku = { 71const X509V3_EXT_METHOD v3_ext_ku = {
@@ -98,9 +97,8 @@ ASN1_ITEM_TEMPLATE_END(EXTENDED_KEY_USAGE)
98 97
99IMPLEMENT_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) 98IMPLEMENT_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE)
100 99
101static STACK_OF(CONF_VALUE) * 100static 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
117static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method, 115static 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) =
99ASN1_ITEM_TEMPLATE_END(GENERAL_NAMES) 99ASN1_ITEM_TEMPLATE_END(GENERAL_NAMES)
100 100
101IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAMES) 101IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAMES)
102
103GENERAL_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. */
111int 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. */
149int 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
162void 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
196void *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
228int 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
241int 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
86static int ext_cmp(const X509V3_EXT_METHOD * const *a, 86static 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
92DECLARE_OBJ_BSEARCH_CMP_FN(const X509V3_EXT_METHOD *, const X509V3_EXT_METHOD *, 92X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid)
93 ext);
94IMPLEMENT_OBJ_BSEARCH_CMP_FN(const X509V3_EXT_METHOD *,
95 const X509V3_EXT_METHOD *, ext);
96
97const 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
112const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext) 108X509V3_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
127int X509V3_EXT_add_alias(int nid_to, int nid_from) 123int 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
168void *X509V3_EXT_d2i(X509_EXTENSION *ext) 162void *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
71static int i2r_ocsp_crlid(const X509V3_EXT_METHOD *method, void *nonce, 71static int i2r_ocsp_crlid(X509V3_EXT_METHOD *method, void *nonce, BIO *out, int indent);
72 BIO *out, int indent); 72static int i2r_ocsp_acutoff(X509V3_EXT_METHOD *method, void *nonce, BIO *out, int indent);
73static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *nonce, 73static int i2r_object(X509V3_EXT_METHOD *method, void *obj, BIO *out, int indent);
74 BIO *out, int indent);
75static int i2r_object(const X509V3_EXT_METHOD *method, void *obj, BIO *out,
76 int indent);
77 74
78static void *ocsp_nonce_new(void); 75static void *ocsp_nonce_new(void);
79static int i2d_ocsp_nonce(void *a, unsigned char **pp); 76static int i2d_ocsp_nonce(void *a, unsigned char **pp);
80static void *d2i_ocsp_nonce(void *a, const unsigned char **pp, long length); 77static void *d2i_ocsp_nonce(void *a, const unsigned char **pp, long length);
81static void ocsp_nonce_free(void *a); 78static void ocsp_nonce_free(void *a);
82static int i2r_ocsp_nonce(const X509V3_EXT_METHOD *method, void *nonce, 79static int i2r_ocsp_nonce(X509V3_EXT_METHOD *method, void *nonce, BIO *out, int indent);
83 BIO *out, int indent);
84 80
85static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, 81static int i2r_ocsp_nocheck(X509V3_EXT_METHOD *method, void *nocheck, BIO *out, int indent);
86 void *nocheck, BIO *out, int indent); 82static void *s2i_ocsp_nocheck(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, const char *str);
87static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, 83static int i2r_ocsp_serviceloc(X509V3_EXT_METHOD *method, void *in, BIO *bp, int ind);
88 const char *str);
89static int i2r_ocsp_serviceloc(const X509V3_EXT_METHOD *method, void *in,
90 BIO *bp, int ind);
91 84
92const X509V3_EXT_METHOD v3_ocsp_crlid = { 85const 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
158static int i2r_ocsp_crlid(const X509V3_EXT_METHOD *method, void *in, BIO *bp, 151static 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
185static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *cutoff, 177static 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
194static int i2r_object(const X509V3_EXT_METHOD *method, void *oid, BIO *bp, 185static 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
245static int i2r_ocsp_nonce(const X509V3_EXT_METHOD *method, void *nonce, 235static 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
255static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, void *nocheck, 244static 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
261static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, 249static 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
267static int i2r_ocsp_serviceloc(const X509V3_EXT_METHOD *method, void *in, 254static 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);
71static int check_purpose_smime_sign(const X509_PURPOSE *xp, const X509 *x, int ca); 71static int check_purpose_smime_sign(const X509_PURPOSE *xp, const X509 *x, int ca);
72static int check_purpose_smime_encrypt(const X509_PURPOSE *xp, const X509 *x, int ca); 72static int check_purpose_smime_encrypt(const X509_PURPOSE *xp, const X509 *x, int ca);
73static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, int ca); 73static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, int ca);
74static int check_purpose_timestamp_sign(const X509_PURPOSE *xp, const X509 *x, int ca);
75static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca); 74static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca);
76static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca); 75static 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
270static int nid_cmp(const int *a, const int *b) 268static int nid_cmp(int *a, int *b)
271 { 269 {
272 return *a - *b; 270 return *a - *b;
273 } 271 }
274 272
275DECLARE_OBJ_BSEARCH_CMP_FN(int, int, nid);
276IMPLEMENT_OBJ_BSEARCH_CMP_FN(int, int, nid);
277
278int X509_supported_extension(X509_EXTENSION *ex) 273int 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
317static 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
349static 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
357static void x509v3_cache_extensions(X509 *x) 314static 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
649static 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
684static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca) 597static 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
726int 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
68static char *strip_spaces(char *name); 68static char *strip_spaces(char *name);
69static int sk_strcmp(const char * const *a, const char * const *b); 69static int sk_strcmp(const char * const *a, const char * const *b);
70static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens); 70static STACK *get_email(X509_NAME *name, GENERAL_NAMES *gens);
71static void str_free(OPENSSL_STRING str); 71static void str_free(void *str);
72static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email); 72static int append_ia5(STACK **sk, ASN1_IA5STRING *email);
73 73
74static int ipv4_from_asc(unsigned char *v4, const char *in); 74static int ipv4_from_asc(unsigned char *v4, const char *in);
75static int ipv6_from_asc(unsigned char *v6, const char *in); 75static 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
363char *hex_to_string(const unsigned char *buffer, long len) 363char *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
392unsigned char *string_to_hex(const char *str, long *len) 392unsigned 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
466STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x) 466STACK *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
477STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x) 476STACK *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
502STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x) 500STACK *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
517static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name, GENERAL_NAMES *gens) 514static 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
542static void str_free(OPENSSL_STRING str) 539static void str_free(void *str)
543{ 540{
544 OPENSSL_free(str); 541 OPENSSL_free(str);
545} 542}
546 543
547static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email) 544static 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
566void X509_email_free(STACK_OF(OPENSSL_STRING) *sk) 563void 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
69int 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
71static ERR_STRING_DATA X509V3_str_functs[]= 71static 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
67int 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);
76typedef void (*X509V3_EXT_FREE)(void *); 76typedef void (*X509V3_EXT_FREE)(void *);
77typedef void * (*X509V3_EXT_D2I)(void *, const unsigned char ** , long); 77typedef void * (*X509V3_EXT_D2I)(void *, const unsigned char ** , long);
78typedef int (*X509V3_EXT_I2D)(void *, unsigned char **); 78typedef int (*X509V3_EXT_I2D)(void *, unsigned char **);
79typedef STACK_OF(CONF_VALUE) * 79typedef 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, 80typedef 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); 81typedef char * (*X509V3_EXT_I2S)(struct v3_ext_method *method, void *ext);
82typedef void * (*X509V3_EXT_V2I)(const struct v3_ext_method *method, 82typedef void * (*X509V3_EXT_S2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, const char *str);
83 struct v3_ext_ctx *ctx, 83typedef int (*X509V3_EXT_I2R)(struct v3_ext_method *method, void *ext, BIO *out, int indent);
84 STACK_OF(CONF_VALUE) *values); 84typedef void * (*X509V3_EXT_R2I)(struct v3_ext_method *method, struct v3_ext_ctx *ctx, const char *str);
85typedef char * (*X509V3_EXT_I2S)(const struct v3_ext_method *method, void *ext);
86typedef void * (*X509V3_EXT_S2I)(const struct v3_ext_method *method,
87 struct v3_ext_ctx *ctx, const char *str);
88typedef int (*X509V3_EXT_I2R)(const struct v3_ext_method *method, void *ext,
89 BIO *out, int indent);
90typedef 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 */
231X509_NAME *dpname;
232} DIST_POINT_NAME; 223} DIST_POINT_NAME;
233/* All existing reasons */ 224
234#define CRLDP_ALL_REASONS 0x807f 225typedef 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
248struct DIST_POINT_st {
249DIST_POINT_NAME *distpoint; 226DIST_POINT_NAME *distpoint;
250ASN1_BIT_STRING *reasons; 227ASN1_BIT_STRING *reasons;
251GENERAL_NAMES *CRLissuer; 228GENERAL_NAMES *CRLissuer;
252int dp_reasons; 229} DIST_POINT;
253};
254 230
255typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS; 231typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;
256 232
257DECLARE_STACK_OF(DIST_POINT) 233DECLARE_STACK_OF(DIST_POINT)
258DECLARE_ASN1_SET_OF(DIST_POINT) 234DECLARE_ASN1_SET_OF(DIST_POINT)
259 235
260struct AUTHORITY_KEYID_st { 236typedef struct AUTHORITY_KEYID_st {
261ASN1_OCTET_STRING *keyid; 237ASN1_OCTET_STRING *keyid;
262GENERAL_NAMES *issuer; 238GENERAL_NAMES *issuer;
263ASN1_INTEGER *serial; 239ASN1_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
328DECLARE_STACK_OF(GENERAL_SUBTREE) 304DECLARE_STACK_OF(GENERAL_SUBTREE)
329 305
330struct NAME_CONSTRAINTS_st { 306typedef 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
335typedef struct POLICY_CONSTRAINTS_st { 311typedef struct POLICY_CONSTRAINTS_st {
336 ASN1_INTEGER *requireExplicitPolicy; 312 ASN1_INTEGER *requireExplicitPolicy;
@@ -353,31 +329,6 @@ typedef struct PROXY_CERT_INFO_EXTENSION_st
353DECLARE_ASN1_FUNCTIONS(PROXY_POLICY) 329DECLARE_ASN1_FUNCTIONS(PROXY_POLICY)
354DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION) 330DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION)
355 331
356struct 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)
522DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD) 471DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD)
523 472
524DECLARE_ASN1_FUNCTIONS(GENERAL_NAME) 473DECLARE_ASN1_FUNCTIONS(GENERAL_NAME)
525GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a);
526int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b);
527
528 474
529 475
530ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, 476ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
@@ -540,18 +486,11 @@ DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES)
540 486
541STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, 487STACK_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);
543GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method, 489GENERAL_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
546DECLARE_ASN1_FUNCTIONS(OTHERNAME) 492DECLARE_ASN1_FUNCTIONS(OTHERNAME)
547DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME) 493DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME)
548int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b);
549void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value);
550void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype);
551int GENERAL_NAME_set0_othername(GENERAL_NAME *gen,
552 ASN1_OBJECT *oid, ASN1_TYPE *value);
553int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen,
554 ASN1_OBJECT **poid, ASN1_TYPE **pvalue);
555 494
556char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5); 495char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5);
557ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); 496ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
@@ -568,11 +507,6 @@ DECLARE_ASN1_FUNCTIONS(NOTICEREF)
568DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS) 507DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS)
569DECLARE_ASN1_FUNCTIONS(DIST_POINT) 508DECLARE_ASN1_FUNCTIONS(DIST_POINT)
570DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME) 509DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME)
571DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT)
572
573int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname);
574
575int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc);
576 510
577DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) 511DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION)
578DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) 512DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS)
@@ -590,16 +524,11 @@ DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS)
590DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) 524DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS)
591DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS) 525DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS)
592 526
593GENERAL_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
598GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, 528GENERAL_NAME *v2i_GENERAL_NAME(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
599 CONF_VALUE *cnf); 529 CONF_VALUE *cnf);
600GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, 530GENERAL_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);
603void X509V3_conf_free(CONF_VALUE *val); 532void X509V3_conf_free(CONF_VALUE *val);
604 533
605X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value); 534X509_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)
609int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); 538int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_REQ *req);
610int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); 539int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl);
611 540
612X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, 541X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, char *value);
613 int ext_nid, char *value); 542X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, char *value);
614X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, 543int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509 *cert);
615 char *name, char *value); 544int X509V3_EXT_REQ_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_REQ *req);
616int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, 545int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl);
617 char *section, X509 *cert);
618int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
619 char *section, X509_REQ *req);
620int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
621 char *section, X509_CRL *crl);
622 546
623int X509V3_add_value_bool_nf(char *name, int asn1_bool, 547int X509V3_add_value_bool_nf(char *name, int asn1_bool,
624 STACK_OF(CONF_VALUE) **extlist); 548 STACK_OF(CONF_VALUE) **extlist);
625int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool); 549int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool);
626int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint); 550int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint);
627void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf); 551void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf);
628void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash); 552void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash);
629#endif 553#endif
630 554
631char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section); 555char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section);
@@ -652,8 +576,8 @@ int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist);
652int X509V3_EXT_add_alias(int nid_to, int nid_from); 576int X509V3_EXT_add_alias(int nid_to, int nid_from);
653void X509V3_EXT_cleanup(void); 577void X509V3_EXT_cleanup(void);
654 578
655const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext); 579X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext);
656const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid); 580X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid);
657int X509V3_add_standard_extensions(void); 581int X509V3_add_standard_extensions(void);
658STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line); 582STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line);
659void *X509V3_EXT_d2i(X509_EXTENSION *ext); 583void *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);
663X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); 587X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc);
664int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags); 588int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags);
665 589
666char *hex_to_string(const unsigned char *buffer, long len); 590char *hex_to_string(unsigned char *buffer, long len);
667unsigned char *string_to_hex(const char *str, long *len); 591unsigned char *string_to_hex(char *str, long *len);
668int name_cmp(const char *name, const char *cmp); 592int name_cmp(const char *name, const char *cmp);
669 593
670void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, 594void 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);
679int X509_supported_extension(X509_EXTENSION *ex); 603int X509_supported_extension(X509_EXTENSION *ex);
680int X509_PURPOSE_set(int *p, int purpose); 604int X509_PURPOSE_set(int *p, int purpose);
681int X509_check_issued(X509 *issuer, X509 *subject); 605int X509_check_issued(X509 *issuer, X509 *subject);
682int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid);
683int X509_PURPOSE_get_count(void); 606int X509_PURPOSE_get_count(void);
684X509_PURPOSE * X509_PURPOSE_get0(int idx); 607X509_PURPOSE * X509_PURPOSE_get0(int idx);
685int X509_PURPOSE_get_by_sname(char *sname); 608int X509_PURPOSE_get_by_sname(char *sname);
@@ -693,10 +616,10 @@ int X509_PURPOSE_get_trust(X509_PURPOSE *xp);
693void X509_PURPOSE_cleanup(void); 616void X509_PURPOSE_cleanup(void);
694int X509_PURPOSE_get_id(X509_PURPOSE *); 617int X509_PURPOSE_get_id(X509_PURPOSE *);
695 618
696STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x); 619STACK *X509_get1_email(X509 *x);
697STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x); 620STACK *X509_REQ_get1_email(X509_REQ *x);
698void X509_email_free(STACK_OF(OPENSSL_STRING) *sk); 621void X509_email_free(STACK *sk);
699STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x); 622STACK *X509_get1_ocsp(X509 *x);
700 623
701ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc); 624ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc);
702ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc); 625ASN1_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
707void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent); 630void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent);
708DECLARE_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