summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509v3
diff options
context:
space:
mode:
authorbeck <>2002-05-15 02:29:21 +0000
committerbeck <>2002-05-15 02:29:21 +0000
commitb64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9 (patch)
treefa27cf82a1250b64ed3bf5f4a18c7354d470bbcc /src/lib/libcrypto/x509v3
parente471e1ea98d673597b182ea85f29e30c97cd08b5 (diff)
downloadopenbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.gz
openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.bz2
openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.zip
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'src/lib/libcrypto/x509v3')
-rw-r--r--src/lib/libcrypto/x509v3/Makefile.ssl602
-rw-r--r--src/lib/libcrypto/x509v3/ext_dat.h16
-rw-r--r--src/lib/libcrypto/x509v3/v3_akey.c71
-rw-r--r--src/lib/libcrypto/x509v3/v3_akeya.c72
-rw-r--r--src/lib/libcrypto/x509v3/v3_alt.c112
-rw-r--r--src/lib/libcrypto/x509v3/v3_bcons.c58
-rw-r--r--src/lib/libcrypto/x509v3/v3_bitst.c1
-rw-r--r--src/lib/libcrypto/x509v3/v3_conf.c395
-rw-r--r--src/lib/libcrypto/x509v3/v3_cpols.c328
-rw-r--r--src/lib/libcrypto/x509v3/v3_crld.c181
-rw-r--r--src/lib/libcrypto/x509v3/v3_enum.c12
-rw-r--r--src/lib/libcrypto/x509v3/v3_extku.c132
-rw-r--r--src/lib/libcrypto/x509v3/v3_genn.c264
-rw-r--r--src/lib/libcrypto/x509v3/v3_info.c126
-rw-r--r--src/lib/libcrypto/x509v3/v3_int.c11
-rw-r--r--src/lib/libcrypto/x509v3/v3_lib.c80
-rw-r--r--src/lib/libcrypto/x509v3/v3_ocsp.c272
-rw-r--r--src/lib/libcrypto/x509v3/v3_pku.c61
-rw-r--r--src/lib/libcrypto/x509v3/v3_prn.c80
-rw-r--r--src/lib/libcrypto/x509v3/v3_purp.c104
-rw-r--r--src/lib/libcrypto/x509v3/v3_skey.c15
-rw-r--r--src/lib/libcrypto/x509v3/v3_sxnet.c112
-rw-r--r--src/lib/libcrypto/x509v3/v3_utl.c45
-rw-r--r--src/lib/libcrypto/x509v3/v3conf.c1
-rw-r--r--src/lib/libcrypto/x509v3/v3err.c9
-rw-r--r--src/lib/libcrypto/x509v3/v3prin.c2
-rw-r--r--src/lib/libcrypto/x509v3/x509v3.h274
27 files changed, 1637 insertions, 1799 deletions
diff --git a/src/lib/libcrypto/x509v3/Makefile.ssl b/src/lib/libcrypto/x509v3/Makefile.ssl
index 236e13af4e..8620992280 100644
--- a/src/lib/libcrypto/x509v3/Makefile.ssl
+++ b/src/lib/libcrypto/x509v3/Makefile.ssl
@@ -5,13 +5,14 @@
5DIR= x509v3 5DIR= x509v3
6TOP= ../.. 6TOP= ../..
7CC= cc 7CC= cc
8INCLUDES= -I.. -I../../include 8INCLUDES= -I.. -I$(TOP) -I../../include
9CFLAG=-g 9CFLAG=-g
10INSTALL_PREFIX= 10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl 11OPENSSLDIR= /usr/local/ssl
12INSTALLTOP=/usr/local/ssl 12INSTALLTOP=/usr/local/ssl
13MAKE= make -f Makefile.ssl 13MAKE= make -f Makefile.ssl
14MAKEDEPEND= $(TOP)/util/domd $(TOP) 14MAKEDEPPROG= makedepend
15MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
15MAKEFILE= Makefile.ssl 16MAKEFILE= Makefile.ssl
16AR= ar r 17AR= ar r
17 18
@@ -22,12 +23,14 @@ TEST=
22APPS= 23APPS=
23 24
24LIB=$(TOP)/libcrypto.a 25LIB=$(TOP)/libcrypto.a
25LIBSRC= v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c \ 26LIBSRC= v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c v3_lib.c \
26v3_lib.c v3_prn.c v3_utl.c v3err.c v3_genn.c v3_alt.c v3_skey.c v3_akey.c \ 27v3_prn.c v3_utl.c v3err.c v3_genn.c v3_alt.c v3_skey.c v3_akey.c v3_pku.c \
27v3_pku.c v3_int.c v3_enum.c v3_sxnet.c v3_cpols.c v3_crld.c v3_purp.c v3_info.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
28LIBOBJ= v3_bcons.o v3_bitst.o v3_conf.o v3_extku.o v3_ia5.o v3_lib.o \ 30LIBOBJ= v3_bcons.o v3_bitst.o v3_conf.o v3_extku.o v3_ia5.o v3_lib.o \
29v3_prn.o v3_utl.o v3err.o v3_genn.o v3_alt.o v3_skey.o v3_akey.o v3_pku.o \ 31v3_prn.o v3_utl.o v3err.o v3_genn.o v3_alt.o v3_skey.o v3_akey.o v3_pku.o \
30v3_int.o v3_enum.o v3_sxnet.o v3_cpols.o v3_crld.o v3_purp.o v3_info.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
31 34
32SRC= $(LIBSRC) 35SRC= $(LIBSRC)
33 36
@@ -43,8 +46,7 @@ all: lib
43 46
44lib: $(LIBOBJ) 47lib: $(LIBOBJ)
45 $(AR) $(LIB) $(LIBOBJ) 48 $(AR) $(LIB) $(LIBOBJ)
46 @echo You may get an error following this line. Please ignore. 49 $(RANLIB) $(LIB) || echo Never mind.
47 - $(RANLIB) $(LIB)
48 @touch lib 50 @touch lib
49 51
50files: 52files:
@@ -83,432 +85,336 @@ clean:
83 85
84# DO NOT DELETE THIS LINE -- make depend depends on it. 86# DO NOT DELETE THIS LINE -- make depend depends on it.
85 87
86v3_akey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 88v3_akey.o: ../../e_os.h ../../include/openssl/asn1.h
87v3_akey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 89v3_akey.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
88v3_akey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 90v3_akey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
89v3_akey.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 91v3_akey.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
90v3_akey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
91v3_akey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 92v3_akey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
92v3_akey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
93v3_akey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 93v3_akey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
94v3_akey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 94v3_akey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
95v3_akey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 95v3_akey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
96v3_akey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h 96v3_akey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
97v3_akey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h 97v3_akey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
98v3_akey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
99v3_akey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
100v3_akey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
101v3_akey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
102v3_akey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 98v3_akey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
103v3_akey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 99v3_akey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
104v3_akey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 100v3_akey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
105v3_akey.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 101v3_akey.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
106v3_akey.o: ../cryptlib.h 102v3_akey.o: ../cryptlib.h v3_akey.c
107v3_alt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 103v3_akeya.o: ../../e_os.h ../../include/openssl/asn1.h
108v3_alt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 104v3_akeya.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
109v3_alt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 105v3_akeya.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
106v3_akeya.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
107v3_akeya.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
108v3_akeya.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
109v3_akeya.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
110v3_akeya.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
111v3_akeya.o: ../../include/openssl/opensslconf.h
112v3_akeya.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
113v3_akeya.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
114v3_akeya.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
115v3_akeya.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
116v3_akeya.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
117v3_akeya.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_akeya.c
118v3_alt.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
119v3_alt.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
110v3_alt.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 120v3_alt.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
111v3_alt.o: ../../include/openssl/des.h ../../include/openssl/dh.h 121v3_alt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
112v3_alt.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 122v3_alt.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
113v3_alt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 123v3_alt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
114v3_alt.o: ../../include/openssl/err.h ../../include/openssl/evp.h
115v3_alt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
116v3_alt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
117v3_alt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
118v3_alt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 124v3_alt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
119v3_alt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 125v3_alt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
120v3_alt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 126v3_alt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
121v3_alt.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 127v3_alt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
122v3_alt.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 128v3_alt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
123v3_alt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 129v3_alt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
124v3_alt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 130v3_alt.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
125v3_alt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 131v3_alt.o: ../cryptlib.h v3_alt.c
126v3_alt.o: ../../include/openssl/x509v3.h ../cryptlib.h 132v3_bcons.o: ../../e_os.h ../../include/openssl/asn1.h
127v3_bcons.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 133v3_bcons.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
128v3_bcons.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
129v3_bcons.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 134v3_bcons.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
130v3_bcons.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 135v3_bcons.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
131v3_bcons.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
132v3_bcons.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 136v3_bcons.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
133v3_bcons.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
134v3_bcons.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 137v3_bcons.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
135v3_bcons.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 138v3_bcons.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
136v3_bcons.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 139v3_bcons.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
137v3_bcons.o: ../../include/openssl/md4.h ../../include/openssl/md5.h 140v3_bcons.o: ../../include/openssl/opensslconf.h
138v3_bcons.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h 141v3_bcons.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
139v3_bcons.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 142v3_bcons.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
140v3_bcons.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 143v3_bcons.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
141v3_bcons.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 144v3_bcons.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
142v3_bcons.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 145v3_bcons.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
143v3_bcons.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 146v3_bcons.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_bcons.c
144v3_bcons.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 147v3_bitst.o: ../../e_os.h ../../include/openssl/asn1.h
145v3_bcons.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 148v3_bitst.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
146v3_bcons.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 149v3_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
147v3_bcons.o: ../cryptlib.h 150v3_bitst.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
148v3_bitst.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 151v3_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
149v3_bitst.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
150v3_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
151v3_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
152v3_bitst.o: ../../include/openssl/des.h ../../include/openssl/dh.h
153v3_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
154v3_bitst.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
155v3_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h 152v3_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h
156v3_bitst.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 153v3_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
157v3_bitst.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 154v3_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
158v3_bitst.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 155v3_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
159v3_bitst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 156v3_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
160v3_bitst.o: ../../include/openssl/opensslconf.h 157v3_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
161v3_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 158v3_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
162v3_bitst.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 159v3_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
163v3_bitst.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 160v3_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_bitst.c
164v3_bitst.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 161v3_conf.o: ../../e_os.h ../../include/openssl/asn1.h
165v3_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 162v3_conf.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
166v3_bitst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 163v3_conf.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
167v3_bitst.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 164v3_conf.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
168v3_bitst.o: ../cryptlib.h 165v3_conf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
169v3_conf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
170v3_conf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
171v3_conf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
172v3_conf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
173v3_conf.o: ../../include/openssl/des.h ../../include/openssl/dh.h
174v3_conf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
175v3_conf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
176v3_conf.o: ../../include/openssl/err.h ../../include/openssl/evp.h 166v3_conf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
177v3_conf.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 167v3_conf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
178v3_conf.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 168v3_conf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
179v3_conf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 169v3_conf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
180v3_conf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 170v3_conf.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
181v3_conf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
182v3_conf.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
183v3_conf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
184v3_conf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
185v3_conf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 171v3_conf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
186v3_conf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 172v3_conf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
187v3_conf.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 173v3_conf.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
188v3_conf.o: ../../include/openssl/x509v3.h ../cryptlib.h 174v3_conf.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_conf.c
189v3_cpols.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 175v3_cpols.o: ../../e_os.h ../../include/openssl/asn1.h
190v3_cpols.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 176v3_cpols.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
191v3_cpols.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 177v3_cpols.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
192v3_cpols.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 178v3_cpols.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
193v3_cpols.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
194v3_cpols.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 179v3_cpols.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
195v3_cpols.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
196v3_cpols.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 180v3_cpols.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
197v3_cpols.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 181v3_cpols.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
198v3_cpols.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 182v3_cpols.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
199v3_cpols.o: ../../include/openssl/md4.h ../../include/openssl/md5.h 183v3_cpols.o: ../../include/openssl/opensslconf.h
200v3_cpols.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h 184v3_cpols.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
201v3_cpols.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 185v3_cpols.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
202v3_cpols.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 186v3_cpols.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
203v3_cpols.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 187v3_cpols.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
204v3_cpols.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 188v3_cpols.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
205v3_cpols.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 189v3_cpols.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_cpols.c
206v3_cpols.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 190v3_crld.o: ../../e_os.h ../../include/openssl/asn1.h
207v3_cpols.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 191v3_crld.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
208v3_cpols.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
209v3_cpols.o: ../cryptlib.h
210v3_crld.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
211v3_crld.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
212v3_crld.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 192v3_crld.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
213v3_crld.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 193v3_crld.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
214v3_crld.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
215v3_crld.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 194v3_crld.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
216v3_crld.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
217v3_crld.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 195v3_crld.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
218v3_crld.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 196v3_crld.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
219v3_crld.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 197v3_crld.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
220v3_crld.o: ../../include/openssl/md4.h ../../include/openssl/md5.h 198v3_crld.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
221v3_crld.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h 199v3_crld.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
222v3_crld.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
223v3_crld.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
224v3_crld.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
225v3_crld.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
226v3_crld.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 200v3_crld.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
227v3_crld.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 201v3_crld.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
228v3_crld.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 202v3_crld.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
229v3_crld.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 203v3_crld.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
230v3_crld.o: ../cryptlib.h 204v3_crld.o: ../cryptlib.h v3_crld.c
231v3_enum.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 205v3_enum.o: ../../e_os.h ../../include/openssl/asn1.h
232v3_enum.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 206v3_enum.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
233v3_enum.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 207v3_enum.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
234v3_enum.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 208v3_enum.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
235v3_enum.o: ../../include/openssl/des.h ../../include/openssl/dh.h 209v3_enum.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
236v3_enum.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
237v3_enum.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
238v3_enum.o: ../../include/openssl/err.h ../../include/openssl/evp.h 210v3_enum.o: ../../include/openssl/err.h ../../include/openssl/evp.h
239v3_enum.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 211v3_enum.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
240v3_enum.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 212v3_enum.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
241v3_enum.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 213v3_enum.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
242v3_enum.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 214v3_enum.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
243v3_enum.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
244v3_enum.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
245v3_enum.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
246v3_enum.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
247v3_enum.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 215v3_enum.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
248v3_enum.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 216v3_enum.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
249v3_enum.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 217v3_enum.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
250v3_enum.o: ../../include/openssl/x509v3.h ../cryptlib.h 218v3_enum.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_enum.c
251v3_extku.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 219v3_extku.o: ../../e_os.h ../../include/openssl/asn1.h
252v3_extku.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 220v3_extku.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
253v3_extku.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 221v3_extku.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
254v3_extku.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 222v3_extku.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
255v3_extku.o: ../../include/openssl/des.h ../../include/openssl/dh.h 223v3_extku.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
256v3_extku.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 224v3_extku.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
257v3_extku.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 225v3_extku.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
258v3_extku.o: ../../include/openssl/err.h ../../include/openssl/evp.h
259v3_extku.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
260v3_extku.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
261v3_extku.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
262v3_extku.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 226v3_extku.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
263v3_extku.o: ../../include/openssl/opensslconf.h 227v3_extku.o: ../../include/openssl/opensslconf.h
264v3_extku.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 228v3_extku.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
265v3_extku.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 229v3_extku.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
266v3_extku.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 230v3_extku.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
267v3_extku.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 231v3_extku.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
268v3_extku.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 232v3_extku.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
269v3_extku.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 233v3_extku.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_extku.c
270v3_extku.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 234v3_genn.o: ../../e_os.h ../../include/openssl/asn1.h
271v3_extku.o: ../cryptlib.h 235v3_genn.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
272v3_genn.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
273v3_genn.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
274v3_genn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 236v3_genn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
275v3_genn.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 237v3_genn.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
276v3_genn.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
277v3_genn.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 238v3_genn.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
278v3_genn.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
279v3_genn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 239v3_genn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
280v3_genn.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 240v3_genn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
281v3_genn.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 241v3_genn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
282v3_genn.o: ../../include/openssl/md4.h ../../include/openssl/md5.h 242v3_genn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
283v3_genn.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h 243v3_genn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
284v3_genn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
285v3_genn.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
286v3_genn.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
287v3_genn.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
288v3_genn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 244v3_genn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
289v3_genn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 245v3_genn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
290v3_genn.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 246v3_genn.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
291v3_genn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 247v3_genn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
292v3_genn.o: ../cryptlib.h 248v3_genn.o: ../cryptlib.h v3_genn.c
293v3_ia5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 249v3_ia5.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
294v3_ia5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 250v3_ia5.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
295v3_ia5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
296v3_ia5.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 251v3_ia5.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
297v3_ia5.o: ../../include/openssl/des.h ../../include/openssl/dh.h 252v3_ia5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
298v3_ia5.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 253v3_ia5.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
299v3_ia5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 254v3_ia5.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
300v3_ia5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
301v3_ia5.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
302v3_ia5.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
303v3_ia5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
304v3_ia5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 255v3_ia5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
305v3_ia5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 256v3_ia5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
306v3_ia5.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 257v3_ia5.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
307v3_ia5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 258v3_ia5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
308v3_ia5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 259v3_ia5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
309v3_ia5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 260v3_ia5.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
310v3_ia5.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 261v3_ia5.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
311v3_ia5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 262v3_ia5.o: ../cryptlib.h v3_ia5.c
312v3_ia5.o: ../../include/openssl/x509v3.h ../cryptlib.h 263v3_info.o: ../../e_os.h ../../include/openssl/asn1.h
313v3_info.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 264v3_info.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
314v3_info.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
315v3_info.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 265v3_info.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
316v3_info.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 266v3_info.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
317v3_info.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
318v3_info.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 267v3_info.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
319v3_info.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
320v3_info.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 268v3_info.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
321v3_info.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 269v3_info.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
322v3_info.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 270v3_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
323v3_info.o: ../../include/openssl/md4.h ../../include/openssl/md5.h 271v3_info.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
324v3_info.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h 272v3_info.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
325v3_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
326v3_info.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
327v3_info.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
328v3_info.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
329v3_info.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 273v3_info.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
330v3_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 274v3_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
331v3_info.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 275v3_info.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
332v3_info.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 276v3_info.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
333v3_info.o: ../cryptlib.h 277v3_info.o: ../cryptlib.h v3_info.c
334v3_int.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 278v3_int.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
335v3_int.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 279v3_int.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
336v3_int.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
337v3_int.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 280v3_int.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
338v3_int.o: ../../include/openssl/des.h ../../include/openssl/dh.h 281v3_int.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
339v3_int.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 282v3_int.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
340v3_int.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 283v3_int.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
341v3_int.o: ../../include/openssl/err.h ../../include/openssl/evp.h
342v3_int.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
343v3_int.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
344v3_int.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
345v3_int.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 284v3_int.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
346v3_int.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 285v3_int.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
347v3_int.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 286v3_int.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
348v3_int.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 287v3_int.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
349v3_int.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 288v3_int.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
350v3_int.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 289v3_int.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
351v3_int.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 290v3_int.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
352v3_int.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 291v3_int.o: ../cryptlib.h v3_int.c
353v3_int.o: ../../include/openssl/x509v3.h ../cryptlib.h 292v3_lib.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
354v3_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 293v3_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
355v3_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
356v3_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
357v3_lib.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 294v3_lib.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
358v3_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h 295v3_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
359v3_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 296v3_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
360v3_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 297v3_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
361v3_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
362v3_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
363v3_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
364v3_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
365v3_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 298v3_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
366v3_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 299v3_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
367v3_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 300v3_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
368v3_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 301v3_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
369v3_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 302v3_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
370v3_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 303v3_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
371v3_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 304v3_lib.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
372v3_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 305v3_lib.o: ../cryptlib.h ext_dat.h v3_lib.c
373v3_lib.o: ../../include/openssl/x509v3.h ../cryptlib.h ext_dat.h 306v3_ocsp.o: ../../e_os.h ../../include/openssl/asn1.h
374v3_pku.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 307v3_ocsp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
375v3_pku.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 308v3_ocsp.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
309v3_ocsp.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
310v3_ocsp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
311v3_ocsp.o: ../../include/openssl/err.h ../../include/openssl/evp.h
312v3_ocsp.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
313v3_ocsp.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
314v3_ocsp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
315v3_ocsp.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
316v3_ocsp.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
317v3_ocsp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
318v3_ocsp.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
319v3_ocsp.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
320v3_ocsp.o: ../cryptlib.h v3_ocsp.c
321v3_pku.o: ../../e_os.h ../../include/openssl/asn1.h
322v3_pku.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
376v3_pku.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 323v3_pku.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
377v3_pku.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 324v3_pku.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
378v3_pku.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
379v3_pku.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 325v3_pku.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
380v3_pku.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
381v3_pku.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 326v3_pku.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
382v3_pku.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 327v3_pku.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
383v3_pku.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 328v3_pku.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
384v3_pku.o: ../../include/openssl/md4.h ../../include/openssl/md5.h 329v3_pku.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
385v3_pku.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h 330v3_pku.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
386v3_pku.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
387v3_pku.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
388v3_pku.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
389v3_pku.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
390v3_pku.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 331v3_pku.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
391v3_pku.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 332v3_pku.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
392v3_pku.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 333v3_pku.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
393v3_pku.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 334v3_pku.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
394v3_pku.o: ../cryptlib.h 335v3_pku.o: ../cryptlib.h v3_pku.c
395v3_prn.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 336v3_prn.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
396v3_prn.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 337v3_prn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
397v3_prn.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
398v3_prn.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 338v3_prn.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
399v3_prn.o: ../../include/openssl/des.h ../../include/openssl/dh.h 339v3_prn.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
400v3_prn.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 340v3_prn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
401v3_prn.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 341v3_prn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
402v3_prn.o: ../../include/openssl/err.h ../../include/openssl/evp.h
403v3_prn.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
404v3_prn.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
405v3_prn.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
406v3_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 342v3_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
407v3_prn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 343v3_prn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
408v3_prn.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 344v3_prn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
409v3_prn.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 345v3_prn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
410v3_prn.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 346v3_prn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
411v3_prn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 347v3_prn.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
412v3_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 348v3_prn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
413v3_prn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 349v3_prn.o: ../cryptlib.h v3_prn.c
414v3_prn.o: ../../include/openssl/x509v3.h ../cryptlib.h 350v3_purp.o: ../../e_os.h ../../include/openssl/asn1.h
415v3_purp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 351v3_purp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
416v3_purp.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 352v3_purp.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
417v3_purp.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 353v3_purp.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
418v3_purp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 354v3_purp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
419v3_purp.o: ../../include/openssl/des.h ../../include/openssl/dh.h
420v3_purp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
421v3_purp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
422v3_purp.o: ../../include/openssl/err.h ../../include/openssl/evp.h 355v3_purp.o: ../../include/openssl/err.h ../../include/openssl/evp.h
423v3_purp.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 356v3_purp.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
424v3_purp.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 357v3_purp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
425v3_purp.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 358v3_purp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
426v3_purp.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 359v3_purp.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
427v3_purp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
428v3_purp.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
429v3_purp.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
430v3_purp.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
431v3_purp.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 360v3_purp.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
432v3_purp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 361v3_purp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
433v3_purp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 362v3_purp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
434v3_purp.o: ../../include/openssl/x509v3.h ../cryptlib.h 363v3_purp.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_purp.c
435v3_skey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 364v3_skey.o: ../../e_os.h ../../include/openssl/asn1.h
436v3_skey.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 365v3_skey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
437v3_skey.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 366v3_skey.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
438v3_skey.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 367v3_skey.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
439v3_skey.o: ../../include/openssl/des.h ../../include/openssl/dh.h 368v3_skey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
440v3_skey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
441v3_skey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
442v3_skey.o: ../../include/openssl/err.h ../../include/openssl/evp.h 369v3_skey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
443v3_skey.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 370v3_skey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
444v3_skey.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 371v3_skey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
445v3_skey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 372v3_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
446v3_skey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 373v3_skey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
447v3_skey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
448v3_skey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
449v3_skey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
450v3_skey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
451v3_skey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 374v3_skey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
452v3_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 375v3_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
453v3_skey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 376v3_skey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
454v3_skey.o: ../../include/openssl/x509v3.h ../cryptlib.h 377v3_skey.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_skey.c
455v3_sxnet.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 378v3_sxnet.o: ../../e_os.h ../../include/openssl/asn1.h
456v3_sxnet.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 379v3_sxnet.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
457v3_sxnet.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 380v3_sxnet.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
458v3_sxnet.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 381v3_sxnet.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
459v3_sxnet.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
460v3_sxnet.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 382v3_sxnet.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
461v3_sxnet.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
462v3_sxnet.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 383v3_sxnet.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
463v3_sxnet.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 384v3_sxnet.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
464v3_sxnet.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 385v3_sxnet.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
465v3_sxnet.o: ../../include/openssl/md4.h ../../include/openssl/md5.h 386v3_sxnet.o: ../../include/openssl/opensslconf.h
466v3_sxnet.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h 387v3_sxnet.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
467v3_sxnet.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 388v3_sxnet.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
468v3_sxnet.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 389v3_sxnet.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
469v3_sxnet.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 390v3_sxnet.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
470v3_sxnet.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 391v3_sxnet.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
471v3_sxnet.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 392v3_sxnet.o: ../../include/openssl/x509v3.h ../cryptlib.h v3_sxnet.c
472v3_sxnet.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 393v3_utl.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
473v3_sxnet.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 394v3_utl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
474v3_sxnet.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
475v3_sxnet.o: ../cryptlib.h
476v3_utl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
477v3_utl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
478v3_utl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
479v3_utl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 395v3_utl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
480v3_utl.o: ../../include/openssl/des.h ../../include/openssl/dh.h 396v3_utl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
481v3_utl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 397v3_utl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
482v3_utl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 398v3_utl.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
483v3_utl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
484v3_utl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
485v3_utl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
486v3_utl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
487v3_utl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 399v3_utl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
488v3_utl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 400v3_utl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
489v3_utl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 401v3_utl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
490v3_utl.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 402v3_utl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
491v3_utl.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 403v3_utl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
492v3_utl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 404v3_utl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
493v3_utl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 405v3_utl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
494v3_utl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 406v3_utl.o: ../cryptlib.h v3_utl.c
495v3_utl.o: ../../include/openssl/x509v3.h ../cryptlib.h
496v3err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 407v3err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
497v3err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 408v3err.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
498v3err.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
499v3err.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 409v3err.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
500v3err.o: ../../include/openssl/des.h ../../include/openssl/dh.h 410v3err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
501v3err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
502v3err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 411v3err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
503v3err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 412v3err.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
504v3err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 413v3err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
505v3err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h 414v3err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
506v3err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h 415v3err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
507v3err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
508v3err.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
509v3err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
510v3err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
511v3err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 416v3err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
512v3err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 417v3err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
513v3err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 418v3err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
514v3err.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 419v3err.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
420v3err.o: v3err.c
diff --git a/src/lib/libcrypto/x509v3/ext_dat.h b/src/lib/libcrypto/x509v3/ext_dat.h
index 801a585a52..586f116db5 100644
--- a/src/lib/libcrypto/x509v3/ext_dat.h
+++ b/src/lib/libcrypto/x509v3/ext_dat.h
@@ -58,9 +58,12 @@
58/* This file contains a table of "standard" extensions */ 58/* This file contains a table of "standard" extensions */
59 59
60extern X509V3_EXT_METHOD v3_bcons, v3_nscert, v3_key_usage, v3_ext_ku; 60extern 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; 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_cpols, v3_crld; 63extern X509V3_EXT_METHOD v3_crl_num, v3_crl_reason, v3_crl_invdate, v3_cpols, v3_crld;
64extern X509V3_EXT_METHOD v3_ocsp_nonce, v3_ocsp_accresp, v3_ocsp_acutoff;
65extern X509V3_EXT_METHOD v3_ocsp_crlid, v3_ocsp_nocheck, v3_ocsp_serviceloc;
66extern X509V3_EXT_METHOD v3_crl_hold;
64 67
65/* This table will be searched using OBJ_bsearch so it *must* kept in 68/* This table will be searched using OBJ_bsearch so it *must* kept in
66 * order of the ext_nid values. 69 * order of the ext_nid values.
@@ -87,8 +90,17 @@ static X509V3_EXT_METHOD *standard_exts[] = {
87&v3_crld, 90&v3_crld,
88&v3_ext_ku, 91&v3_ext_ku,
89&v3_crl_reason, 92&v3_crl_reason,
93&v3_crl_invdate,
90&v3_sxnet, 94&v3_sxnet,
91&v3_info, 95&v3_info,
96&v3_ocsp_nonce,
97&v3_ocsp_crlid,
98&v3_ocsp_accresp,
99&v3_ocsp_nocheck,
100&v3_ocsp_acutoff,
101&v3_ocsp_serviceloc,
102&v3_crl_hold,
103&v3_sinfo
92}; 104};
93 105
94/* Number of standard extensions */ 106/* Number of standard extensions */
diff --git a/src/lib/libcrypto/x509v3/v3_akey.c b/src/lib/libcrypto/x509v3/v3_akey.c
index 0889a18993..97e686f97a 100644
--- a/src/lib/libcrypto/x509v3/v3_akey.c
+++ b/src/lib/libcrypto/x509v3/v3_akey.c
@@ -60,7 +60,7 @@
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/conf.h> 61#include <openssl/conf.h>
62#include <openssl/asn1.h> 62#include <openssl/asn1.h>
63#include <openssl/asn1_mac.h> 63#include <openssl/asn1t.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, 66static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
@@ -69,72 +69,15 @@ static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
69 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values); 69 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values);
70 70
71X509V3_EXT_METHOD v3_akey_id = { 71X509V3_EXT_METHOD v3_akey_id = {
72NID_authority_key_identifier, X509V3_EXT_MULTILINE, 72NID_authority_key_identifier, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(AUTHORITY_KEYID),
73(X509V3_EXT_NEW)AUTHORITY_KEYID_new, 730,0,0,0,
74(X509V3_EXT_FREE)AUTHORITY_KEYID_free, 740,0,
75(X509V3_EXT_D2I)d2i_AUTHORITY_KEYID,
76(X509V3_EXT_I2D)i2d_AUTHORITY_KEYID,
77NULL, NULL,
78(X509V3_EXT_I2V)i2v_AUTHORITY_KEYID, 75(X509V3_EXT_I2V)i2v_AUTHORITY_KEYID,
79(X509V3_EXT_V2I)v2i_AUTHORITY_KEYID, 76(X509V3_EXT_V2I)v2i_AUTHORITY_KEYID,
80NULL,NULL, 770,0,
81NULL 78NULL
82}; 79};
83 80
84
85int i2d_AUTHORITY_KEYID(AUTHORITY_KEYID *a, unsigned char **pp)
86{
87 M_ASN1_I2D_vars(a);
88
89 M_ASN1_I2D_len_IMP_opt (a->keyid, i2d_ASN1_OCTET_STRING);
90 M_ASN1_I2D_len_IMP_opt (a->issuer, i2d_GENERAL_NAMES);
91 M_ASN1_I2D_len_IMP_opt (a->serial, i2d_ASN1_INTEGER);
92
93 M_ASN1_I2D_seq_total();
94
95 M_ASN1_I2D_put_IMP_opt (a->keyid, i2d_ASN1_OCTET_STRING, 0);
96 M_ASN1_I2D_put_IMP_opt (a->issuer, i2d_GENERAL_NAMES, 1);
97 M_ASN1_I2D_put_IMP_opt (a->serial, i2d_ASN1_INTEGER, 2);
98
99 M_ASN1_I2D_finish();
100}
101
102AUTHORITY_KEYID *AUTHORITY_KEYID_new(void)
103{
104 AUTHORITY_KEYID *ret=NULL;
105 ASN1_CTX c;
106 M_ASN1_New_Malloc(ret, AUTHORITY_KEYID);
107 ret->keyid = NULL;
108 ret->issuer = NULL;
109 ret->serial = NULL;
110 return (ret);
111 M_ASN1_New_Error(ASN1_F_AUTHORITY_KEYID_NEW);
112}
113
114AUTHORITY_KEYID *d2i_AUTHORITY_KEYID(AUTHORITY_KEYID **a, unsigned char **pp,
115 long length)
116{
117 M_ASN1_D2I_vars(a,AUTHORITY_KEYID *,AUTHORITY_KEYID_new);
118 M_ASN1_D2I_Init();
119 M_ASN1_D2I_start_sequence();
120 M_ASN1_D2I_get_IMP_opt (ret->keyid, d2i_ASN1_OCTET_STRING, 0,
121 V_ASN1_OCTET_STRING);
122 M_ASN1_D2I_get_IMP_opt (ret->issuer, d2i_GENERAL_NAMES, 1,
123 V_ASN1_SEQUENCE);
124 M_ASN1_D2I_get_IMP_opt (ret->serial, d2i_ASN1_INTEGER, 2,
125 V_ASN1_INTEGER);
126 M_ASN1_D2I_Finish(a, AUTHORITY_KEYID_free, ASN1_F_D2I_AUTHORITY_KEYID);
127}
128
129void AUTHORITY_KEYID_free(AUTHORITY_KEYID *a)
130{
131 if (a == NULL) return;
132 M_ASN1_OCTET_STRING_free(a->keyid);
133 sk_GENERAL_NAME_pop_free(a->issuer, GENERAL_NAME_free);
134 M_ASN1_INTEGER_free (a->serial);
135 OPENSSL_free (a);
136}
137
138static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, 81static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
139 AUTHORITY_KEYID *akeyid, STACK_OF(CONF_VALUE) *extlist) 82 AUTHORITY_KEYID *akeyid, STACK_OF(CONF_VALUE) *extlist)
140{ 83{
@@ -171,7 +114,7 @@ int i;
171CONF_VALUE *cnf; 114CONF_VALUE *cnf;
172ASN1_OCTET_STRING *ikeyid = NULL; 115ASN1_OCTET_STRING *ikeyid = NULL;
173X509_NAME *isname = NULL; 116X509_NAME *isname = NULL;
174STACK_OF(GENERAL_NAME) * gens = NULL; 117GENERAL_NAMES * gens = NULL;
175GENERAL_NAME *gen = NULL; 118GENERAL_NAME *gen = NULL;
176ASN1_INTEGER *serial = NULL; 119ASN1_INTEGER *serial = NULL;
177X509_EXTENSION *ext; 120X509_EXTENSION *ext;
@@ -192,8 +135,6 @@ for(i = 0; i < sk_CONF_VALUE_num(values); i++) {
192 } 135 }
193} 136}
194 137
195
196
197if(!ctx || !ctx->issuer_cert) { 138if(!ctx || !ctx->issuer_cert) {
198 if(ctx && (ctx->flags==CTX_TEST)) return AUTHORITY_KEYID_new(); 139 if(ctx && (ctx->flags==CTX_TEST)) return AUTHORITY_KEYID_new();
199 X509V3err(X509V3_F_V2I_AUTHORITY_KEYID,X509V3_R_NO_ISSUER_CERTIFICATE); 140 X509V3err(X509V3_F_V2I_AUTHORITY_KEYID,X509V3_R_NO_ISSUER_CERTIFICATE);
diff --git a/src/lib/libcrypto/x509v3/v3_akeya.c b/src/lib/libcrypto/x509v3/v3_akeya.c
new file mode 100644
index 0000000000..2aafa26ba7
--- /dev/null
+++ b/src/lib/libcrypto/x509v3/v3_akeya.c
@@ -0,0 +1,72 @@
1/* v3_akey_asn1.c */
2/* Written by Dr Stephen N Henson (shenson@bigfoot.com) 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#include <stdio.h>
60#include "cryptlib.h"
61#include <openssl/conf.h>
62#include <openssl/asn1.h>
63#include <openssl/asn1t.h>
64#include <openssl/x509v3.h>
65
66ASN1_SEQUENCE(AUTHORITY_KEYID) = {
67 ASN1_IMP_OPT(AUTHORITY_KEYID, keyid, ASN1_OCTET_STRING, 0),
68 ASN1_IMP_SEQUENCE_OF_OPT(AUTHORITY_KEYID, issuer, GENERAL_NAME, 1),
69 ASN1_IMP_OPT(AUTHORITY_KEYID, serial, ASN1_INTEGER, 2)
70} ASN1_SEQUENCE_END(AUTHORITY_KEYID)
71
72IMPLEMENT_ASN1_FUNCTIONS(AUTHORITY_KEYID)
diff --git a/src/lib/libcrypto/x509v3/v3_alt.c b/src/lib/libcrypto/x509v3/v3_alt.c
index 94bebcd448..0e9e7dcb4f 100644
--- a/src/lib/libcrypto/x509v3/v3_alt.c
+++ b/src/lib/libcrypto/x509v3/v3_alt.c
@@ -61,33 +61,28 @@
61#include <openssl/conf.h> 61#include <openssl/conf.h>
62#include <openssl/x509v3.h> 62#include <openssl/x509v3.h>
63 63
64static STACK_OF(GENERAL_NAME) *v2i_subject_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); 64static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
65static STACK_OF(GENERAL_NAME) *v2i_issuer_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); 65static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
66static int copy_email(X509V3_CTX *ctx, STACK_OF(GENERAL_NAME) *gens); 66static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p);
67static int copy_issuer(X509V3_CTX *ctx, STACK_OF(GENERAL_NAME) *gens); 67static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens);
68X509V3_EXT_METHOD v3_alt[] = { 68X509V3_EXT_METHOD v3_alt[] = {
69{ NID_subject_alt_name, 0, 69{ NID_subject_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES),
70(X509V3_EXT_NEW)GENERAL_NAMES_new, 700,0,0,0,
71(X509V3_EXT_FREE)GENERAL_NAMES_free, 710,0,
72(X509V3_EXT_D2I)d2i_GENERAL_NAMES,
73(X509V3_EXT_I2D)i2d_GENERAL_NAMES,
74NULL, NULL,
75(X509V3_EXT_I2V)i2v_GENERAL_NAMES, 72(X509V3_EXT_I2V)i2v_GENERAL_NAMES,
76(X509V3_EXT_V2I)v2i_subject_alt, 73(X509V3_EXT_V2I)v2i_subject_alt,
77NULL, NULL, NULL}, 74NULL, NULL, NULL},
78{ NID_issuer_alt_name, 0, 75
79(X509V3_EXT_NEW)GENERAL_NAMES_new, 76{ NID_issuer_alt_name, 0, ASN1_ITEM_ref(GENERAL_NAMES),
80(X509V3_EXT_FREE)GENERAL_NAMES_free, 770,0,0,0,
81(X509V3_EXT_D2I)d2i_GENERAL_NAMES, 780,0,
82(X509V3_EXT_I2D)i2d_GENERAL_NAMES,
83NULL, NULL,
84(X509V3_EXT_I2V)i2v_GENERAL_NAMES, 79(X509V3_EXT_I2V)i2v_GENERAL_NAMES,
85(X509V3_EXT_V2I)v2i_issuer_alt, 80(X509V3_EXT_V2I)v2i_issuer_alt,
86NULL, NULL, NULL}, 81NULL, NULL, NULL},
87}; 82};
88 83
89STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, 84STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method,
90 STACK_OF(GENERAL_NAME) *gens, STACK_OF(CONF_VALUE) *ret) 85 GENERAL_NAMES *gens, STACK_OF(CONF_VALUE) *ret)
91{ 86{
92 int i; 87 int i;
93 GENERAL_NAME *gen; 88 GENERAL_NAME *gen;
@@ -102,8 +97,8 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method,
102STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, 97STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
103 GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret) 98 GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret)
104{ 99{
105 char oline[256];
106 unsigned char *p; 100 unsigned char *p;
101 char oline[256];
107 switch (gen->type) 102 switch (gen->type)
108 { 103 {
109 case GEN_OTHERNAME: 104 case GEN_OTHERNAME:
@@ -154,10 +149,63 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
154 return ret; 149 return ret;
155} 150}
156 151
157static STACK_OF(GENERAL_NAME) *v2i_issuer_alt(X509V3_EXT_METHOD *method, 152int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen)
153{
154 unsigned char *p;
155 switch (gen->type)
156 {
157 case GEN_OTHERNAME:
158 BIO_printf(out, "othername:<unsupported>");
159 break;
160
161 case GEN_X400:
162 BIO_printf(out, "X400Name:<unsupported>");
163 break;
164
165 case GEN_EDIPARTY:
166 /* Maybe fix this: it is supported now */
167 BIO_printf(out, "EdiPartyName:<unsupported>");
168 break;
169
170 case GEN_EMAIL:
171 BIO_printf(out, "email:%s",gen->d.ia5->data);
172 break;
173
174 case GEN_DNS:
175 BIO_printf(out, "DNS:%s",gen->d.ia5->data);
176 break;
177
178 case GEN_URI:
179 BIO_printf(out, "URI:%s",gen->d.ia5->data);
180 break;
181
182 case GEN_DIRNAME:
183 BIO_printf(out, "DirName: ");
184 X509_NAME_print_ex(out, gen->d.dirn, 0, XN_FLAG_ONELINE);
185 break;
186
187 case GEN_IPADD:
188 p = gen->d.ip->data;
189 /* BUG: doesn't support IPV6 */
190 if(gen->d.ip->length != 4) {
191 BIO_printf(out,"IP Address:<invalid>");
192 break;
193 }
194 BIO_printf(out, "IP Address:%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
195 break;
196
197 case GEN_RID:
198 BIO_printf(out, "Registered ID");
199 i2a_ASN1_OBJECT(out, gen->d.rid);
200 break;
201 }
202 return 1;
203}
204
205static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method,
158 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) 206 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
159{ 207{
160 STACK_OF(GENERAL_NAME) *gens = NULL; 208 GENERAL_NAMES *gens = NULL;
161 CONF_VALUE *cnf; 209 CONF_VALUE *cnf;
162 int i; 210 int i;
163 if(!(gens = sk_GENERAL_NAME_new_null())) { 211 if(!(gens = sk_GENERAL_NAME_new_null())) {
@@ -184,9 +232,9 @@ static STACK_OF(GENERAL_NAME) *v2i_issuer_alt(X509V3_EXT_METHOD *method,
184 232
185/* Append subject altname of issuer to issuer alt name of subject */ 233/* Append subject altname of issuer to issuer alt name of subject */
186 234
187static int copy_issuer(X509V3_CTX *ctx, STACK_OF(GENERAL_NAME) *gens) 235static int copy_issuer(X509V3_CTX *ctx, GENERAL_NAMES *gens)
188{ 236{
189 STACK_OF(GENERAL_NAME) *ialt; 237 GENERAL_NAMES *ialt;
190 GENERAL_NAME *gen; 238 GENERAL_NAME *gen;
191 X509_EXTENSION *ext; 239 X509_EXTENSION *ext;
192 int i; 240 int i;
@@ -219,10 +267,10 @@ static int copy_issuer(X509V3_CTX *ctx, STACK_OF(GENERAL_NAME) *gens)
219 267
220} 268}
221 269
222static STACK_OF(GENERAL_NAME) *v2i_subject_alt(X509V3_EXT_METHOD *method, 270static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method,
223 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) 271 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
224{ 272{
225 STACK_OF(GENERAL_NAME) *gens = NULL; 273 GENERAL_NAMES *gens = NULL;
226 CONF_VALUE *cnf; 274 CONF_VALUE *cnf;
227 int i; 275 int i;
228 if(!(gens = sk_GENERAL_NAME_new_null())) { 276 if(!(gens = sk_GENERAL_NAME_new_null())) {
@@ -233,7 +281,10 @@ static STACK_OF(GENERAL_NAME) *v2i_subject_alt(X509V3_EXT_METHOD *method,
233 cnf = sk_CONF_VALUE_value(nval, i); 281 cnf = sk_CONF_VALUE_value(nval, i);
234 if(!name_cmp(cnf->name, "email") && cnf->value && 282 if(!name_cmp(cnf->name, "email") && cnf->value &&
235 !strcmp(cnf->value, "copy")) { 283 !strcmp(cnf->value, "copy")) {
236 if(!copy_email(ctx, gens)) goto err; 284 if(!copy_email(ctx, gens, 0)) goto err;
285 } else if(!name_cmp(cnf->name, "email") && cnf->value &&
286 !strcmp(cnf->value, "move")) {
287 if(!copy_email(ctx, gens, 1)) goto err;
237 } else { 288 } else {
238 GENERAL_NAME *gen; 289 GENERAL_NAME *gen;
239 if(!(gen = v2i_GENERAL_NAME(method, ctx, cnf))) 290 if(!(gen = v2i_GENERAL_NAME(method, ctx, cnf)))
@@ -251,7 +302,7 @@ static STACK_OF(GENERAL_NAME) *v2i_subject_alt(X509V3_EXT_METHOD *method,
251 * GENERAL_NAMES 302 * GENERAL_NAMES
252 */ 303 */
253 304
254static int copy_email(X509V3_CTX *ctx, STACK_OF(GENERAL_NAME) *gens) 305static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p)
255{ 306{
256 X509_NAME *nm; 307 X509_NAME *nm;
257 ASN1_IA5STRING *email = NULL; 308 ASN1_IA5STRING *email = NULL;
@@ -273,6 +324,11 @@ static int copy_email(X509V3_CTX *ctx, STACK_OF(GENERAL_NAME) *gens)
273 NID_pkcs9_emailAddress, i)) >= 0) { 324 NID_pkcs9_emailAddress, i)) >= 0) {
274 ne = X509_NAME_get_entry(nm, i); 325 ne = X509_NAME_get_entry(nm, i);
275 email = M_ASN1_IA5STRING_dup(X509_NAME_ENTRY_get_data(ne)); 326 email = M_ASN1_IA5STRING_dup(X509_NAME_ENTRY_get_data(ne));
327 if (move_p)
328 {
329 X509_NAME_delete_entry(nm, i);
330 i--;
331 }
276 if(!email || !(gen = GENERAL_NAME_new())) { 332 if(!email || !(gen = GENERAL_NAME_new())) {
277 X509V3err(X509V3_F_COPY_EMAIL,ERR_R_MALLOC_FAILURE); 333 X509V3err(X509V3_F_COPY_EMAIL,ERR_R_MALLOC_FAILURE);
278 goto err; 334 goto err;
@@ -297,11 +353,11 @@ static int copy_email(X509V3_CTX *ctx, STACK_OF(GENERAL_NAME) *gens)
297 353
298} 354}
299 355
300STACK_OF(GENERAL_NAME) *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method, 356GENERAL_NAMES *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method,
301 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) 357 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
302{ 358{
303 GENERAL_NAME *gen; 359 GENERAL_NAME *gen;
304 STACK_OF(GENERAL_NAME) *gens = NULL; 360 GENERAL_NAMES *gens = NULL;
305 CONF_VALUE *cnf; 361 CONF_VALUE *cnf;
306 int i; 362 int i;
307 if(!(gens = sk_GENERAL_NAME_new_null())) { 363 if(!(gens = sk_GENERAL_NAME_new_null())) {
diff --git a/src/lib/libcrypto/x509v3/v3_bcons.c b/src/lib/libcrypto/x509v3/v3_bcons.c
index c576b8e955..cbb012715e 100644
--- a/src/lib/libcrypto/x509v3/v3_bcons.c
+++ b/src/lib/libcrypto/x509v3/v3_bcons.c
@@ -60,7 +60,7 @@
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include <openssl/asn1.h> 62#include <openssl/asn1.h>
63#include <openssl/asn1_mac.h> 63#include <openssl/asn1t.h>
64#include <openssl/conf.h> 64#include <openssl/conf.h>
65#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
66 66
@@ -69,62 +69,22 @@ static BASIC_CONSTRAINTS *v2i_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, X509V
69 69
70X509V3_EXT_METHOD v3_bcons = { 70X509V3_EXT_METHOD v3_bcons = {
71NID_basic_constraints, 0, 71NID_basic_constraints, 0,
72(X509V3_EXT_NEW)BASIC_CONSTRAINTS_new, 72ASN1_ITEM_ref(BASIC_CONSTRAINTS),
73(X509V3_EXT_FREE)BASIC_CONSTRAINTS_free, 730,0,0,0,
74(X509V3_EXT_D2I)d2i_BASIC_CONSTRAINTS, 740,0,
75(X509V3_EXT_I2D)i2d_BASIC_CONSTRAINTS,
76NULL, NULL,
77(X509V3_EXT_I2V)i2v_BASIC_CONSTRAINTS, 75(X509V3_EXT_I2V)i2v_BASIC_CONSTRAINTS,
78(X509V3_EXT_V2I)v2i_BASIC_CONSTRAINTS, 76(X509V3_EXT_V2I)v2i_BASIC_CONSTRAINTS,
79NULL,NULL, 77NULL,NULL,
80NULL 78NULL
81}; 79};
82 80
81ASN1_SEQUENCE(BASIC_CONSTRAINTS) = {
82 ASN1_OPT(BASIC_CONSTRAINTS, ca, ASN1_FBOOLEAN),
83 ASN1_OPT(BASIC_CONSTRAINTS, pathlen, ASN1_INTEGER)
84} ASN1_SEQUENCE_END(BASIC_CONSTRAINTS)
83 85
84int i2d_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS *a, unsigned char **pp) 86IMPLEMENT_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)
85{
86 M_ASN1_I2D_vars(a);
87 if(a->ca) M_ASN1_I2D_len (a->ca, i2d_ASN1_BOOLEAN);
88 M_ASN1_I2D_len (a->pathlen, i2d_ASN1_INTEGER);
89
90 M_ASN1_I2D_seq_total();
91
92 if (a->ca) M_ASN1_I2D_put (a->ca, i2d_ASN1_BOOLEAN);
93 M_ASN1_I2D_put (a->pathlen, i2d_ASN1_INTEGER);
94 M_ASN1_I2D_finish();
95}
96
97BASIC_CONSTRAINTS *BASIC_CONSTRAINTS_new(void)
98{
99 BASIC_CONSTRAINTS *ret=NULL;
100 ASN1_CTX c;
101 M_ASN1_New_Malloc(ret, BASIC_CONSTRAINTS);
102 ret->ca = 0;
103 ret->pathlen = NULL;
104 return (ret);
105 M_ASN1_New_Error(ASN1_F_BASIC_CONSTRAINTS_NEW);
106}
107 87
108BASIC_CONSTRAINTS *d2i_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS **a,
109 unsigned char **pp, long length)
110{
111 M_ASN1_D2I_vars(a,BASIC_CONSTRAINTS *,BASIC_CONSTRAINTS_new);
112 M_ASN1_D2I_Init();
113 M_ASN1_D2I_start_sequence();
114 if((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) ==
115 (V_ASN1_UNIVERSAL|V_ASN1_BOOLEAN) ) {
116 M_ASN1_D2I_get_int (ret->ca, d2i_ASN1_BOOLEAN);
117 }
118 M_ASN1_D2I_get_opt (ret->pathlen, d2i_ASN1_INTEGER, V_ASN1_INTEGER);
119 M_ASN1_D2I_Finish(a, BASIC_CONSTRAINTS_free, ASN1_F_D2I_BASIC_CONSTRAINTS);
120}
121
122void BASIC_CONSTRAINTS_free(BASIC_CONSTRAINTS *a)
123{
124 if (a == NULL) return;
125 M_ASN1_INTEGER_free (a->pathlen);
126 OPENSSL_free (a);
127}
128 88
129static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, 89static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
130 BASIC_CONSTRAINTS *bcons, STACK_OF(CONF_VALUE) *extlist) 90 BASIC_CONSTRAINTS *bcons, STACK_OF(CONF_VALUE) *extlist)
diff --git a/src/lib/libcrypto/x509v3/v3_bitst.c b/src/lib/libcrypto/x509v3/v3_bitst.c
index 0e1167d05c..16cf125562 100644
--- a/src/lib/libcrypto/x509v3/v3_bitst.c
+++ b/src/lib/libcrypto/x509v3/v3_bitst.c
@@ -66,6 +66,7 @@ static ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
66static STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, 66static STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
67 ASN1_BIT_STRING *bits, 67 ASN1_BIT_STRING *bits,
68 STACK_OF(CONF_VALUE) *extlist); 68 STACK_OF(CONF_VALUE) *extlist);
69
69static BIT_STRING_BITNAME ns_cert_type_table[] = { 70static BIT_STRING_BITNAME ns_cert_type_table[] = {
70{0, "SSL Client", "client"}, 71{0, "SSL Client", "client"},
71{1, "SSL Server", "server"}, 72{1, "SSL Server", "server"},
diff --git a/src/lib/libcrypto/x509v3/v3_conf.c b/src/lib/libcrypto/x509v3/v3_conf.c
index bdc9c1cbc1..1a3448e121 100644
--- a/src/lib/libcrypto/x509v3/v3_conf.c
+++ b/src/lib/libcrypto/x509v3/v3_conf.c
@@ -68,114 +68,137 @@
68 68
69static int v3_check_critical(char **value); 69static int v3_check_critical(char **value);
70static int v3_check_generic(char **value); 70static int v3_check_generic(char **value);
71static X509_EXTENSION *do_ext_conf(LHASH *conf, X509V3_CTX *ctx, int ext_nid, int crit, char *value); 71static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, int crit, char *value);
72static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, int crit, int type); 72static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, int crit, int type);
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(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);
77/* LHASH *conf: Config file */ 77/* CONF *conf: Config file */
78/* char *name: Name */ 78/* char *name: Name */
79/* char *value: Value */ 79/* char *value: Value */
80X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, 80X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name,
81 char *value) 81 char *value)
82{ 82 {
83 int crit; 83 int crit;
84 int ext_type; 84 int ext_type;
85 X509_EXTENSION *ret; 85 X509_EXTENSION *ret;
86 crit = v3_check_critical(&value); 86 crit = v3_check_critical(&value);
87 if((ext_type = v3_check_generic(&value))) 87 if ((ext_type = v3_check_generic(&value)))
88 return v3_generic_extension(name, value, crit, ext_type); 88 return v3_generic_extension(name, value, crit, ext_type);
89 ret = do_ext_conf(conf, ctx, OBJ_sn2nid(name), crit, value); 89 ret = do_ext_nconf(conf, ctx, OBJ_sn2nid(name), crit, value);
90 if(!ret) { 90 if (!ret)
91 {
91 X509V3err(X509V3_F_X509V3_EXT_CONF,X509V3_R_ERROR_IN_EXTENSION); 92 X509V3err(X509V3_F_X509V3_EXT_CONF,X509V3_R_ERROR_IN_EXTENSION);
92 ERR_add_error_data(4,"name=", name, ", value=", value); 93 ERR_add_error_data(4,"name=", name, ", value=", value);
93 } 94 }
94 return ret; 95 return ret;
95} 96 }
96 97
97/* LHASH *conf: Config file */ 98/* CONF *conf: Config file */
98/* char *value: Value */ 99/* char *value: Value */
99X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, 100X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
100 char *value) 101 char *value)
101{ 102 {
102 int crit; 103 int crit;
103 int ext_type; 104 int ext_type;
104 crit = v3_check_critical(&value); 105 crit = v3_check_critical(&value);
105 if((ext_type = v3_check_generic(&value))) 106 if ((ext_type = v3_check_generic(&value)))
106 return v3_generic_extension(OBJ_nid2sn(ext_nid), 107 return v3_generic_extension(OBJ_nid2sn(ext_nid),
107 value, crit, ext_type); 108 value, crit, ext_type);
108 return do_ext_conf(conf, ctx, ext_nid, crit, value); 109 return do_ext_nconf(conf, ctx, ext_nid, crit, value);
109} 110 }
110 111
111/* LHASH *conf: Config file */ 112/* CONF *conf: Config file */
112/* char *value: Value */ 113/* char *value: Value */
113static X509_EXTENSION *do_ext_conf(LHASH *conf, X509V3_CTX *ctx, int ext_nid, 114static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid,
114 int crit, char *value) 115 int crit, char *value)
115{ 116 {
116 X509V3_EXT_METHOD *method; 117 X509V3_EXT_METHOD *method;
117 X509_EXTENSION *ext; 118 X509_EXTENSION *ext;
118 STACK_OF(CONF_VALUE) *nval; 119 STACK_OF(CONF_VALUE) *nval;
119 void *ext_struc; 120 void *ext_struc;
120 if(ext_nid == NID_undef) { 121 if (ext_nid == NID_undef)
122 {
121 X509V3err(X509V3_F_DO_EXT_CONF,X509V3_R_UNKNOWN_EXTENSION_NAME); 123 X509V3err(X509V3_F_DO_EXT_CONF,X509V3_R_UNKNOWN_EXTENSION_NAME);
122 return NULL; 124 return NULL;
123 } 125 }
124 if(!(method = X509V3_EXT_get_nid(ext_nid))) { 126 if (!(method = X509V3_EXT_get_nid(ext_nid)))
127 {
125 X509V3err(X509V3_F_DO_EXT_CONF,X509V3_R_UNKNOWN_EXTENSION); 128 X509V3err(X509V3_F_DO_EXT_CONF,X509V3_R_UNKNOWN_EXTENSION);
126 return NULL; 129 return NULL;
127 } 130 }
128 /* Now get internal extension representation based on type */ 131 /* Now get internal extension representation based on type */
129 if(method->v2i) { 132 if (method->v2i)
130 if(*value == '@') nval = CONF_get_section(conf, value + 1); 133 {
134 if(*value == '@') nval = NCONF_get_section(conf, value + 1);
131 else nval = X509V3_parse_list(value); 135 else nval = X509V3_parse_list(value);
132 if(!nval) { 136 if(!nval)
137 {
133 X509V3err(X509V3_F_X509V3_EXT_CONF,X509V3_R_INVALID_EXTENSION_STRING); 138 X509V3err(X509V3_F_X509V3_EXT_CONF,X509V3_R_INVALID_EXTENSION_STRING);
134 ERR_add_error_data(4, "name=", OBJ_nid2sn(ext_nid), ",section=", value); 139 ERR_add_error_data(4, "name=", OBJ_nid2sn(ext_nid), ",section=", value);
135 return NULL; 140 return NULL;
136 } 141 }
137 ext_struc = method->v2i(method, ctx, nval); 142 ext_struc = method->v2i(method, ctx, nval);
138 if(*value != '@') sk_CONF_VALUE_pop_free(nval, 143 if(*value != '@') sk_CONF_VALUE_pop_free(nval,
139 X509V3_conf_free); 144 X509V3_conf_free);
140 if(!ext_struc) return NULL; 145 if(!ext_struc) return NULL;
141 } else if(method->s2i) { 146 }
147 else if(method->s2i)
148 {
142 if(!(ext_struc = method->s2i(method, ctx, value))) return NULL; 149 if(!(ext_struc = method->s2i(method, ctx, value))) return NULL;
143 } else if(method->r2i) { 150 }
144 if(!ctx->db) { 151 else if(method->r2i)
152 {
153 if(!ctx->db)
154 {
145 X509V3err(X509V3_F_X509V3_EXT_CONF,X509V3_R_NO_CONFIG_DATABASE); 155 X509V3err(X509V3_F_X509V3_EXT_CONF,X509V3_R_NO_CONFIG_DATABASE);
146 return NULL; 156 return NULL;
147 } 157 }
148 if(!(ext_struc = method->r2i(method, ctx, value))) return NULL; 158 if(!(ext_struc = method->r2i(method, ctx, value))) return NULL;
149 } else { 159 }
160 else
161 {
150 X509V3err(X509V3_F_X509V3_EXT_CONF,X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED); 162 X509V3err(X509V3_F_X509V3_EXT_CONF,X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED);
151 ERR_add_error_data(2, "name=", OBJ_nid2sn(ext_nid)); 163 ERR_add_error_data(2, "name=", OBJ_nid2sn(ext_nid));
152 return NULL; 164 return NULL;
153 } 165 }
154 166
155 ext = do_ext_i2d(method, ext_nid, crit, ext_struc); 167 ext = do_ext_i2d(method, ext_nid, crit, ext_struc);
156 method->ext_free(ext_struc); 168 if(method->it) ASN1_item_free(ext_struc, ASN1_ITEM_ptr(method->it));
169 else method->ext_free(ext_struc);
157 return ext; 170 return ext;
158 171
159} 172 }
160 173
161static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid, 174static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid,
162 int crit, void *ext_struc) 175 int crit, void *ext_struc)
163{ 176 {
164 unsigned char *ext_der, *p; 177 unsigned char *ext_der;
165 int ext_len; 178 int ext_len;
166 ASN1_OCTET_STRING *ext_oct; 179 ASN1_OCTET_STRING *ext_oct;
167 X509_EXTENSION *ext; 180 X509_EXTENSION *ext;
168 /* Convert internal representation to DER */ 181 /* Convert internal representation to DER */
169 ext_len = method->i2d(ext_struc, NULL); 182 if (method->it)
170 if(!(ext_der = OPENSSL_malloc(ext_len))) goto merr; 183 {
171 p = ext_der; 184 ext_der = NULL;
172 method->i2d(ext_struc, &p); 185 ext_len = ASN1_item_i2d(ext_struc, &ext_der, ASN1_ITEM_ptr(method->it));
173 if(!(ext_oct = M_ASN1_OCTET_STRING_new())) goto merr; 186 if (ext_len < 0) goto merr;
187 }
188 else
189 {
190 unsigned char *p;
191 ext_len = method->i2d(ext_struc, NULL);
192 if(!(ext_der = OPENSSL_malloc(ext_len))) goto merr;
193 p = ext_der;
194 method->i2d(ext_struc, &p);
195 }
196 if (!(ext_oct = M_ASN1_OCTET_STRING_new())) goto merr;
174 ext_oct->data = ext_der; 197 ext_oct->data = ext_der;
175 ext_oct->length = ext_len; 198 ext_oct->length = ext_len;
176 199
177 ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct); 200 ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);
178 if(!ext) goto merr; 201 if (!ext) goto merr;
179 M_ASN1_OCTET_STRING_free(ext_oct); 202 M_ASN1_OCTET_STRING_free(ext_oct);
180 203
181 return ext; 204 return ext;
@@ -184,14 +207,14 @@ static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid,
184 X509V3err(X509V3_F_DO_EXT_I2D,ERR_R_MALLOC_FAILURE); 207 X509V3err(X509V3_F_DO_EXT_I2D,ERR_R_MALLOC_FAILURE);
185 return NULL; 208 return NULL;
186 209
187} 210 }
188 211
189/* Given an internal structure, nid and critical flag create an extension */ 212/* Given an internal structure, nid and critical flag create an extension */
190 213
191X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc) 214X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc)
192{ 215 {
193 X509V3_EXT_METHOD *method; 216 X509V3_EXT_METHOD *method;
194 if(!(method = X509V3_EXT_get_nid(ext_nid))) { 217 if (!(method = X509V3_EXT_get_nid(ext_nid))) {
195 X509V3err(X509V3_F_X509V3_EXT_I2D,X509V3_R_UNKNOWN_EXTENSION); 218 X509V3err(X509V3_F_X509V3_EXT_I2D,X509V3_R_UNKNOWN_EXTENSION);
196 return NULL; 219 return NULL;
197 } 220 }
@@ -202,7 +225,7 @@ X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc)
202static int v3_check_critical(char **value) 225static int v3_check_critical(char **value)
203{ 226{
204 char *p = *value; 227 char *p = *value;
205 if((strlen(p) < 9) || strncmp(p, "critical,", 9)) return 0; 228 if ((strlen(p) < 9) || strncmp(p, "critical,", 9)) return 0;
206 p+=9; 229 p+=9;
207 while(isspace((unsigned char)*p)) p++; 230 while(isspace((unsigned char)*p)) p++;
208 *value = p; 231 *value = p;
@@ -213,9 +236,9 @@ static int v3_check_critical(char **value)
213static int v3_check_generic(char **value) 236static int v3_check_generic(char **value)
214{ 237{
215 char *p = *value; 238 char *p = *value;
216 if((strlen(p) < 4) || strncmp(p, "DER:,", 4)) return 0; 239 if ((strlen(p) < 4) || strncmp(p, "DER:,", 4)) return 0;
217 p+=4; 240 p+=4;
218 while(isspace((unsigned char)*p)) p++; 241 while (isspace((unsigned char)*p)) p++;
219 *value = p; 242 *value = p;
220 return 1; 243 return 1;
221} 244}
@@ -223,148 +246,202 @@ static int v3_check_generic(char **value)
223/* Create a generic extension: for now just handle DER type */ 246/* Create a generic extension: for now just handle DER type */
224static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, 247static X509_EXTENSION *v3_generic_extension(const char *ext, char *value,
225 int crit, int type) 248 int crit, int type)
226{ 249 {
227unsigned char *ext_der=NULL; 250 unsigned char *ext_der=NULL;
228long ext_len; 251 long ext_len;
229ASN1_OBJECT *obj=NULL; 252 ASN1_OBJECT *obj=NULL;
230ASN1_OCTET_STRING *oct=NULL; 253 ASN1_OCTET_STRING *oct=NULL;
231X509_EXTENSION *extension=NULL; 254 X509_EXTENSION *extension=NULL;
232if(!(obj = OBJ_txt2obj(ext, 0))) { 255 if (!(obj = OBJ_txt2obj(ext, 0)))
233 X509V3err(X509V3_F_V3_GENERIC_EXTENSION,X509V3_R_EXTENSION_NAME_ERROR); 256 {
234 ERR_add_error_data(2, "name=", ext); 257 X509V3err(X509V3_F_V3_GENERIC_EXTENSION,X509V3_R_EXTENSION_NAME_ERROR);
235 goto err; 258 ERR_add_error_data(2, "name=", ext);
236} 259 goto err;
260 }
237 261
238if(!(ext_der = string_to_hex(value, &ext_len))) { 262 if (!(ext_der = string_to_hex(value, &ext_len)))
239 X509V3err(X509V3_F_V3_GENERIC_EXTENSION,X509V3_R_EXTENSION_VALUE_ERROR); 263 {
240 ERR_add_error_data(2, "value=", value); 264 X509V3err(X509V3_F_V3_GENERIC_EXTENSION,X509V3_R_EXTENSION_VALUE_ERROR);
241 goto err; 265 ERR_add_error_data(2, "value=", value);
242} 266 goto err;
267 }
243 268
244if(!(oct = M_ASN1_OCTET_STRING_new())) { 269 if (!(oct = M_ASN1_OCTET_STRING_new()))
245 X509V3err(X509V3_F_V3_GENERIC_EXTENSION,ERR_R_MALLOC_FAILURE); 270 {
246 goto err; 271 X509V3err(X509V3_F_V3_GENERIC_EXTENSION,ERR_R_MALLOC_FAILURE);
247} 272 goto err;
273 }
248 274
249oct->data = ext_der; 275 oct->data = ext_der;
250oct->length = ext_len; 276 oct->length = ext_len;
251ext_der = NULL; 277 ext_der = NULL;
252 278
253extension = X509_EXTENSION_create_by_OBJ(NULL, obj, crit, oct); 279 extension = X509_EXTENSION_create_by_OBJ(NULL, obj, crit, oct);
254 280
255err: 281 err:
256ASN1_OBJECT_free(obj); 282 ASN1_OBJECT_free(obj);
257M_ASN1_OCTET_STRING_free(oct); 283 M_ASN1_OCTET_STRING_free(oct);
258if(ext_der) OPENSSL_free(ext_der); 284 if(ext_der) OPENSSL_free(ext_der);
259return extension; 285 return extension;
260} 286
287 }
261 288
262 289
263/* This is the main function: add a bunch of extensions based on a config file 290/* This is the main function: add a bunch of extensions based on a config file
264 * section 291 * section to an extension STACK.
265 */ 292 */
266 293
267int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, 294
268 X509 *cert) 295int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section,
269{ 296 STACK_OF(X509_EXTENSION) **sk)
297 {
270 X509_EXTENSION *ext; 298 X509_EXTENSION *ext;
271 STACK_OF(CONF_VALUE) *nval; 299 STACK_OF(CONF_VALUE) *nval;
272 CONF_VALUE *val; 300 CONF_VALUE *val;
273 int i; 301 int i;
274 if(!(nval = CONF_get_section(conf, section))) return 0; 302 if (!(nval = NCONF_get_section(conf, section))) return 0;
275 for(i = 0; i < sk_CONF_VALUE_num(nval); i++) { 303 for (i = 0; i < sk_CONF_VALUE_num(nval); i++)
304 {
276 val = sk_CONF_VALUE_value(nval, i); 305 val = sk_CONF_VALUE_value(nval, i);
277 if(!(ext = X509V3_EXT_conf(conf, ctx, val->name, val->value))) 306 if (!(ext = X509V3_EXT_nconf(conf, ctx, val->name, val->value)))
278 return 0; 307 return 0;
279 if(cert) X509_add_ext(cert, ext, -1); 308 if (sk) X509v3_add_ext(sk, ext, -1);
280 X509_EXTENSION_free(ext); 309 X509_EXTENSION_free(ext);
281 } 310 }
282 return 1; 311 return 1;
283} 312 }
313
314/* Convenience functions to add extensions to a certificate, CRL and request */
315
316int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
317 X509 *cert)
318 {
319 STACK_OF(X509_EXTENSION) **sk = NULL;
320 if (cert)
321 sk = &cert->cert_info->extensions;
322 return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
323 }
284 324
285/* Same as above but for a CRL */ 325/* Same as above but for a CRL */
286 326
287int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, 327int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
288 X509_CRL *crl) 328 X509_CRL *crl)
289{ 329 {
290 X509_EXTENSION *ext; 330 STACK_OF(X509_EXTENSION) **sk = NULL;
291 STACK_OF(CONF_VALUE) *nval; 331 if (crl)
292 CONF_VALUE *val; 332 sk = &crl->crl->extensions;
293 int i; 333 return X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
294 if(!(nval = CONF_get_section(conf, section))) return 0;
295 for(i = 0; i < sk_CONF_VALUE_num(nval); i++) {
296 val = sk_CONF_VALUE_value(nval, i);
297 if(!(ext = X509V3_EXT_conf(conf, ctx, val->name, val->value)))
298 return 0;
299 if(crl) X509_CRL_add_ext(crl, ext, -1);
300 X509_EXTENSION_free(ext);
301 } 334 }
302 return 1;
303}
304 335
305/* Add extensions to certificate request */ 336/* Add extensions to certificate request */
306 337
307int X509V3_EXT_REQ_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, 338int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,
308 X509_REQ *req) 339 X509_REQ *req)
309{ 340 {
310 X509_EXTENSION *ext; 341 STACK_OF(X509_EXTENSION) *extlist = NULL, **sk = NULL;
311 STACK_OF(X509_EXTENSION) *extlist = NULL;
312 STACK_OF(CONF_VALUE) *nval;
313 CONF_VALUE *val;
314 int i; 342 int i;
315 if(!(nval = CONF_get_section(conf, section))) return 0; 343 if (req)
316 for(i = 0; i < sk_CONF_VALUE_num(nval); i++) { 344 sk = &extlist;
317 val = sk_CONF_VALUE_value(nval, i); 345 i = X509V3_EXT_add_nconf_sk(conf, ctx, section, sk);
318 if(!(ext = X509V3_EXT_conf(conf, ctx, val->name, val->value))) 346 if (!i || !sk)
319 return 0; 347 return i;
320 if(!extlist) extlist = sk_X509_EXTENSION_new_null(); 348 i = X509_REQ_add_extensions(req, extlist);
321 sk_X509_EXTENSION_push(extlist, ext);
322 }
323 if(req) i = X509_REQ_add_extensions(req, extlist);
324 else i = 1;
325 sk_X509_EXTENSION_pop_free(extlist, X509_EXTENSION_free); 349 sk_X509_EXTENSION_pop_free(extlist, X509_EXTENSION_free);
326 return i; 350 return i;
327} 351 }
328 352
329/* Config database functions */ 353/* Config database functions */
330 354
331char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section) 355char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section)
332{ 356 {
333 if(ctx->db_meth->get_string) 357 if (ctx->db_meth->get_string)
334 return ctx->db_meth->get_string(ctx->db, name, section); 358 return ctx->db_meth->get_string(ctx->db, name, section);
335 return NULL; 359 return NULL;
336} 360 }
337 361
338STACK_OF(CONF_VALUE) * X509V3_get_section(X509V3_CTX *ctx, char *section) 362STACK_OF(CONF_VALUE) * X509V3_get_section(X509V3_CTX *ctx, char *section)
339{ 363 {
340 if(ctx->db_meth->get_section) 364 if (ctx->db_meth->get_section)
341 return ctx->db_meth->get_section(ctx->db, section); 365 return ctx->db_meth->get_section(ctx->db, section);
342 return NULL; 366 return NULL;
343} 367 }
344 368
345void X509V3_string_free(X509V3_CTX *ctx, char *str) 369void X509V3_string_free(X509V3_CTX *ctx, char *str)
346{ 370 {
347 if(!str) return; 371 if (!str) return;
348 if(ctx->db_meth->free_string) 372 if (ctx->db_meth->free_string)
349 ctx->db_meth->free_string(ctx->db, str); 373 ctx->db_meth->free_string(ctx->db, str);
350} 374 }
351 375
352void X509V3_section_free(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section) 376void X509V3_section_free(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section)
353{ 377 {
354 if(!section) return; 378 if (!section) return;
355 if(ctx->db_meth->free_section) 379 if (ctx->db_meth->free_section)
356 ctx->db_meth->free_section(ctx->db, section); 380 ctx->db_meth->free_section(ctx->db, section);
357} 381 }
382
383static char *nconf_get_string(void *db, char *section, char *value)
384 {
385 return NCONF_get_string(db, section, value);
386 }
387
388static STACK_OF(CONF_VALUE) *nconf_get_section(void *db, char *section)
389 {
390 return NCONF_get_section(db, section);
391 }
392
393static X509V3_CONF_METHOD nconf_method = {
394nconf_get_string,
395nconf_get_section,
396NULL,
397NULL
398};
399
400void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf)
401 {
402 ctx->db_meth = &nconf_method;
403 ctx->db = conf;
404 }
405
406void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req,
407 X509_CRL *crl, int flags)
408 {
409 ctx->issuer_cert = issuer;
410 ctx->subject_cert = subj;
411 ctx->crl = crl;
412 ctx->subject_req = req;
413 ctx->flags = flags;
414 }
415
416/* Old conf compatibility functions */
417
418X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name,
419 char *value)
420 {
421 CONF ctmp;
422 CONF_set_nconf(&ctmp, conf);
423 return X509V3_EXT_nconf(&ctmp, ctx, name, value);
424 }
425
426/* LHASH *conf: Config file */
427/* char *value: Value */
428X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid,
429 char *value)
430 {
431 CONF ctmp;
432 CONF_set_nconf(&ctmp, conf);
433 return X509V3_EXT_nconf_nid(&ctmp, ctx, ext_nid, value);
434 }
358 435
359static char *conf_lhash_get_string(void *db, char *section, char *value) 436static char *conf_lhash_get_string(void *db, char *section, char *value)
360{ 437 {
361 return CONF_get_string(db, section, value); 438 return CONF_get_string(db, section, value);
362} 439 }
363 440
364static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db, char *section) 441static STACK_OF(CONF_VALUE) *conf_lhash_get_section(void *db, char *section)
365{ 442 {
366 return CONF_get_section(db, section); 443 return CONF_get_section(db, section);
367} 444 }
368 445
369static X509V3_CONF_METHOD conf_lhash_method = { 446static X509V3_CONF_METHOD conf_lhash_method = {
370conf_lhash_get_string, 447conf_lhash_get_string,
@@ -374,17 +451,35 @@ NULL
374}; 451};
375 452
376void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash) 453void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash)
377{ 454 {
378 ctx->db_meth = &conf_lhash_method; 455 ctx->db_meth = &conf_lhash_method;
379 ctx->db = lhash; 456 ctx->db = lhash;
380} 457 }
381 458
382void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req, 459int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section,
383 X509_CRL *crl, int flags) 460 X509 *cert)
384{ 461 {
385 ctx->issuer_cert = issuer; 462 CONF ctmp;
386 ctx->subject_cert = subj; 463 CONF_set_nconf(&ctmp, conf);
387 ctx->crl = crl; 464 return X509V3_EXT_add_nconf(&ctmp, ctx, section, cert);
388 ctx->subject_req = req; 465 }
389 ctx->flags = flags; 466
390} 467/* Same as above but for a CRL */
468
469int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section,
470 X509_CRL *crl)
471 {
472 CONF ctmp;
473 CONF_set_nconf(&ctmp, conf);
474 return X509V3_EXT_CRL_add_nconf(&ctmp, ctx, section, crl);
475 }
476
477/* Add extensions to certificate request */
478
479int X509V3_EXT_REQ_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section,
480 X509_REQ *req)
481 {
482 CONF ctmp;
483 CONF_set_nconf(&ctmp, conf);
484 return X509V3_EXT_REQ_add_nconf(&ctmp, ctx, section, req);
485 }
diff --git a/src/lib/libcrypto/x509v3/v3_cpols.c b/src/lib/libcrypto/x509v3/v3_cpols.c
index 8203ed7571..0d4ab1f680 100644
--- a/src/lib/libcrypto/x509v3/v3_cpols.c
+++ b/src/lib/libcrypto/x509v3/v3_cpols.c
@@ -60,7 +60,7 @@
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/conf.h> 61#include <openssl/conf.h>
62#include <openssl/asn1.h> 62#include <openssl/asn1.h>
63#include <openssl/asn1_mac.h> 63#include <openssl/asn1t.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66/* Certificate policies extension support: this one is a bit complex... */ 66/* Certificate policies extension support: this one is a bit complex... */
@@ -76,18 +76,55 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
76static STACK_OF(ASN1_INTEGER) *nref_nos(STACK_OF(CONF_VALUE) *nos); 76static STACK_OF(ASN1_INTEGER) *nref_nos(STACK_OF(CONF_VALUE) *nos);
77 77
78X509V3_EXT_METHOD v3_cpols = { 78X509V3_EXT_METHOD v3_cpols = {
79NID_certificate_policies, 0, 79NID_certificate_policies, 0,ASN1_ITEM_ref(CERTIFICATEPOLICIES),
80(X509V3_EXT_NEW)CERTIFICATEPOLICIES_new, 800,0,0,0,
81(X509V3_EXT_FREE)CERTIFICATEPOLICIES_free, 810,0,
82(X509V3_EXT_D2I)d2i_CERTIFICATEPOLICIES, 820,0,
83(X509V3_EXT_I2D)i2d_CERTIFICATEPOLICIES,
84NULL, NULL,
85NULL, NULL,
86(X509V3_EXT_I2R)i2r_certpol, 83(X509V3_EXT_I2R)i2r_certpol,
87(X509V3_EXT_R2I)r2i_certpol, 84(X509V3_EXT_R2I)r2i_certpol,
88NULL 85NULL
89}; 86};
90 87
88ASN1_ITEM_TEMPLATE(CERTIFICATEPOLICIES) =
89 ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, CERTIFICATEPOLICIES, POLICYINFO)
90ASN1_ITEM_TEMPLATE_END(CERTIFICATEPOLICIES)
91
92IMPLEMENT_ASN1_FUNCTIONS(CERTIFICATEPOLICIES)
93
94ASN1_SEQUENCE(POLICYINFO) = {
95 ASN1_SIMPLE(POLICYINFO, policyid, ASN1_OBJECT),
96 ASN1_SEQUENCE_OF_OPT(POLICYINFO, qualifiers, POLICYQUALINFO)
97} ASN1_SEQUENCE_END(POLICYINFO)
98
99IMPLEMENT_ASN1_FUNCTIONS(POLICYINFO)
100
101ASN1_ADB_TEMPLATE(policydefault) = ASN1_SIMPLE(POLICYQUALINFO, d.other, ASN1_ANY);
102
103ASN1_ADB(POLICYQUALINFO) = {
104 ADB_ENTRY(NID_id_qt_cps, ASN1_SIMPLE(POLICYQUALINFO, d.cpsuri, ASN1_IA5STRING)),
105 ADB_ENTRY(NID_id_qt_unotice, ASN1_SIMPLE(POLICYQUALINFO, d.usernotice, USERNOTICE))
106} ASN1_ADB_END(POLICYQUALINFO, 0, pqualid, 0, &policydefault_tt, NULL);
107
108ASN1_SEQUENCE(POLICYQUALINFO) = {
109 ASN1_SIMPLE(POLICYQUALINFO, pqualid, ASN1_OBJECT),
110 ASN1_ADB_OBJECT(POLICYQUALINFO)
111} ASN1_SEQUENCE_END(POLICYQUALINFO)
112
113IMPLEMENT_ASN1_FUNCTIONS(POLICYQUALINFO)
114
115ASN1_SEQUENCE(USERNOTICE) = {
116 ASN1_OPT(USERNOTICE, noticeref, NOTICEREF),
117 ASN1_OPT(USERNOTICE, exptext, DISPLAYTEXT)
118} ASN1_SEQUENCE_END(USERNOTICE)
119
120IMPLEMENT_ASN1_FUNCTIONS(USERNOTICE)
121
122ASN1_SEQUENCE(NOTICEREF) = {
123 ASN1_SIMPLE(NOTICEREF, organization, DISPLAYTEXT),
124 ASN1_SEQUENCE_OF(NOTICEREF, noticenos, ASN1_INTEGER)
125} ASN1_SEQUENCE_END(NOTICEREF)
126
127IMPLEMENT_ASN1_FUNCTIONS(NOTICEREF)
91 128
92static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method, 129static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method,
93 X509V3_CTX *ctx, char *value) 130 X509V3_CTX *ctx, char *value)
@@ -327,83 +364,6 @@ static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol,
327 return 1; 364 return 1;
328} 365}
329 366
330
331int i2d_CERTIFICATEPOLICIES(STACK_OF(POLICYINFO) *a, unsigned char **pp)
332{
333
334return i2d_ASN1_SET_OF_POLICYINFO(a, pp, i2d_POLICYINFO, V_ASN1_SEQUENCE,
335 V_ASN1_UNIVERSAL, IS_SEQUENCE);}
336
337STACK_OF(POLICYINFO) *CERTIFICATEPOLICIES_new(void)
338{
339 return sk_POLICYINFO_new_null();
340}
341
342void CERTIFICATEPOLICIES_free(STACK_OF(POLICYINFO) *a)
343{
344 sk_POLICYINFO_pop_free(a, POLICYINFO_free);
345}
346
347STACK_OF(POLICYINFO) *d2i_CERTIFICATEPOLICIES(STACK_OF(POLICYINFO) **a,
348 unsigned char **pp,long length)
349{
350return d2i_ASN1_SET_OF_POLICYINFO(a, pp, length, d2i_POLICYINFO,
351 POLICYINFO_free, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL);
352
353}
354
355IMPLEMENT_STACK_OF(POLICYINFO)
356IMPLEMENT_ASN1_SET_OF(POLICYINFO)
357
358int i2d_POLICYINFO(POLICYINFO *a, unsigned char **pp)
359{
360 M_ASN1_I2D_vars(a);
361
362 M_ASN1_I2D_len (a->policyid, i2d_ASN1_OBJECT);
363 M_ASN1_I2D_len_SEQUENCE_type(POLICYQUALINFO, a->qualifiers,
364 i2d_POLICYQUALINFO);
365
366 M_ASN1_I2D_seq_total();
367
368 M_ASN1_I2D_put (a->policyid, i2d_ASN1_OBJECT);
369 M_ASN1_I2D_put_SEQUENCE_type(POLICYQUALINFO, a->qualifiers,
370 i2d_POLICYQUALINFO);
371
372 M_ASN1_I2D_finish();
373}
374
375POLICYINFO *POLICYINFO_new(void)
376{
377 POLICYINFO *ret=NULL;
378 ASN1_CTX c;
379 M_ASN1_New_Malloc(ret, POLICYINFO);
380 ret->policyid = NULL;
381 ret->qualifiers = NULL;
382 return (ret);
383 M_ASN1_New_Error(ASN1_F_POLICYINFO_NEW);
384}
385
386POLICYINFO *d2i_POLICYINFO(POLICYINFO **a, unsigned char **pp,long length)
387{
388 M_ASN1_D2I_vars(a,POLICYINFO *,POLICYINFO_new);
389 M_ASN1_D2I_Init();
390 M_ASN1_D2I_start_sequence();
391 M_ASN1_D2I_get(ret->policyid, d2i_ASN1_OBJECT);
392 if(!M_ASN1_D2I_end_sequence()) {
393 M_ASN1_D2I_get_seq_type (POLICYQUALINFO, ret->qualifiers,
394 d2i_POLICYQUALINFO, POLICYQUALINFO_free);
395 }
396 M_ASN1_D2I_Finish(a, POLICYINFO_free, ASN1_F_D2I_POLICYINFO);
397}
398
399void POLICYINFO_free(POLICYINFO *a)
400{
401 if (a == NULL) return;
402 ASN1_OBJECT_free(a->policyid);
403 sk_POLICYQUALINFO_pop_free(a->qualifiers, POLICYQUALINFO_free);
404 OPENSSL_free (a);
405}
406
407static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, 367static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals,
408 int indent) 368 int indent)
409{ 369{
@@ -459,202 +419,4 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent)
459 BIO_printf(out, "%*sExplicit Text: %s\n", indent, "", 419 BIO_printf(out, "%*sExplicit Text: %s\n", indent, "",
460 notice->exptext->data); 420 notice->exptext->data);
461} 421}
462
463
464
465int i2d_POLICYQUALINFO(POLICYQUALINFO *a, unsigned char **pp)
466{
467 M_ASN1_I2D_vars(a);
468
469 M_ASN1_I2D_len (a->pqualid, i2d_ASN1_OBJECT);
470 switch(OBJ_obj2nid(a->pqualid)) {
471 case NID_id_qt_cps:
472 M_ASN1_I2D_len(a->d.cpsuri, i2d_ASN1_IA5STRING);
473 break;
474
475 case NID_id_qt_unotice:
476 M_ASN1_I2D_len(a->d.usernotice, i2d_USERNOTICE);
477 break;
478
479 default:
480 M_ASN1_I2D_len(a->d.other, i2d_ASN1_TYPE);
481 break;
482 }
483
484 M_ASN1_I2D_seq_total();
485
486 M_ASN1_I2D_put (a->pqualid, i2d_ASN1_OBJECT);
487 switch(OBJ_obj2nid(a->pqualid)) {
488 case NID_id_qt_cps:
489 M_ASN1_I2D_put(a->d.cpsuri, i2d_ASN1_IA5STRING);
490 break;
491
492 case NID_id_qt_unotice:
493 M_ASN1_I2D_put(a->d.usernotice, i2d_USERNOTICE);
494 break;
495
496 default:
497 M_ASN1_I2D_put(a->d.other, i2d_ASN1_TYPE);
498 break;
499 }
500
501 M_ASN1_I2D_finish();
502}
503
504POLICYQUALINFO *POLICYQUALINFO_new(void)
505{
506 POLICYQUALINFO *ret=NULL;
507 ASN1_CTX c;
508 M_ASN1_New_Malloc(ret, POLICYQUALINFO);
509 ret->pqualid = NULL;
510 ret->d.other = NULL;
511 return (ret);
512 M_ASN1_New_Error(ASN1_F_POLICYQUALINFO_NEW);
513}
514
515POLICYQUALINFO *d2i_POLICYQUALINFO(POLICYQUALINFO **a, unsigned char **pp,
516 long length)
517{
518 M_ASN1_D2I_vars(a,POLICYQUALINFO *,POLICYQUALINFO_new);
519 M_ASN1_D2I_Init();
520 M_ASN1_D2I_start_sequence();
521 M_ASN1_D2I_get (ret->pqualid, d2i_ASN1_OBJECT);
522 switch(OBJ_obj2nid(ret->pqualid)) {
523 case NID_id_qt_cps:
524 M_ASN1_D2I_get(ret->d.cpsuri, d2i_ASN1_IA5STRING);
525 break;
526
527 case NID_id_qt_unotice:
528 M_ASN1_D2I_get(ret->d.usernotice, d2i_USERNOTICE);
529 break;
530
531 default:
532 M_ASN1_D2I_get(ret->d.other, d2i_ASN1_TYPE);
533 break;
534 }
535 M_ASN1_D2I_Finish(a, POLICYQUALINFO_free, ASN1_F_D2I_POLICYQUALINFO);
536}
537
538void POLICYQUALINFO_free(POLICYQUALINFO *a)
539{
540 if (a == NULL) return;
541 switch(OBJ_obj2nid(a->pqualid)) {
542 case NID_id_qt_cps:
543 M_ASN1_IA5STRING_free(a->d.cpsuri);
544 break;
545
546 case NID_id_qt_unotice:
547 USERNOTICE_free(a->d.usernotice);
548 break;
549
550 default:
551 ASN1_TYPE_free(a->d.other);
552 break;
553 }
554
555 ASN1_OBJECT_free(a->pqualid);
556 OPENSSL_free (a);
557}
558
559int i2d_USERNOTICE(USERNOTICE *a, unsigned char **pp)
560{
561 M_ASN1_I2D_vars(a);
562
563 M_ASN1_I2D_len (a->noticeref, i2d_NOTICEREF);
564 M_ASN1_I2D_len (a->exptext, i2d_DISPLAYTEXT);
565
566 M_ASN1_I2D_seq_total();
567
568 M_ASN1_I2D_put (a->noticeref, i2d_NOTICEREF);
569 M_ASN1_I2D_put (a->exptext, i2d_DISPLAYTEXT);
570
571 M_ASN1_I2D_finish();
572}
573
574USERNOTICE *USERNOTICE_new(void)
575{
576 USERNOTICE *ret=NULL;
577 ASN1_CTX c;
578 M_ASN1_New_Malloc(ret, USERNOTICE);
579 ret->noticeref = NULL;
580 ret->exptext = NULL;
581 return (ret);
582 M_ASN1_New_Error(ASN1_F_USERNOTICE_NEW);
583}
584
585USERNOTICE *d2i_USERNOTICE(USERNOTICE **a, unsigned char **pp,long length)
586{
587 M_ASN1_D2I_vars(a,USERNOTICE *,USERNOTICE_new);
588 M_ASN1_D2I_Init();
589 M_ASN1_D2I_start_sequence();
590 M_ASN1_D2I_get_opt(ret->noticeref, d2i_NOTICEREF, V_ASN1_SEQUENCE);
591 if (!M_ASN1_D2I_end_sequence()) {
592 M_ASN1_D2I_get(ret->exptext, d2i_DISPLAYTEXT);
593 }
594 M_ASN1_D2I_Finish(a, USERNOTICE_free, ASN1_F_D2I_USERNOTICE);
595}
596
597void USERNOTICE_free(USERNOTICE *a)
598{
599 if (a == NULL) return;
600 NOTICEREF_free(a->noticeref);
601 M_DISPLAYTEXT_free(a->exptext);
602 OPENSSL_free (a);
603}
604
605int i2d_NOTICEREF(NOTICEREF *a, unsigned char **pp)
606{
607 M_ASN1_I2D_vars(a);
608
609 M_ASN1_I2D_len (a->organization, i2d_DISPLAYTEXT);
610 M_ASN1_I2D_len_SEQUENCE_type(ASN1_INTEGER, a->noticenos,
611 i2d_ASN1_INTEGER);
612
613 M_ASN1_I2D_seq_total();
614
615 M_ASN1_I2D_put (a->organization, i2d_DISPLAYTEXT);
616 M_ASN1_I2D_put_SEQUENCE_type(ASN1_INTEGER, a->noticenos,
617 i2d_ASN1_INTEGER);
618
619 M_ASN1_I2D_finish();
620}
621
622NOTICEREF *NOTICEREF_new(void)
623{
624 NOTICEREF *ret=NULL;
625 ASN1_CTX c;
626 M_ASN1_New_Malloc(ret, NOTICEREF);
627 ret->organization = NULL;
628 ret->noticenos = NULL;
629 return (ret);
630 M_ASN1_New_Error(ASN1_F_NOTICEREF_NEW);
631}
632
633NOTICEREF *d2i_NOTICEREF(NOTICEREF **a, unsigned char **pp,long length)
634{
635 M_ASN1_D2I_vars(a,NOTICEREF *,NOTICEREF_new);
636 M_ASN1_D2I_Init();
637 M_ASN1_D2I_start_sequence();
638 /* This is to cope with some broken encodings that use IA5STRING for
639 * the organization field
640 */
641 M_ASN1_D2I_get_opt(ret->organization, d2i_ASN1_IA5STRING,
642 V_ASN1_IA5STRING);
643 if(!ret->organization) {
644 M_ASN1_D2I_get(ret->organization, d2i_DISPLAYTEXT);
645 }
646 M_ASN1_D2I_get_seq_type(ASN1_INTEGER, ret->noticenos, d2i_ASN1_INTEGER,
647 ASN1_STRING_free);
648 M_ASN1_D2I_Finish(a, NOTICEREF_free, ASN1_F_D2I_NOTICEREF);
649}
650
651void NOTICEREF_free(NOTICEREF *a)
652{
653 if (a == NULL) return;
654 M_DISPLAYTEXT_free(a->organization);
655 sk_ASN1_INTEGER_pop_free(a->noticenos, ASN1_STRING_free);
656 OPENSSL_free (a);
657}
658 422
659IMPLEMENT_STACK_OF(POLICYQUALINFO)
660IMPLEMENT_ASN1_SET_OF(POLICYQUALINFO)
diff --git a/src/lib/libcrypto/x509v3/v3_crld.c b/src/lib/libcrypto/x509v3/v3_crld.c
index 67feea4017..894a8b94d8 100644
--- a/src/lib/libcrypto/x509v3/v3_crld.c
+++ b/src/lib/libcrypto/x509v3/v3_crld.c
@@ -60,7 +60,7 @@
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/conf.h> 61#include <openssl/conf.h>
62#include <openssl/asn1.h> 62#include <openssl/asn1.h>
63#include <openssl/asn1_mac.h> 63#include <openssl/asn1t.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66static STACK_OF(CONF_VALUE) *i2v_crld(X509V3_EXT_METHOD *method, 66static STACK_OF(CONF_VALUE) *i2v_crld(X509V3_EXT_METHOD *method,
@@ -69,15 +69,13 @@ static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method,
69 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); 69 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
70 70
71X509V3_EXT_METHOD v3_crld = { 71X509V3_EXT_METHOD v3_crld = {
72NID_crl_distribution_points, X509V3_EXT_MULTILINE, 72NID_crl_distribution_points, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(CRL_DIST_POINTS),
73(X509V3_EXT_NEW)CRL_DIST_POINTS_new, 730,0,0,0,
74(X509V3_EXT_FREE)CRL_DIST_POINTS_free, 740,0,
75(X509V3_EXT_D2I)d2i_CRL_DIST_POINTS,
76(X509V3_EXT_I2D)i2d_CRL_DIST_POINTS,
77NULL, NULL,
78(X509V3_EXT_I2V)i2v_crld, 75(X509V3_EXT_I2V)i2v_crld,
79(X509V3_EXT_V2I)v2i_crld, 76(X509V3_EXT_V2I)v2i_crld,
80NULL, NULL, NULL 770,0,
78NULL
81}; 79};
82 80
83static STACK_OF(CONF_VALUE) *i2v_crld(X509V3_EXT_METHOD *method, 81static STACK_OF(CONF_VALUE) *i2v_crld(X509V3_EXT_METHOD *method,
@@ -87,16 +85,16 @@ static STACK_OF(CONF_VALUE) *i2v_crld(X509V3_EXT_METHOD *method,
87 int i; 85 int i;
88 for(i = 0; i < sk_DIST_POINT_num(crld); i++) { 86 for(i = 0; i < sk_DIST_POINT_num(crld); i++) {
89 point = sk_DIST_POINT_value(crld, i); 87 point = sk_DIST_POINT_value(crld, i);
90 if(point->distpoint && point->distpoint->fullname) { 88 if(point->distpoint) {
91 exts = i2v_GENERAL_NAMES(NULL, 89 if(point->distpoint->type == 0)
92 point->distpoint->fullname, exts); 90 exts = i2v_GENERAL_NAMES(NULL,
91 point->distpoint->name.fullname, exts);
92 else X509V3_add_value("RelativeName","<UNSUPPORTED>", &exts);
93 } 93 }
94 if(point->reasons) 94 if(point->reasons)
95 X509V3_add_value("reasons","<UNSUPPORTED>", &exts); 95 X509V3_add_value("reasons","<UNSUPPORTED>", &exts);
96 if(point->CRLissuer) 96 if(point->CRLissuer)
97 X509V3_add_value("CRLissuer","<UNSUPPORTED>", &exts); 97 X509V3_add_value("CRLissuer","<UNSUPPORTED>", &exts);
98 if(point->distpoint && point->distpoint->relativename)
99 X509V3_add_value("RelativeName","<UNSUPPORTED>", &exts);
100 } 98 }
101 return exts; 99 return exts;
102} 100}
@@ -105,7 +103,7 @@ static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method,
105 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) 103 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
106{ 104{
107 STACK_OF(DIST_POINT) *crld = NULL; 105 STACK_OF(DIST_POINT) *crld = NULL;
108 STACK_OF(GENERAL_NAME) *gens = NULL; 106 GENERAL_NAMES *gens = NULL;
109 GENERAL_NAME *gen = NULL; 107 GENERAL_NAME *gen = NULL;
110 CONF_VALUE *cnf; 108 CONF_VALUE *cnf;
111 int i; 109 int i;
@@ -123,7 +121,8 @@ static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method,
123 goto merr; 121 goto merr;
124 } 122 }
125 if(!(point->distpoint = DIST_POINT_NAME_new())) goto merr; 123 if(!(point->distpoint = DIST_POINT_NAME_new())) goto merr;
126 point->distpoint->fullname = gens; 124 point->distpoint->name.fullname = gens;
125 point->distpoint->type = 0;
127 gens = NULL; 126 gens = NULL;
128 } 127 }
129 return crld; 128 return crld;
@@ -137,149 +136,27 @@ static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method,
137 return NULL; 136 return NULL;
138} 137}
139 138
140int i2d_CRL_DIST_POINTS(STACK_OF(DIST_POINT) *a, unsigned char **pp)
141{
142
143return i2d_ASN1_SET_OF_DIST_POINT(a, pp, i2d_DIST_POINT, V_ASN1_SEQUENCE,
144 V_ASN1_UNIVERSAL, IS_SEQUENCE);}
145
146STACK_OF(DIST_POINT) *CRL_DIST_POINTS_new(void)
147{
148 return sk_DIST_POINT_new_null();
149}
150
151void CRL_DIST_POINTS_free(STACK_OF(DIST_POINT) *a)
152{
153 sk_DIST_POINT_pop_free(a, DIST_POINT_free);
154}
155
156STACK_OF(DIST_POINT) *d2i_CRL_DIST_POINTS(STACK_OF(DIST_POINT) **a,
157 unsigned char **pp,long length)
158{
159return d2i_ASN1_SET_OF_DIST_POINT(a, pp, length, d2i_DIST_POINT,
160 DIST_POINT_free, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL);
161
162}
163
164IMPLEMENT_STACK_OF(DIST_POINT) 139IMPLEMENT_STACK_OF(DIST_POINT)
165IMPLEMENT_ASN1_SET_OF(DIST_POINT) 140IMPLEMENT_ASN1_SET_OF(DIST_POINT)
166 141
167int i2d_DIST_POINT(DIST_POINT *a, unsigned char **pp)
168{
169 int v = 0;
170 M_ASN1_I2D_vars(a);
171 /* NB: underlying type is a CHOICE so need EXPLICIT tagging */
172 M_ASN1_I2D_len_EXP_opt (a->distpoint, i2d_DIST_POINT_NAME, 0, v);
173 M_ASN1_I2D_len_IMP_opt (a->reasons, i2d_ASN1_BIT_STRING);
174 M_ASN1_I2D_len_IMP_opt (a->CRLissuer, i2d_GENERAL_NAMES);
175 142
176 M_ASN1_I2D_seq_total(); 143ASN1_CHOICE(DIST_POINT_NAME) = {
144 ASN1_IMP_SEQUENCE_OF(DIST_POINT_NAME, name.fullname, GENERAL_NAME, 0),
145 ASN1_IMP_SET_OF(DIST_POINT_NAME, name.relativename, X509_NAME_ENTRY, 1)
146} ASN1_CHOICE_END(DIST_POINT_NAME)
177 147
178 M_ASN1_I2D_put_EXP_opt (a->distpoint, i2d_DIST_POINT_NAME, 0, v); 148IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT_NAME)
179 M_ASN1_I2D_put_IMP_opt (a->reasons, i2d_ASN1_BIT_STRING, 1);
180 M_ASN1_I2D_put_IMP_opt (a->CRLissuer, i2d_GENERAL_NAMES, 2);
181 149
182 M_ASN1_I2D_finish(); 150ASN1_SEQUENCE(DIST_POINT) = {
183} 151 ASN1_EXP_OPT(DIST_POINT, distpoint, DIST_POINT_NAME, 0),
152 ASN1_IMP_OPT(DIST_POINT, reasons, ASN1_BIT_STRING, 1),
153 ASN1_IMP_SEQUENCE_OF_OPT(DIST_POINT, CRLissuer, GENERAL_NAME, 2)
154} ASN1_SEQUENCE_END(DIST_POINT)
184 155
185DIST_POINT *DIST_POINT_new(void) 156IMPLEMENT_ASN1_FUNCTIONS(DIST_POINT)
186{
187 DIST_POINT *ret=NULL;
188 ASN1_CTX c;
189 M_ASN1_New_Malloc(ret, DIST_POINT);
190 ret->distpoint = NULL;
191 ret->reasons = NULL;
192 ret->CRLissuer = NULL;
193 return (ret);
194 M_ASN1_New_Error(ASN1_F_DIST_POINT_NEW);
195}
196 157
197DIST_POINT *d2i_DIST_POINT(DIST_POINT **a, unsigned char **pp, long length) 158ASN1_ITEM_TEMPLATE(CRL_DIST_POINTS) =
198{ 159 ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, DIST_POINT, DIST_POINT)
199 M_ASN1_D2I_vars(a,DIST_POINT *,DIST_POINT_new); 160ASN1_ITEM_TEMPLATE_END(CRL_DIST_POINTS)
200 M_ASN1_D2I_Init();
201 M_ASN1_D2I_start_sequence();
202 M_ASN1_D2I_get_EXP_opt (ret->distpoint, d2i_DIST_POINT_NAME, 0);
203 M_ASN1_D2I_get_IMP_opt (ret->reasons, d2i_ASN1_BIT_STRING, 1,
204 V_ASN1_BIT_STRING);
205 M_ASN1_D2I_get_IMP_opt (ret->CRLissuer, d2i_GENERAL_NAMES, 2,
206 V_ASN1_SEQUENCE);
207 M_ASN1_D2I_Finish(a, DIST_POINT_free, ASN1_F_D2I_DIST_POINT);
208}
209 161
210void DIST_POINT_free(DIST_POINT *a) 162IMPLEMENT_ASN1_FUNCTIONS(CRL_DIST_POINTS)
211{
212 if (a == NULL) return;
213 DIST_POINT_NAME_free(a->distpoint);
214 M_ASN1_BIT_STRING_free(a->reasons);
215 sk_GENERAL_NAME_pop_free(a->CRLissuer, GENERAL_NAME_free);
216 OPENSSL_free (a);
217}
218
219int i2d_DIST_POINT_NAME(DIST_POINT_NAME *a, unsigned char **pp)
220{
221 M_ASN1_I2D_vars(a);
222
223 if(a->fullname) {
224 M_ASN1_I2D_len_IMP_opt (a->fullname, i2d_GENERAL_NAMES);
225 } else {
226 M_ASN1_I2D_len_IMP_SET_opt_type(X509_NAME_ENTRY,
227 a->relativename, i2d_X509_NAME_ENTRY, 1);
228 }
229
230 /* Don't want a SEQUENCE so... */
231 if(pp == NULL) return ret;
232 p = *pp;
233
234 if(a->fullname) {
235 M_ASN1_I2D_put_IMP_opt (a->fullname, i2d_GENERAL_NAMES, 0);
236 } else {
237 M_ASN1_I2D_put_IMP_SET_opt_type(X509_NAME_ENTRY,
238 a->relativename, i2d_X509_NAME_ENTRY, 1);
239 }
240 M_ASN1_I2D_finish();
241}
242
243DIST_POINT_NAME *DIST_POINT_NAME_new(void)
244{
245 DIST_POINT_NAME *ret=NULL;
246 ASN1_CTX c;
247 M_ASN1_New_Malloc(ret, DIST_POINT_NAME);
248 ret->fullname = NULL;
249 ret->relativename = NULL;
250 return (ret);
251 M_ASN1_New_Error(ASN1_F_DIST_POINT_NAME_NEW);
252}
253
254void DIST_POINT_NAME_free(DIST_POINT_NAME *a)
255{
256 if (a == NULL) return;
257 sk_X509_NAME_ENTRY_pop_free(a->relativename, X509_NAME_ENTRY_free);
258 sk_GENERAL_NAME_pop_free(a->fullname, GENERAL_NAME_free);
259 OPENSSL_free (a);
260}
261
262DIST_POINT_NAME *d2i_DIST_POINT_NAME(DIST_POINT_NAME **a, unsigned char **pp,
263 long length)
264{
265 unsigned char _tmp, tag;
266 M_ASN1_D2I_vars(a,DIST_POINT_NAME *,DIST_POINT_NAME_new);
267 M_ASN1_D2I_Init();
268 c.slen = length;
269
270 _tmp = M_ASN1_next;
271 tag = _tmp & ~V_ASN1_CONSTRUCTED;
272
273 if(tag == (0|V_ASN1_CONTEXT_SPECIFIC)) {
274 M_ASN1_D2I_get_imp(ret->fullname, d2i_GENERAL_NAMES,
275 V_ASN1_SEQUENCE);
276 } else if (tag == (1|V_ASN1_CONTEXT_SPECIFIC)) {
277 M_ASN1_D2I_get_IMP_set_opt_type (X509_NAME_ENTRY,
278 ret->relativename, d2i_X509_NAME_ENTRY, X509_NAME_ENTRY_free, 1);
279 } else {
280 c.error = ASN1_R_BAD_TAG;
281 goto err;
282 }
283
284 M_ASN1_D2I_Finish(a, DIST_POINT_NAME_free, ASN1_F_D2I_DIST_POINT_NAME);
285}
diff --git a/src/lib/libcrypto/x509v3/v3_enum.c b/src/lib/libcrypto/x509v3/v3_enum.c
index aecfdc87f8..010c9d6260 100644
--- a/src/lib/libcrypto/x509v3/v3_enum.c
+++ b/src/lib/libcrypto/x509v3/v3_enum.c
@@ -73,14 +73,12 @@ static ENUMERATED_NAMES crl_reasons[] = {
73}; 73};
74 74
75X509V3_EXT_METHOD v3_crl_reason = { 75X509V3_EXT_METHOD v3_crl_reason = {
76NID_crl_reason, 0, 76NID_crl_reason, 0, ASN1_ITEM_ref(ASN1_ENUMERATED),
77(X509V3_EXT_NEW)ASN1_ENUMERATED_new, 770,0,0,0,
78(X509V3_EXT_FREE)ASN1_ENUMERATED_free,
79(X509V3_EXT_D2I)d2i_ASN1_ENUMERATED,
80(X509V3_EXT_I2D)i2d_ASN1_ENUMERATED,
81(X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE, 78(X509V3_EXT_I2S)i2s_ASN1_ENUMERATED_TABLE,
82(X509V3_EXT_S2I)0, 790,
83NULL, NULL, NULL, NULL, crl_reasons}; 800,0,0,0,
81crl_reasons};
84 82
85 83
86char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, 84char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method,
diff --git a/src/lib/libcrypto/x509v3/v3_extku.c b/src/lib/libcrypto/x509v3/v3_extku.c
index 53ec40a027..b1cfaba1aa 100644
--- a/src/lib/libcrypto/x509v3/v3_extku.c
+++ b/src/lib/libcrypto/x509v3/v3_extku.c
@@ -59,92 +59,84 @@
59 59
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include <openssl/asn1.h> 62#include <openssl/asn1t.h>
63#include <openssl/conf.h> 63#include <openssl/conf.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66static STACK_OF(ASN1_OBJECT) *v2i_ext_ku(X509V3_EXT_METHOD *method, 66static void *v2i_EXTENDED_KEY_USAGE(X509V3_EXT_METHOD *method,
67 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); 67 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
68static STACK_OF(CONF_VALUE) *i2v_ext_ku(X509V3_EXT_METHOD *method, 68static STACK_OF(CONF_VALUE) *i2v_EXTENDED_KEY_USAGE(X509V3_EXT_METHOD *method,
69 STACK_OF(ASN1_OBJECT) *eku, STACK_OF(CONF_VALUE) *extlist); 69 void *eku, STACK_OF(CONF_VALUE) *extlist);
70
70X509V3_EXT_METHOD v3_ext_ku = { 71X509V3_EXT_METHOD v3_ext_ku = {
71NID_ext_key_usage, 0, 72 NID_ext_key_usage, 0,
72(X509V3_EXT_NEW)ext_ku_new, 73 ASN1_ITEM_ref(EXTENDED_KEY_USAGE),
73(X509V3_EXT_FREE)ext_ku_free, 74 0,0,0,0,
74(X509V3_EXT_D2I)d2i_ext_ku, 75 0,0,
75(X509V3_EXT_I2D)i2d_ext_ku, 76 i2v_EXTENDED_KEY_USAGE,
76NULL, NULL, 77 v2i_EXTENDED_KEY_USAGE,
77(X509V3_EXT_I2V)i2v_ext_ku, 78 0,0,
78(X509V3_EXT_V2I)v2i_ext_ku, 79 NULL
79NULL,NULL,
80NULL
81}; 80};
82 81
83STACK_OF(ASN1_OBJECT) *ext_ku_new(void) 82/* NB OCSP acceptable responses also is a SEQUENCE OF OBJECT */
84{ 83X509V3_EXT_METHOD v3_ocsp_accresp = {
85 return sk_ASN1_OBJECT_new_null(); 84 NID_id_pkix_OCSP_acceptableResponses, 0,
86} 85 ASN1_ITEM_ref(EXTENDED_KEY_USAGE),
87 86 0,0,0,0,
88void ext_ku_free(STACK_OF(ASN1_OBJECT) *eku) 87 0,0,
89{ 88 i2v_EXTENDED_KEY_USAGE,
90 sk_ASN1_OBJECT_pop_free(eku, ASN1_OBJECT_free); 89 v2i_EXTENDED_KEY_USAGE,
91 return; 90 0,0,
92} 91 NULL
93 92};
94int i2d_ext_ku(STACK_OF(ASN1_OBJECT) *a, unsigned char **pp)
95{
96 return i2d_ASN1_SET_OF_ASN1_OBJECT(a, pp, i2d_ASN1_OBJECT,
97 V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, IS_SEQUENCE);
98}
99
100STACK_OF(ASN1_OBJECT) *d2i_ext_ku(STACK_OF(ASN1_OBJECT) **a,
101 unsigned char **pp, long length)
102{
103 return d2i_ASN1_SET_OF_ASN1_OBJECT(a, pp, length, d2i_ASN1_OBJECT,
104 ASN1_OBJECT_free, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL);
105}
106 93
94ASN1_ITEM_TEMPLATE(EXTENDED_KEY_USAGE) =
95 ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, EXTENDED_KEY_USAGE, ASN1_OBJECT)
96ASN1_ITEM_TEMPLATE_END(EXTENDED_KEY_USAGE)
107 97
98IMPLEMENT_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE)
108 99
109static STACK_OF(CONF_VALUE) *i2v_ext_ku(X509V3_EXT_METHOD *method, 100static STACK_OF(CONF_VALUE) *i2v_EXTENDED_KEY_USAGE(X509V3_EXT_METHOD *method,
110 STACK_OF(ASN1_OBJECT) *eku, STACK_OF(CONF_VALUE) *ext_list) 101 void *a, STACK_OF(CONF_VALUE) *ext_list)
111{ 102{
112int i; 103 EXTENDED_KEY_USAGE *eku = a;
113ASN1_OBJECT *obj; 104 int i;
114char obj_tmp[80]; 105 ASN1_OBJECT *obj;
115for(i = 0; i < sk_ASN1_OBJECT_num(eku); i++) { 106 char obj_tmp[80];
116 obj = sk_ASN1_OBJECT_value(eku, i); 107 for(i = 0; i < sk_ASN1_OBJECT_num(eku); i++) {
117 i2t_ASN1_OBJECT(obj_tmp, 80, obj); 108 obj = sk_ASN1_OBJECT_value(eku, i);
118 X509V3_add_value(NULL, obj_tmp, &ext_list); 109 i2t_ASN1_OBJECT(obj_tmp, 80, obj);
119} 110 X509V3_add_value(NULL, obj_tmp, &ext_list);
120return ext_list; 111 }
112 return ext_list;
121} 113}
122 114
123static STACK_OF(ASN1_OBJECT) *v2i_ext_ku(X509V3_EXT_METHOD *method, 115static void *v2i_EXTENDED_KEY_USAGE(X509V3_EXT_METHOD *method,
124 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) 116 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
125{ 117{
126STACK_OF(ASN1_OBJECT) *extku; 118 EXTENDED_KEY_USAGE *extku;
127char *extval; 119 char *extval;
128ASN1_OBJECT *objtmp; 120 ASN1_OBJECT *objtmp;
129CONF_VALUE *val; 121 CONF_VALUE *val;
130int i; 122 int i;
131 123
132if(!(extku = sk_ASN1_OBJECT_new_null())) { 124 if(!(extku = sk_ASN1_OBJECT_new_null())) {
133 X509V3err(X509V3_F_V2I_EXT_KU,ERR_R_MALLOC_FAILURE); 125 X509V3err(X509V3_F_V2I_EXT_KU,ERR_R_MALLOC_FAILURE);
134 return NULL;
135}
136
137for(i = 0; i < sk_CONF_VALUE_num(nval); i++) {
138 val = sk_CONF_VALUE_value(nval, i);
139 if(val->value) extval = val->value;
140 else extval = val->name;
141 if(!(objtmp = OBJ_txt2obj(extval, 0))) {
142 sk_ASN1_OBJECT_pop_free(extku, ASN1_OBJECT_free);
143 X509V3err(X509V3_F_V2I_EXT_KU,X509V3_R_INVALID_OBJECT_IDENTIFIER);
144 X509V3_conf_err(val);
145 return NULL; 126 return NULL;
146 } 127 }
147 sk_ASN1_OBJECT_push(extku, objtmp); 128
148} 129 for(i = 0; i < sk_CONF_VALUE_num(nval); i++) {
149return extku; 130 val = sk_CONF_VALUE_value(nval, i);
131 if(val->value) extval = val->value;
132 else extval = val->name;
133 if(!(objtmp = OBJ_txt2obj(extval, 0))) {
134 sk_ASN1_OBJECT_pop_free(extku, ASN1_OBJECT_free);
135 X509V3err(X509V3_F_V2I_EXT_KU,X509V3_R_INVALID_OBJECT_IDENTIFIER);
136 X509V3_conf_err(val);
137 return NULL;
138 }
139 sk_ASN1_OBJECT_push(extku, objtmp);
140 }
141 return extku;
150} 142}
diff --git a/src/lib/libcrypto/x509v3/v3_genn.c b/src/lib/libcrypto/x509v3/v3_genn.c
index d44751458e..650b510980 100644
--- a/src/lib/libcrypto/x509v3/v3_genn.c
+++ b/src/lib/libcrypto/x509v3/v3_genn.c
@@ -59,233 +59,43 @@
59 59
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include <openssl/asn1.h> 62#include <openssl/asn1t.h>
63#include <openssl/asn1_mac.h>
64#include <openssl/conf.h> 63#include <openssl/conf.h>
65#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
66 65
67int i2d_GENERAL_NAME(GENERAL_NAME *a, unsigned char **pp) 66ASN1_SEQUENCE(OTHERNAME) = {
68{ 67 ASN1_SIMPLE(OTHERNAME, type_id, ASN1_OBJECT),
69 unsigned char *p; 68 /* Maybe have a true ANY DEFINED BY later */
70 int ret; 69 ASN1_EXP(OTHERNAME, value, ASN1_ANY, 0)
71 70} ASN1_SEQUENCE_END(OTHERNAME)
72 ret = 0; 71
73 72IMPLEMENT_ASN1_FUNCTIONS(OTHERNAME)
74 /* Save the location of initial TAG */ 73
75 if(pp) p = *pp; 74ASN1_SEQUENCE(EDIPARTYNAME) = {
76 else p = NULL; 75 ASN1_IMP_OPT(EDIPARTYNAME, nameAssigner, DIRECTORYSTRING, 0),
77 76 ASN1_IMP_OPT(EDIPARTYNAME, partyName, DIRECTORYSTRING, 1)
78 /* GEN_DNAME needs special treatment because of EXPLICIT tag */ 77} ASN1_SEQUENCE_END(EDIPARTYNAME)
79 78
80 if(a->type == GEN_DIRNAME) { 79IMPLEMENT_ASN1_FUNCTIONS(EDIPARTYNAME)
81 int v = 0; 80
82 M_ASN1_I2D_len_EXP_opt(a->d.dirn, i2d_X509_NAME, 4, v); 81ASN1_CHOICE(GENERAL_NAME) = {
83 if(!p) return ret; 82 ASN1_IMP(GENERAL_NAME, d.otherName, OTHERNAME, GEN_OTHERNAME),
84 M_ASN1_I2D_put_EXP_opt(a->d.dirn, i2d_X509_NAME, 4, v); 83 ASN1_IMP(GENERAL_NAME, d.rfc822Name, ASN1_IA5STRING, GEN_EMAIL),
85 *pp = p; 84 ASN1_IMP(GENERAL_NAME, d.dNSName, ASN1_IA5STRING, GEN_DNS),
86 return ret; 85 /* Don't decode this */
87 } 86 ASN1_IMP(GENERAL_NAME, d.x400Address, ASN1_SEQUENCE, GEN_X400),
88 87 /* X509_NAME is a CHOICE type so use EXPLICIT */
89 switch(a->type) { 88 ASN1_EXP(GENERAL_NAME, d.directoryName, X509_NAME, GEN_DIRNAME),
90 89 ASN1_IMP(GENERAL_NAME, d.ediPartyName, EDIPARTYNAME, GEN_EDIPARTY),
91 case GEN_X400: 90 ASN1_IMP(GENERAL_NAME, d.uniformResourceIdentifier, ASN1_IA5STRING, GEN_URI),
92 case GEN_EDIPARTY: 91 ASN1_IMP(GENERAL_NAME, d.iPAddress, ASN1_OCTET_STRING, GEN_IPADD),
93 ret = i2d_ASN1_TYPE(a->d.other, pp); 92 ASN1_IMP(GENERAL_NAME, d.registeredID, ASN1_OBJECT, GEN_RID)
94 break; 93} ASN1_CHOICE_END(GENERAL_NAME)
95 94
96 case GEN_OTHERNAME: 95IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAME)
97 ret = i2d_OTHERNAME(a->d.otherName, pp); 96
98 break; 97ASN1_ITEM_TEMPLATE(GENERAL_NAMES) =
99 98 ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, GeneralNames, GENERAL_NAME)
100 case GEN_EMAIL: 99ASN1_ITEM_TEMPLATE_END(GENERAL_NAMES)
101 case GEN_DNS: 100
102 case GEN_URI: 101IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAMES)
103 ret = i2d_ASN1_IA5STRING(a->d.ia5, pp);
104 break;
105
106 case GEN_IPADD:
107 ret = i2d_ASN1_OCTET_STRING(a->d.ip, pp);
108 break;
109
110 case GEN_RID:
111 ret = i2d_ASN1_OBJECT(a->d.rid, pp);
112 break;
113 }
114 /* Replace TAG with IMPLICIT value */
115 if(p) *p = (*p & V_ASN1_CONSTRUCTED) | a->type;
116 return ret;
117}
118
119GENERAL_NAME *GENERAL_NAME_new()
120{
121 GENERAL_NAME *ret=NULL;
122 ASN1_CTX c;
123 M_ASN1_New_Malloc(ret, GENERAL_NAME);
124 ret->type = -1;
125 ret->d.ptr = NULL;
126 return (ret);
127 M_ASN1_New_Error(ASN1_F_GENERAL_NAME_NEW);
128}
129
130GENERAL_NAME *d2i_GENERAL_NAME(GENERAL_NAME **a, unsigned char **pp,
131 long length)
132{
133 unsigned char _tmp;
134 M_ASN1_D2I_vars(a,GENERAL_NAME *,GENERAL_NAME_new);
135 M_ASN1_D2I_Init();
136 c.slen = length;
137
138 _tmp = M_ASN1_next;
139 ret->type = _tmp & ~V_ASN1_CONSTRUCTED;
140
141 switch(ret->type) {
142 /* Just put these in a "blob" for now */
143 case GEN_X400:
144 case GEN_EDIPARTY:
145 M_ASN1_D2I_get_imp(ret->d.other, d2i_ASN1_TYPE,V_ASN1_SEQUENCE);
146 break;
147
148 case GEN_OTHERNAME:
149 M_ASN1_D2I_get_imp(ret->d.otherName, d2i_OTHERNAME,V_ASN1_SEQUENCE);
150 break;
151
152 case GEN_EMAIL:
153 case GEN_DNS:
154 case GEN_URI:
155 M_ASN1_D2I_get_imp(ret->d.ia5, d2i_ASN1_IA5STRING,
156 V_ASN1_IA5STRING);
157 break;
158
159 case GEN_DIRNAME:
160 M_ASN1_D2I_get_EXP_opt(ret->d.dirn, d2i_X509_NAME, 4);
161 break;
162
163 case GEN_IPADD:
164 M_ASN1_D2I_get_imp(ret->d.ip, d2i_ASN1_OCTET_STRING,
165 V_ASN1_OCTET_STRING);
166 break;
167
168 case GEN_RID:
169 M_ASN1_D2I_get_imp(ret->d.rid, d2i_ASN1_OBJECT,V_ASN1_OBJECT);
170 break;
171
172 default:
173 c.error = ASN1_R_BAD_TAG;
174 goto err;
175 }
176
177 c.slen = 0;
178 M_ASN1_D2I_Finish(a, GENERAL_NAME_free, ASN1_F_D2I_GENERAL_NAME);
179}
180
181void GENERAL_NAME_free(GENERAL_NAME *a)
182{
183 if (a == NULL) return;
184 switch(a->type) {
185 case GEN_X400:
186 case GEN_EDIPARTY:
187 ASN1_TYPE_free(a->d.other);
188 break;
189
190 case GEN_OTHERNAME:
191 OTHERNAME_free(a->d.otherName);
192 break;
193
194 case GEN_EMAIL:
195 case GEN_DNS:
196 case GEN_URI:
197
198 M_ASN1_IA5STRING_free(a->d.ia5);
199 break;
200
201 case GEN_DIRNAME:
202 X509_NAME_free(a->d.dirn);
203 break;
204
205 case GEN_IPADD:
206 M_ASN1_OCTET_STRING_free(a->d.ip);
207 break;
208
209 case GEN_RID:
210 ASN1_OBJECT_free(a->d.rid);
211 break;
212
213 }
214 OPENSSL_free (a);
215}
216
217/* Now the GeneralNames versions: a SEQUENCE OF GeneralName. These are needed as
218 * explicit functions.
219 */
220
221STACK_OF(GENERAL_NAME) *GENERAL_NAMES_new()
222{
223 return sk_GENERAL_NAME_new_null();
224}
225
226void GENERAL_NAMES_free(STACK_OF(GENERAL_NAME) *a)
227{
228 sk_GENERAL_NAME_pop_free(a, GENERAL_NAME_free);
229}
230
231STACK_OF(GENERAL_NAME) *d2i_GENERAL_NAMES(STACK_OF(GENERAL_NAME) **a,
232 unsigned char **pp, long length)
233{
234return d2i_ASN1_SET_OF_GENERAL_NAME(a, pp, length, d2i_GENERAL_NAME,
235 GENERAL_NAME_free, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL);
236}
237
238int i2d_GENERAL_NAMES(STACK_OF(GENERAL_NAME) *a, unsigned char **pp)
239{
240return i2d_ASN1_SET_OF_GENERAL_NAME(a, pp, i2d_GENERAL_NAME, V_ASN1_SEQUENCE,
241 V_ASN1_UNIVERSAL, IS_SEQUENCE);
242}
243
244IMPLEMENT_STACK_OF(GENERAL_NAME)
245IMPLEMENT_ASN1_SET_OF(GENERAL_NAME)
246
247int i2d_OTHERNAME(OTHERNAME *a, unsigned char **pp)
248{
249 int v = 0;
250 M_ASN1_I2D_vars(a);
251
252 M_ASN1_I2D_len(a->type_id, i2d_ASN1_OBJECT);
253 M_ASN1_I2D_len_EXP_opt(a->value, i2d_ASN1_TYPE, 0, v);
254
255 M_ASN1_I2D_seq_total();
256
257 M_ASN1_I2D_put(a->type_id, i2d_ASN1_OBJECT);
258 M_ASN1_I2D_put_EXP_opt(a->value, i2d_ASN1_TYPE, 0, v);
259
260 M_ASN1_I2D_finish();
261}
262
263OTHERNAME *OTHERNAME_new(void)
264{
265 OTHERNAME *ret=NULL;
266 ASN1_CTX c;
267 M_ASN1_New_Malloc(ret, OTHERNAME);
268 ret->type_id = OBJ_nid2obj(NID_undef);
269 M_ASN1_New(ret->value, ASN1_TYPE_new);
270 return (ret);
271 M_ASN1_New_Error(ASN1_F_OTHERNAME_NEW);
272}
273
274OTHERNAME *d2i_OTHERNAME(OTHERNAME **a, unsigned char **pp, long length)
275{
276 M_ASN1_D2I_vars(a,OTHERNAME *,OTHERNAME_new);
277 M_ASN1_D2I_Init();
278 M_ASN1_D2I_start_sequence();
279 M_ASN1_D2I_get(ret->type_id, d2i_ASN1_OBJECT);
280 M_ASN1_D2I_get_EXP_opt(ret->value, d2i_ASN1_TYPE, 0);
281 M_ASN1_D2I_Finish(a, OTHERNAME_free, ASN1_F_D2I_OTHERNAME);
282}
283
284void OTHERNAME_free(OTHERNAME *a)
285{
286 if (a == NULL) return;
287 ASN1_OBJECT_free(a->type_id);
288 ASN1_TYPE_free(a->value);
289 OPENSSL_free (a);
290}
291
diff --git a/src/lib/libcrypto/x509v3/v3_info.c b/src/lib/libcrypto/x509v3/v3_info.c
index a045a629ee..7f17f3231d 100644
--- a/src/lib/libcrypto/x509v3/v3_info.c
+++ b/src/lib/libcrypto/x509v3/v3_info.c
@@ -60,28 +60,48 @@
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/conf.h> 61#include <openssl/conf.h>
62#include <openssl/asn1.h> 62#include <openssl/asn1.h>
63#include <openssl/asn1_mac.h> 63#include <openssl/asn1t.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method, 66static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method,
67 STACK_OF(ACCESS_DESCRIPTION) *ainfo, 67 AUTHORITY_INFO_ACCESS *ainfo,
68 STACK_OF(CONF_VALUE) *ret); 68 STACK_OF(CONF_VALUE) *ret);
69static STACK_OF(ACCESS_DESCRIPTION) *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method, 69static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method,
70 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); 70 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
71 71
72X509V3_EXT_METHOD v3_info = 72X509V3_EXT_METHOD v3_info =
73{ NID_info_access, X509V3_EXT_MULTILINE, 73{ NID_info_access, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(AUTHORITY_INFO_ACCESS),
74(X509V3_EXT_NEW)AUTHORITY_INFO_ACCESS_new, 740,0,0,0,
75(X509V3_EXT_FREE)AUTHORITY_INFO_ACCESS_free, 750,0,
76(X509V3_EXT_D2I)d2i_AUTHORITY_INFO_ACCESS,
77(X509V3_EXT_I2D)i2d_AUTHORITY_INFO_ACCESS,
78NULL, NULL,
79(X509V3_EXT_I2V)i2v_AUTHORITY_INFO_ACCESS, 76(X509V3_EXT_I2V)i2v_AUTHORITY_INFO_ACCESS,
80(X509V3_EXT_V2I)v2i_AUTHORITY_INFO_ACCESS, 77(X509V3_EXT_V2I)v2i_AUTHORITY_INFO_ACCESS,
81NULL, NULL, NULL}; 780,0,
79NULL};
80
81X509V3_EXT_METHOD v3_sinfo =
82{ NID_sinfo_access, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(AUTHORITY_INFO_ACCESS),
830,0,0,0,
840,0,
85(X509V3_EXT_I2V)i2v_AUTHORITY_INFO_ACCESS,
86(X509V3_EXT_V2I)v2i_AUTHORITY_INFO_ACCESS,
870,0,
88NULL};
89
90ASN1_SEQUENCE(ACCESS_DESCRIPTION) = {
91 ASN1_SIMPLE(ACCESS_DESCRIPTION, method, ASN1_OBJECT),
92 ASN1_SIMPLE(ACCESS_DESCRIPTION, location, GENERAL_NAME)
93} ASN1_SEQUENCE_END(ACCESS_DESCRIPTION)
94
95IMPLEMENT_ASN1_FUNCTIONS(ACCESS_DESCRIPTION)
96
97ASN1_ITEM_TEMPLATE(AUTHORITY_INFO_ACCESS) =
98 ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, GeneralNames, ACCESS_DESCRIPTION)
99ASN1_ITEM_TEMPLATE_END(AUTHORITY_INFO_ACCESS)
100
101IMPLEMENT_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS)
82 102
83static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method, 103static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method,
84 STACK_OF(ACCESS_DESCRIPTION) *ainfo, 104 AUTHORITY_INFO_ACCESS *ainfo,
85 STACK_OF(CONF_VALUE) *ret) 105 STACK_OF(CONF_VALUE) *ret)
86{ 106{
87 ACCESS_DESCRIPTION *desc; 107 ACCESS_DESCRIPTION *desc;
@@ -111,10 +131,10 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method
111 return ret; 131 return ret;
112} 132}
113 133
114static STACK_OF(ACCESS_DESCRIPTION) *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method, 134static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method,
115 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval) 135 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
116{ 136{
117 STACK_OF(ACCESS_DESCRIPTION) *ainfo = NULL; 137 AUTHORITY_INFO_ACCESS *ainfo = NULL;
118 CONF_VALUE *cnf, ctmp; 138 CONF_VALUE *cnf, ctmp;
119 ACCESS_DESCRIPTION *acc; 139 ACCESS_DESCRIPTION *acc;
120 int i, objlen; 140 int i, objlen;
@@ -162,75 +182,11 @@ static STACK_OF(ACCESS_DESCRIPTION) *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
162 return NULL; 182 return NULL;
163} 183}
164 184
165int i2d_ACCESS_DESCRIPTION(ACCESS_DESCRIPTION *a, unsigned char **pp) 185int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION* a)
166{ 186 {
167 M_ASN1_I2D_vars(a); 187 i2a_ASN1_OBJECT(bp, a->method);
168 188#ifdef UNDEF
169 M_ASN1_I2D_len(a->method, i2d_ASN1_OBJECT); 189 i2a_GENERAL_NAME(bp, a->location);
170 M_ASN1_I2D_len(a->location, i2d_GENERAL_NAME); 190#endif
171 191 return 2;
172 M_ASN1_I2D_seq_total(); 192 }
173
174 M_ASN1_I2D_put(a->method, i2d_ASN1_OBJECT);
175 M_ASN1_I2D_put(a->location, i2d_GENERAL_NAME);
176
177 M_ASN1_I2D_finish();
178}
179
180ACCESS_DESCRIPTION *ACCESS_DESCRIPTION_new(void)
181{
182 ACCESS_DESCRIPTION *ret=NULL;
183 ASN1_CTX c;
184 M_ASN1_New_Malloc(ret, ACCESS_DESCRIPTION);
185 ret->method = OBJ_nid2obj(NID_undef);
186 ret->location = NULL;
187 return (ret);
188 M_ASN1_New_Error(ASN1_F_ACCESS_DESCRIPTION_NEW);
189}
190
191ACCESS_DESCRIPTION *d2i_ACCESS_DESCRIPTION(ACCESS_DESCRIPTION **a, unsigned char **pp,
192 long length)
193{
194 M_ASN1_D2I_vars(a,ACCESS_DESCRIPTION *,ACCESS_DESCRIPTION_new);
195 M_ASN1_D2I_Init();
196 M_ASN1_D2I_start_sequence();
197 M_ASN1_D2I_get(ret->method, d2i_ASN1_OBJECT);
198 M_ASN1_D2I_get(ret->location, d2i_GENERAL_NAME);
199 M_ASN1_D2I_Finish(a, ACCESS_DESCRIPTION_free, ASN1_F_D2I_ACCESS_DESCRIPTION);
200}
201
202void ACCESS_DESCRIPTION_free(ACCESS_DESCRIPTION *a)
203{
204 if (a == NULL) return;
205 ASN1_OBJECT_free(a->method);
206 GENERAL_NAME_free(a->location);
207 OPENSSL_free (a);
208}
209
210STACK_OF(ACCESS_DESCRIPTION) *AUTHORITY_INFO_ACCESS_new(void)
211{
212 return sk_ACCESS_DESCRIPTION_new_null();
213}
214
215void AUTHORITY_INFO_ACCESS_free(STACK_OF(ACCESS_DESCRIPTION) *a)
216{
217 sk_ACCESS_DESCRIPTION_pop_free(a, ACCESS_DESCRIPTION_free);
218}
219
220STACK_OF(ACCESS_DESCRIPTION) *d2i_AUTHORITY_INFO_ACCESS(STACK_OF(ACCESS_DESCRIPTION) **a,
221 unsigned char **pp, long length)
222{
223return d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(a, pp, length, d2i_ACCESS_DESCRIPTION,
224 ACCESS_DESCRIPTION_free, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL);
225}
226
227int i2d_AUTHORITY_INFO_ACCESS(STACK_OF(ACCESS_DESCRIPTION) *a, unsigned char **pp)
228{
229return i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(a, pp, i2d_ACCESS_DESCRIPTION, V_ASN1_SEQUENCE,
230 V_ASN1_UNIVERSAL, IS_SEQUENCE);
231}
232
233IMPLEMENT_STACK_OF(ACCESS_DESCRIPTION)
234IMPLEMENT_ASN1_SET_OF(ACCESS_DESCRIPTION)
235
236
diff --git a/src/lib/libcrypto/x509v3/v3_int.c b/src/lib/libcrypto/x509v3/v3_int.c
index 63c201e5f4..f34cbfb731 100644
--- a/src/lib/libcrypto/x509v3/v3_int.c
+++ b/src/lib/libcrypto/x509v3/v3_int.c
@@ -61,12 +61,9 @@
61#include <openssl/x509v3.h> 61#include <openssl/x509v3.h>
62 62
63X509V3_EXT_METHOD v3_crl_num = { 63X509V3_EXT_METHOD v3_crl_num = {
64NID_crl_number, 0, 64NID_crl_number, 0, ASN1_ITEM_ref(ASN1_INTEGER),
65(X509V3_EXT_NEW)ASN1_INTEGER_new, 650,0,0,0,
66(X509V3_EXT_FREE)ASN1_INTEGER_free,
67(X509V3_EXT_D2I)d2i_ASN1_INTEGER,
68(X509V3_EXT_I2D)i2d_ASN1_INTEGER,
69(X509V3_EXT_I2S)i2s_ASN1_INTEGER, 66(X509V3_EXT_I2S)i2s_ASN1_INTEGER,
70(X509V3_EXT_S2I)0, 670,
71NULL, NULL, NULL, NULL, NULL}; 680,0,0,0, NULL};
72 69
diff --git a/src/lib/libcrypto/x509v3/v3_lib.c b/src/lib/libcrypto/x509v3/v3_lib.c
index ea86b9ebb9..482ca8ccf5 100644
--- a/src/lib/libcrypto/x509v3/v3_lib.c
+++ b/src/lib/libcrypto/x509v3/v3_lib.c
@@ -163,8 +163,9 @@ void *X509V3_EXT_d2i(X509_EXTENSION *ext)
163{ 163{
164 X509V3_EXT_METHOD *method; 164 X509V3_EXT_METHOD *method;
165 unsigned char *p; 165 unsigned char *p;
166 if(!(method = X509V3_EXT_get(ext)) || !method->d2i) return NULL; 166 if(!(method = X509V3_EXT_get(ext))) return NULL;
167 p = ext->value->data; 167 p = ext->value->data;
168 if(method->it) return ASN1_item_d2i(NULL, &p, ext->value->length, ASN1_ITEM_ptr(method->it));
168 return method->d2i(NULL, &p, ext->value->length); 169 return method->d2i(NULL, &p, ext->value->length);
169} 170}
170 171
@@ -212,7 +213,7 @@ void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx)
212 } 213 }
213 if(found_ex) { 214 if(found_ex) {
214 /* Found it */ 215 /* Found it */
215 if(crit) *crit = found_ex->critical; 216 if(crit) *crit = X509_EXTENSION_get_critical(found_ex);
216 return X509V3_EXT_d2i(found_ex); 217 return X509V3_EXT_d2i(found_ex);
217 } 218 }
218 219
@@ -222,4 +223,79 @@ void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx)
222 return NULL; 223 return NULL;
223} 224}
224 225
226/* This function is a general extension append, replace and delete utility.
227 * The precise operation is governed by the 'flags' value. The 'crit' and
228 * 'value' arguments (if relevant) are the extensions internal structure.
229 */
230
231int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value,
232 int crit, unsigned long flags)
233{
234 int extidx = -1;
235 int errcode;
236 X509_EXTENSION *ext, *extmp;
237 unsigned long ext_op = flags & X509V3_ADD_OP_MASK;
238
239 /* If appending we don't care if it exists, otherwise
240 * look for existing extension.
241 */
242 if(ext_op != X509V3_ADD_APPEND)
243 extidx = X509v3_get_ext_by_NID(*x, nid, -1);
244
245 /* See if extension exists */
246 if(extidx >= 0) {
247 /* If keep existing, nothing to do */
248 if(ext_op == X509V3_ADD_KEEP_EXISTING)
249 return 1;
250 /* If default then its an error */
251 if(ext_op == X509V3_ADD_DEFAULT) {
252 errcode = X509V3_R_EXTENSION_EXISTS;
253 goto err;
254 }
255 /* If delete, just delete it */
256 if(ext_op == X509V3_ADD_DELETE) {
257 if(!sk_X509_EXTENSION_delete(*x, extidx)) return -1;
258 return 1;
259 }
260 } else {
261 /* If replace existing or delete, error since
262 * extension must exist
263 */
264 if((ext_op == X509V3_ADD_REPLACE_EXISTING) ||
265 (ext_op == X509V3_ADD_DELETE)) {
266 errcode = X509V3_R_EXTENSION_NOT_FOUND;
267 goto err;
268 }
269 }
270
271 /* If we get this far then we have to create an extension:
272 * could have some flags for alternative encoding schemes...
273 */
274
275 ext = X509V3_EXT_i2d(nid, crit, value);
276
277 if(!ext) {
278 X509V3err(X509V3_F_X509V3_ADD_I2D, X509V3_R_ERROR_CREATING_EXTENSION);
279 return 0;
280 }
281
282 /* If extension exists replace it.. */
283 if(extidx >= 0) {
284 extmp = sk_X509_EXTENSION_value(*x, extidx);
285 X509_EXTENSION_free(extmp);
286 if(!sk_X509_EXTENSION_set(*x, extidx, ext)) return -1;
287 return 1;
288 }
289
290 if(!*x && !(*x = sk_X509_EXTENSION_new_null())) return -1;
291 if(!sk_X509_EXTENSION_push(*x, ext)) return -1;
292
293 return 1;
294
295 err:
296 if(!(flags & X509V3_ADD_SILENT))
297 X509V3err(X509V3_F_X509V3_ADD_I2D, errcode);
298 return 0;
299}
300
225IMPLEMENT_STACK_OF(X509V3_EXT_METHOD) 301IMPLEMENT_STACK_OF(X509V3_EXT_METHOD)
diff --git a/src/lib/libcrypto/x509v3/v3_ocsp.c b/src/lib/libcrypto/x509v3/v3_ocsp.c
new file mode 100644
index 0000000000..083112314e
--- /dev/null
+++ b/src/lib/libcrypto/x509v3/v3_ocsp.c
@@ -0,0 +1,272 @@
1/* v3_ocsp.c */
2/* Written by Dr Stephen N Henson (shenson@bigfoot.com) 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#include <stdio.h>
60#include "cryptlib.h"
61#include <openssl/conf.h>
62#include <openssl/asn1.h>
63#include <openssl/ocsp.h>
64#include <openssl/x509v3.h>
65
66/* OCSP extensions and a couple of CRL entry extensions
67 */
68
69static int i2r_ocsp_crlid(X509V3_EXT_METHOD *method, void *nonce, BIO *out, int indent);
70static int i2r_ocsp_acutoff(X509V3_EXT_METHOD *method, void *nonce, BIO *out, int indent);
71static int i2r_object(X509V3_EXT_METHOD *method, void *obj, BIO *out, int indent);
72
73static void *ocsp_nonce_new(void);
74static int i2d_ocsp_nonce(void *a, unsigned char **pp);
75static void *d2i_ocsp_nonce(void *a, unsigned char **pp, long length);
76static void ocsp_nonce_free(void *a);
77static int i2r_ocsp_nonce(X509V3_EXT_METHOD *method, void *nonce, BIO *out, int indent);
78
79static int i2r_ocsp_nocheck(X509V3_EXT_METHOD *method, void *nocheck, BIO *out, int indent);
80static void *s2i_ocsp_nocheck(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
81static int i2r_ocsp_serviceloc(X509V3_EXT_METHOD *method, void *in, BIO *bp, int ind);
82
83X509V3_EXT_METHOD v3_ocsp_crlid = {
84 NID_id_pkix_OCSP_CrlID, 0, ASN1_ITEM_ref(OCSP_CRLID),
85 0,0,0,0,
86 0,0,
87 0,0,
88 i2r_ocsp_crlid,0,
89 NULL
90};
91
92X509V3_EXT_METHOD v3_ocsp_acutoff = {
93 NID_id_pkix_OCSP_archiveCutoff, 0, ASN1_ITEM_ref(ASN1_GENERALIZEDTIME),
94 0,0,0,0,
95 0,0,
96 0,0,
97 i2r_ocsp_acutoff,0,
98 NULL
99};
100
101X509V3_EXT_METHOD v3_crl_invdate = {
102 NID_invalidity_date, 0, ASN1_ITEM_ref(ASN1_GENERALIZEDTIME),
103 0,0,0,0,
104 0,0,
105 0,0,
106 i2r_ocsp_acutoff,0,
107 NULL
108};
109
110X509V3_EXT_METHOD v3_crl_hold = {
111 NID_hold_instruction_code, 0, ASN1_ITEM_ref(ASN1_OBJECT),
112 0,0,0,0,
113 0,0,
114 0,0,
115 i2r_object,0,
116 NULL
117};
118
119X509V3_EXT_METHOD v3_ocsp_nonce = {
120 NID_id_pkix_OCSP_Nonce, 0, NULL,
121 ocsp_nonce_new,
122 ocsp_nonce_free,
123 d2i_ocsp_nonce,
124 i2d_ocsp_nonce,
125 0,0,
126 0,0,
127 i2r_ocsp_nonce,0,
128 NULL
129};
130
131X509V3_EXT_METHOD v3_ocsp_nocheck = {
132 NID_id_pkix_OCSP_noCheck, 0, ASN1_ITEM_ref(ASN1_NULL),
133 0,0,0,0,
134 0,s2i_ocsp_nocheck,
135 0,0,
136 i2r_ocsp_nocheck,0,
137 NULL
138};
139
140X509V3_EXT_METHOD v3_ocsp_serviceloc = {
141 NID_id_pkix_OCSP_serviceLocator, 0, ASN1_ITEM_ref(OCSP_SERVICELOC),
142 0,0,0,0,
143 0,0,
144 0,0,
145 i2r_ocsp_serviceloc,0,
146 NULL
147};
148
149static int i2r_ocsp_crlid(X509V3_EXT_METHOD *method, void *in, BIO *bp, int ind)
150{
151 OCSP_CRLID *a = in;
152 if (a->crlUrl)
153 {
154 if (!BIO_printf(bp, "%*scrlUrl: ", ind, "")) goto err;
155 if (!ASN1_STRING_print(bp, (ASN1_STRING*)a->crlUrl)) goto err;
156 if (!BIO_write(bp, "\n", 1)) goto err;
157 }
158 if (a->crlNum)
159 {
160 if (!BIO_printf(bp, "%*scrlNum: ", ind, "")) goto err;
161 if (!i2a_ASN1_INTEGER(bp, a->crlNum)) goto err;
162 if (!BIO_write(bp, "\n", 1)) goto err;
163 }
164 if (a->crlTime)
165 {
166 if (!BIO_printf(bp, "%*scrlTime: ", ind, "")) goto err;
167 if (!ASN1_GENERALIZEDTIME_print(bp, a->crlTime)) goto err;
168 if (!BIO_write(bp, "\n", 1)) goto err;
169 }
170 return 1;
171 err:
172 return 0;
173}
174
175static int i2r_ocsp_acutoff(X509V3_EXT_METHOD *method, void *cutoff, BIO *bp, int ind)
176{
177 if (!BIO_printf(bp, "%*s", ind, "")) return 0;
178 if(!ASN1_GENERALIZEDTIME_print(bp, cutoff)) return 0;
179 return 1;
180}
181
182
183static int i2r_object(X509V3_EXT_METHOD *method, void *oid, BIO *bp, int ind)
184{
185 if (!BIO_printf(bp, "%*s", ind, "")) return 0;
186 if(!i2a_ASN1_OBJECT(bp, oid)) return 0;
187 return 1;
188}
189
190/* OCSP nonce. This is needs special treatment because it doesn't have
191 * an ASN1 encoding at all: it just contains arbitrary data.
192 */
193
194static void *ocsp_nonce_new(void)
195{
196 return ASN1_OCTET_STRING_new();
197}
198
199static int i2d_ocsp_nonce(void *a, unsigned char **pp)
200{
201 ASN1_OCTET_STRING *os = a;
202 if(pp) {
203 memcpy(*pp, os->data, os->length);
204 *pp += os->length;
205 }
206 return os->length;
207}
208
209static void *d2i_ocsp_nonce(void *a, unsigned char **pp, long length)
210{
211 ASN1_OCTET_STRING *os, **pos;
212 pos = a;
213 if(!pos || !*pos) os = ASN1_OCTET_STRING_new();
214 else os = *pos;
215 if(!ASN1_OCTET_STRING_set(os, *pp, length)) goto err;
216
217 *pp += length;
218
219 if(pos) *pos = os;
220 return os;
221
222 err:
223 if(os && (!pos || (*pos != os))) M_ASN1_OCTET_STRING_free(os);
224 OCSPerr(OCSP_F_D2I_OCSP_NONCE, ERR_R_MALLOC_FAILURE);
225 return NULL;
226}
227
228static void ocsp_nonce_free(void *a)
229{
230 M_ASN1_OCTET_STRING_free(a);
231}
232
233static int i2r_ocsp_nonce(X509V3_EXT_METHOD *method, void *nonce, BIO *out, int indent)
234{
235 if(BIO_printf(out, "%*s", indent, "") <= 0) return 0;
236 if(i2a_ASN1_STRING(out, nonce, V_ASN1_OCTET_STRING) <= 0) return 0;
237 return 1;
238}
239
240/* Nocheck is just a single NULL. Don't print anything and always set it */
241
242static int i2r_ocsp_nocheck(X509V3_EXT_METHOD *method, void *nocheck, BIO *out, int indent)
243{
244 return 1;
245}
246
247static void *s2i_ocsp_nocheck(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str)
248{
249 return ASN1_NULL_new();
250}
251
252static int i2r_ocsp_serviceloc(X509V3_EXT_METHOD *method, void *in, BIO *bp, int ind)
253 {
254 int i;
255 OCSP_SERVICELOC *a = in;
256 ACCESS_DESCRIPTION *ad;
257
258 if (BIO_printf(bp, "%*sIssuer: ", ind, "") <= 0) goto err;
259 if (X509_NAME_print_ex(bp, a->issuer, 0, XN_FLAG_ONELINE) <= 0) goto err;
260 for (i = 0; i < sk_ACCESS_DESCRIPTION_num(a->locator); i++)
261 {
262 ad = sk_ACCESS_DESCRIPTION_value(a->locator,i);
263 if (BIO_printf(bp, "\n%*s", (2*ind), "") <= 0)
264 goto err;
265 if(i2a_ASN1_OBJECT(bp, ad->method) <= 0) goto err;
266 if(BIO_puts(bp, " - ") <= 0) goto err;
267 if(GENERAL_NAME_print(bp, ad->location) <= 0) goto err;
268 }
269 return 1;
270err:
271 return 0;
272 }
diff --git a/src/lib/libcrypto/x509v3/v3_pku.c b/src/lib/libcrypto/x509v3/v3_pku.c
index 47f9e8f123..49a2e4697a 100644
--- a/src/lib/libcrypto/x509v3/v3_pku.c
+++ b/src/lib/libcrypto/x509v3/v3_pku.c
@@ -59,7 +59,7 @@
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/asn1.h> 61#include <openssl/asn1.h>
62#include <openssl/asn1_mac.h> 62#include <openssl/asn1t.h>
63#include <openssl/x509v3.h> 63#include <openssl/x509v3.h>
64 64
65static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, PKEY_USAGE_PERIOD *usage, BIO *out, int indent); 65static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, PKEY_USAGE_PERIOD *usage, BIO *out, int indent);
@@ -67,62 +67,19 @@ static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, PKEY_USAGE_PERIOD *u
67static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values); 67static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values);
68*/ 68*/
69X509V3_EXT_METHOD v3_pkey_usage_period = { 69X509V3_EXT_METHOD v3_pkey_usage_period = {
70NID_private_key_usage_period, 0, 70NID_private_key_usage_period, 0, ASN1_ITEM_ref(PKEY_USAGE_PERIOD),
71(X509V3_EXT_NEW)PKEY_USAGE_PERIOD_new, 710,0,0,0,
72(X509V3_EXT_FREE)PKEY_USAGE_PERIOD_free, 720,0,0,0,
73(X509V3_EXT_D2I)d2i_PKEY_USAGE_PERIOD,
74(X509V3_EXT_I2D)i2d_PKEY_USAGE_PERIOD,
75NULL, NULL, NULL, NULL,
76(X509V3_EXT_I2R)i2r_PKEY_USAGE_PERIOD, NULL, 73(X509V3_EXT_I2R)i2r_PKEY_USAGE_PERIOD, NULL,
77NULL 74NULL
78}; 75};
79 76
80int i2d_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD *a, unsigned char **pp) 77ASN1_SEQUENCE(PKEY_USAGE_PERIOD) = {
81{ 78 ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notBefore, ASN1_GENERALIZEDTIME, 0),
82 M_ASN1_I2D_vars(a); 79 ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notAfter, ASN1_GENERALIZEDTIME, 1)
83 80} ASN1_SEQUENCE_END(PKEY_USAGE_PERIOD)
84 M_ASN1_I2D_len_IMP_opt (a->notBefore, i2d_ASN1_GENERALIZEDTIME);
85 M_ASN1_I2D_len_IMP_opt (a->notAfter, i2d_ASN1_GENERALIZEDTIME);
86
87 M_ASN1_I2D_seq_total();
88
89 M_ASN1_I2D_put_IMP_opt (a->notBefore, i2d_ASN1_GENERALIZEDTIME, 0);
90 M_ASN1_I2D_put_IMP_opt (a->notAfter, i2d_ASN1_GENERALIZEDTIME, 1);
91
92 M_ASN1_I2D_finish();
93}
94
95PKEY_USAGE_PERIOD *PKEY_USAGE_PERIOD_new(void)
96{
97 PKEY_USAGE_PERIOD *ret=NULL;
98 ASN1_CTX c;
99 M_ASN1_New_Malloc(ret, PKEY_USAGE_PERIOD);
100 ret->notBefore = NULL;
101 ret->notAfter = NULL;
102 return (ret);
103 M_ASN1_New_Error(ASN1_F_PKEY_USAGE_PERIOD_NEW);
104}
105 81
106PKEY_USAGE_PERIOD *d2i_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD **a, 82IMPLEMENT_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD)
107 unsigned char **pp, long length)
108{
109 M_ASN1_D2I_vars(a,PKEY_USAGE_PERIOD *,PKEY_USAGE_PERIOD_new);
110 M_ASN1_D2I_Init();
111 M_ASN1_D2I_start_sequence();
112 M_ASN1_D2I_get_IMP_opt (ret->notBefore, d2i_ASN1_GENERALIZEDTIME, 0,
113 V_ASN1_GENERALIZEDTIME);
114 M_ASN1_D2I_get_IMP_opt (ret->notAfter, d2i_ASN1_GENERALIZEDTIME, 1,
115 V_ASN1_GENERALIZEDTIME);
116 M_ASN1_D2I_Finish(a, PKEY_USAGE_PERIOD_free, ASN1_F_D2I_PKEY_USAGE_PERIOD);
117}
118
119void PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *a)
120{
121 if (a == NULL) return;
122 M_ASN1_GENERALIZEDTIME_free(a->notBefore);
123 M_ASN1_GENERALIZEDTIME_free(a->notAfter);
124 OPENSSL_free (a);
125}
126 83
127static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, 84static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method,
128 PKEY_USAGE_PERIOD *usage, BIO *out, int indent) 85 PKEY_USAGE_PERIOD *usage, BIO *out, int indent)
diff --git a/src/lib/libcrypto/x509v3/v3_prn.c b/src/lib/libcrypto/x509v3/v3_prn.c
index 14b804c4ad..aeaf6170fe 100644
--- a/src/lib/libcrypto/x509v3/v3_prn.c
+++ b/src/lib/libcrypto/x509v3/v3_prn.c
@@ -64,6 +64,8 @@
64 64
65/* Extension printing routines */ 65/* Extension printing routines */
66 66
67static int unknown_ext_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent, int supported);
68
67/* Print out a name+value stack */ 69/* Print out a name+value stack */
68 70
69void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, int ml) 71void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, int ml)
@@ -103,16 +105,22 @@ void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, int ml)
103 105
104/* Main routine: print out a general extension */ 106/* Main routine: print out a general extension */
105 107
106int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, int flag, int indent) 108int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent)
107{ 109{
108 char *ext_str = NULL, *value = NULL; 110 void *ext_str = NULL;
111 char *value = NULL;
109 unsigned char *p; 112 unsigned char *p;
110 X509V3_EXT_METHOD *method; 113 X509V3_EXT_METHOD *method;
111 STACK_OF(CONF_VALUE) *nval = NULL; 114 STACK_OF(CONF_VALUE) *nval = NULL;
112 int ok = 1; 115 int ok = 1;
113 if(!(method = X509V3_EXT_get(ext))) return 0; 116 if(!(method = X509V3_EXT_get(ext)))
117 return unknown_ext_print(out, ext, flag, indent, 0);
114 p = ext->value->data; 118 p = ext->value->data;
115 if(!(ext_str = method->d2i(NULL, &p, ext->value->length))) return 0; 119 if(method->it) ext_str = ASN1_item_d2i(NULL, &p, ext->value->length, ASN1_ITEM_ptr(method->it));
120 else ext_str = method->d2i(NULL, &p, ext->value->length);
121
122 if(!ext_str) return unknown_ext_print(out, ext, flag, indent, 1);
123
116 if(method->i2s) { 124 if(method->i2s) {
117 if(!(value = method->i2s(method, ext_str))) { 125 if(!(value = method->i2s(method, ext_str))) {
118 ok = 0; 126 ok = 0;
@@ -148,11 +156,71 @@ int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, int flag, int indent)
148 err: 156 err:
149 sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); 157 sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
150 if(value) OPENSSL_free(value); 158 if(value) OPENSSL_free(value);
151 method->ext_free(ext_str); 159 if(method->it) ASN1_item_free(ext_str, ASN1_ITEM_ptr(method->it));
160 else method->ext_free(ext_str);
152 return ok; 161 return ok;
153} 162}
154 163
155#ifndef NO_FP_API 164int X509V3_extensions_print(BIO *bp, char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent)
165{
166 int i, j;
167
168 if(sk_X509_EXTENSION_num(exts) <= 0) return 1;
169
170 if(title)
171 {
172 BIO_printf(bp,"%*s%s:\n",indent, "", title);
173 indent += 4;
174 }
175
176 for (i=0; i<sk_X509_EXTENSION_num(exts); i++)
177 {
178 ASN1_OBJECT *obj;
179 X509_EXTENSION *ex;
180 ex=sk_X509_EXTENSION_value(exts, i);
181 if (BIO_printf(bp,"%*s",indent, "") <= 0) return 0;
182 obj=X509_EXTENSION_get_object(ex);
183 i2a_ASN1_OBJECT(bp,obj);
184 j=X509_EXTENSION_get_critical(ex);
185 if (BIO_printf(bp,": %s\n",j?"critical":"","") <= 0)
186 return 0;
187 if(!X509V3_EXT_print(bp, ex, flag, 12))
188 {
189 BIO_printf(bp, "%*s", indent + 4, "");
190 M_ASN1_OCTET_STRING_print(bp,ex->value);
191 }
192 if (BIO_write(bp,"\n",1) <= 0) return 0;
193 }
194 return 1;
195}
196
197static int unknown_ext_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent, int supported)
198{
199 switch(flag & X509V3_EXT_UNKNOWN_MASK) {
200
201 case X509V3_EXT_DEFAULT:
202 return 0;
203
204 case X509V3_EXT_ERROR_UNKNOWN:
205 if(supported)
206 BIO_printf(out, "%*s<Parse Error>", indent, "");
207 else
208 BIO_printf(out, "%*s<Not Supported>", indent, "");
209 return 1;
210
211 case X509V3_EXT_PARSE_UNKNOWN:
212 return ASN1_parse_dump(out,
213 ext->value->data, ext->value->length, indent, -1);
214 case X509V3_EXT_DUMP_UNKNOWN:
215 return BIO_dump_indent(out, (char *)ext->value->data, ext->value->length, indent);
216
217 default:
218 return 1;
219 }
220}
221
222
223#ifndef OPENSSL_NO_FP_API
156int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent) 224int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent)
157{ 225{
158 BIO *bio_tmp; 226 BIO *bio_tmp;
diff --git a/src/lib/libcrypto/x509v3/v3_purp.c b/src/lib/libcrypto/x509v3/v3_purp.c
index 8aecd00e63..b739e4fd83 100644
--- a/src/lib/libcrypto/x509v3/v3_purp.c
+++ b/src/lib/libcrypto/x509v3/v3_purp.c
@@ -1,9 +1,9 @@
1/* v3_purp.c */ 1/* v3_purp.c */
2/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL 2/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
3 * project 1999. 3 * project 2001.
4 */ 4 */
5/* ==================================================================== 5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 6 * Copyright (c) 1999-2001 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
@@ -61,7 +61,6 @@
61#include <openssl/x509v3.h> 61#include <openssl/x509v3.h>
62#include <openssl/x509_vfy.h> 62#include <openssl/x509_vfy.h>
63 63
64
65static void x509v3_cache_extensions(X509 *x); 64static void x509v3_cache_extensions(X509 *x);
66 65
67static int ca_check(const X509 *x); 66static int ca_check(const X509 *x);
@@ -74,6 +73,7 @@ static int check_purpose_smime_sign(const X509_PURPOSE *xp, const X509 *x, int c
74static int check_purpose_smime_encrypt(const X509_PURPOSE *xp, const X509 *x, int ca); 73static int check_purpose_smime_encrypt(const X509_PURPOSE *xp, const X509 *x, int ca);
75static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, int ca); 74static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, int ca);
76static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca); 75static 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);
77 77
78static int xp_cmp(const X509_PURPOSE * const *a, 78static int xp_cmp(const X509_PURPOSE * const *a,
79 const X509_PURPOSE * const *b); 79 const X509_PURPOSE * const *b);
@@ -87,6 +87,7 @@ static X509_PURPOSE xstandard[] = {
87 {X509_PURPOSE_SMIME_ENCRYPT, X509_TRUST_EMAIL, 0, check_purpose_smime_encrypt, "S/MIME encryption", "smimeencrypt", NULL}, 87 {X509_PURPOSE_SMIME_ENCRYPT, X509_TRUST_EMAIL, 0, check_purpose_smime_encrypt, "S/MIME encryption", "smimeencrypt", NULL},
88 {X509_PURPOSE_CRL_SIGN, X509_TRUST_COMPAT, 0, check_purpose_crl_sign, "CRL signing", "crlsign", NULL}, 88 {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}, 89 {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},
90}; 91};
91 92
92#define X509_PURPOSE_COUNT (sizeof(xstandard)/sizeof(X509_PURPOSE)) 93#define X509_PURPOSE_COUNT (sizeof(xstandard)/sizeof(X509_PURPOSE))
@@ -120,6 +121,16 @@ int X509_check_purpose(X509 *x, int id, int ca)
120 return pt->check_purpose(pt, x, ca); 121 return pt->check_purpose(pt, x, ca);
121} 122}
122 123
124int X509_PURPOSE_set(int *p, int purpose)
125{
126 if(X509_PURPOSE_get_by_id(purpose) == -1) {
127 X509V3err(X509V3_F_X509_PURPOSE_SET, X509V3_R_INVALID_PURPOSE);
128 return 0;
129 }
130 *p = purpose;
131 return 1;
132}
133
123int X509_PURPOSE_get_count(void) 134int X509_PURPOSE_get_count(void)
124{ 135{
125 if(!xptable) return X509_PURPOSE_COUNT; 136 if(!xptable) return X509_PURPOSE_COUNT;
@@ -144,7 +155,6 @@ int X509_PURPOSE_get_by_sname(char *sname)
144 return -1; 155 return -1;
145} 156}
146 157
147
148int X509_PURPOSE_get_by_id(int purpose) 158int X509_PURPOSE_get_by_id(int purpose)
149{ 159{
150 X509_PURPOSE tmp; 160 X509_PURPOSE tmp;
@@ -256,16 +266,55 @@ int X509_PURPOSE_get_trust(X509_PURPOSE *xp)
256 return xp->trust; 266 return xp->trust;
257} 267}
258 268
269static int nid_cmp(int *a, int *b)
270 {
271 return *a - *b;
272 }
273
274int X509_supported_extension(X509_EXTENSION *ex)
275 {
276 /* This table is a list of the NIDs of supported extensions:
277 * that is those which are used by the verify process. If
278 * an extension is critical and doesn't appear in this list
279 * then the verify process will normally reject the certificate.
280 * The list must be kept in numerical order because it will be
281 * searched using bsearch.
282 */
283
284 static int supported_nids[] = {
285 NID_netscape_cert_type, /* 71 */
286 NID_key_usage, /* 83 */
287 NID_subject_alt_name, /* 85 */
288 NID_basic_constraints, /* 87 */
289 NID_ext_key_usage /* 126 */
290 };
291
292 int ex_nid;
293
294 ex_nid = OBJ_obj2nid(X509_EXTENSION_get_object(ex));
295
296 if (ex_nid == NID_undef)
297 return 0;
298
299 if (OBJ_bsearch((char *)&ex_nid, (char *)supported_nids,
300 sizeof(supported_nids)/sizeof(int), sizeof(int),
301 (int (*)(const void *, const void *))nid_cmp))
302 return 1;
303 return 0;
304 }
305
306
259static void x509v3_cache_extensions(X509 *x) 307static void x509v3_cache_extensions(X509 *x)
260{ 308{
261 BASIC_CONSTRAINTS *bs; 309 BASIC_CONSTRAINTS *bs;
262 ASN1_BIT_STRING *usage; 310 ASN1_BIT_STRING *usage;
263 ASN1_BIT_STRING *ns; 311 ASN1_BIT_STRING *ns;
264 STACK_OF(ASN1_OBJECT) *extusage; 312 EXTENDED_KEY_USAGE *extusage;
313 X509_EXTENSION *ex;
265 314
266 int i; 315 int i;
267 if(x->ex_flags & EXFLAG_SET) return; 316 if(x->ex_flags & EXFLAG_SET) return;
268#ifndef NO_SHA 317#ifndef OPENSSL_NO_SHA
269 X509_digest(x, EVP_sha1(), x->sha1_hash, NULL); 318 X509_digest(x, EVP_sha1(), x->sha1_hash, NULL);
270#endif 319#endif
271 /* Does subject name match issuer ? */ 320 /* Does subject name match issuer ? */
@@ -320,6 +369,15 @@ static void x509v3_cache_extensions(X509 *x)
320 case NID_ms_sgc: 369 case NID_ms_sgc:
321 case NID_ns_sgc: 370 case NID_ns_sgc:
322 x->ex_xkusage |= XKU_SGC; 371 x->ex_xkusage |= XKU_SGC;
372 break;
373
374 case NID_OCSP_sign:
375 x->ex_xkusage |= XKU_OCSP_SIGN;
376 break;
377
378 case NID_time_stamp:
379 x->ex_xkusage |= XKU_TIMESTAMP;
380 break;
323 } 381 }
324 } 382 }
325 sk_ASN1_OBJECT_pop_free(extusage, ASN1_OBJECT_free); 383 sk_ASN1_OBJECT_pop_free(extusage, ASN1_OBJECT_free);
@@ -333,6 +391,17 @@ static void x509v3_cache_extensions(X509 *x)
333 } 391 }
334 x->skid =X509_get_ext_d2i(x, NID_subject_key_identifier, NULL, NULL); 392 x->skid =X509_get_ext_d2i(x, NID_subject_key_identifier, NULL, NULL);
335 x->akid =X509_get_ext_d2i(x, NID_authority_key_identifier, NULL, NULL); 393 x->akid =X509_get_ext_d2i(x, NID_authority_key_identifier, NULL, NULL);
394 for (i = 0; i < X509_get_ext_count(x); i++)
395 {
396 ex = X509_get_ext(x, i);
397 if (!X509_EXTENSION_get_critical(ex))
398 continue;
399 if (!X509_supported_extension(ex))
400 {
401 x->ex_flags |= EXFLAG_CRITICAL;
402 break;
403 }
404 }
336 x->ex_flags |= EXFLAG_SET; 405 x->ex_flags |= EXFLAG_SET;
337} 406}
338 407
@@ -472,6 +541,27 @@ static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, int ca)
472 return 1; 541 return 1;
473} 542}
474 543
544/* OCSP helper: this is *not* a full OCSP check. It just checks that
545 * each CA is valid. Additional checks must be made on the chain.
546 */
547
548static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca)
549{
550 /* Must be a valid CA */
551 if(ca) {
552 int ca_ret;
553 ca_ret = ca_check(x);
554 if(ca_ret != 2) return ca_ret;
555 if(x->ex_flags & EXFLAG_NSCERT) {
556 if(x->ex_nscert & NS_ANY_CA) return ca_ret;
557 return 0;
558 }
559 return 0;
560 }
561 /* leaf certificate is checked in OCSP_verify() */
562 return 1;
563}
564
475static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca) 565static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca)
476{ 566{
477 return 1; 567 return 1;
@@ -513,7 +603,7 @@ int X509_check_issued(X509 *issuer, X509 *subject)
513 * There may be more than one but we only take any 603 * There may be more than one but we only take any
514 * notice of the first. 604 * notice of the first.
515 */ 605 */
516 STACK_OF(GENERAL_NAME) *gens; 606 GENERAL_NAMES *gens;
517 GENERAL_NAME *gen; 607 GENERAL_NAME *gen;
518 X509_NAME *nm = NULL; 608 X509_NAME *nm = NULL;
519 int i; 609 int i;
diff --git a/src/lib/libcrypto/x509v3/v3_skey.c b/src/lib/libcrypto/x509v3/v3_skey.c
index 939845fa8f..c0f044ac1b 100644
--- a/src/lib/libcrypto/x509v3/v3_skey.c
+++ b/src/lib/libcrypto/x509v3/v3_skey.c
@@ -63,14 +63,12 @@
63 63
64static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); 64static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
65X509V3_EXT_METHOD v3_skey_id = { 65X509V3_EXT_METHOD v3_skey_id = {
66NID_subject_key_identifier, 0, 66NID_subject_key_identifier, 0, ASN1_ITEM_ref(ASN1_OCTET_STRING),
67(X509V3_EXT_NEW)ASN1_OCTET_STRING_new, 670,0,0,0,
68(X509V3_EXT_FREE)ASN1_OCTET_STRING_free,
69(X509V3_EXT_D2I)d2i_ASN1_OCTET_STRING,
70(X509V3_EXT_I2D)i2d_ASN1_OCTET_STRING,
71(X509V3_EXT_I2S)i2s_ASN1_OCTET_STRING, 68(X509V3_EXT_I2S)i2s_ASN1_OCTET_STRING,
72(X509V3_EXT_S2I)s2i_skey_id, 69(X509V3_EXT_S2I)s2i_skey_id,
73NULL, NULL, NULL, NULL, NULL}; 700,0,0,0,
71NULL};
74 72
75char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, 73char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
76 ASN1_OCTET_STRING *oct) 74 ASN1_OCTET_STRING *oct)
@@ -106,7 +104,6 @@ static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method,
106 ASN1_OCTET_STRING *oct; 104 ASN1_OCTET_STRING *oct;
107 ASN1_BIT_STRING *pk; 105 ASN1_BIT_STRING *pk;
108 unsigned char pkey_dig[EVP_MAX_MD_SIZE]; 106 unsigned char pkey_dig[EVP_MAX_MD_SIZE];
109 EVP_MD_CTX md;
110 unsigned int diglen; 107 unsigned int diglen;
111 108
112 if(strcmp(str, "hash")) return s2i_ASN1_OCTET_STRING(method, ctx, str); 109 if(strcmp(str, "hash")) return s2i_ASN1_OCTET_STRING(method, ctx, str);
@@ -132,9 +129,7 @@ static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method,
132 goto err; 129 goto err;
133 } 130 }
134 131
135 EVP_DigestInit(&md, EVP_sha1()); 132 EVP_Digest(pk->data, pk->length, pkey_dig, &diglen, EVP_sha1(), NULL);
136 EVP_DigestUpdate(&md, pk->data, pk->length);
137 EVP_DigestFinal(&md, pkey_dig, &diglen);
138 133
139 if(!M_ASN1_OCTET_STRING_set(oct, pkey_dig, diglen)) { 134 if(!M_ASN1_OCTET_STRING_set(oct, pkey_dig, diglen)) {
140 X509V3err(X509V3_F_S2I_S2I_SKEY_ID,ERR_R_MALLOC_FAILURE); 135 X509V3err(X509V3_F_S2I_S2I_SKEY_ID,ERR_R_MALLOC_FAILURE);
diff --git a/src/lib/libcrypto/x509v3/v3_sxnet.c b/src/lib/libcrypto/x509v3/v3_sxnet.c
index bfecacd336..d3f4ba3a72 100644
--- a/src/lib/libcrypto/x509v3/v3_sxnet.c
+++ b/src/lib/libcrypto/x509v3/v3_sxnet.c
@@ -60,7 +60,7 @@
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/conf.h> 61#include <openssl/conf.h>
62#include <openssl/asn1.h> 62#include <openssl/asn1.h>
63#include <openssl/asn1_mac.h> 63#include <openssl/asn1t.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66/* Support for Thawte strong extranet extension */ 66/* Support for Thawte strong extranet extension */
@@ -73,111 +73,33 @@ static SXNET * sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
73 STACK_OF(CONF_VALUE) *nval); 73 STACK_OF(CONF_VALUE) *nval);
74#endif 74#endif
75X509V3_EXT_METHOD v3_sxnet = { 75X509V3_EXT_METHOD v3_sxnet = {
76NID_sxnet, X509V3_EXT_MULTILINE, 76NID_sxnet, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(SXNET),
77(X509V3_EXT_NEW)SXNET_new, 770,0,0,0,
78(X509V3_EXT_FREE)SXNET_free, 780,0,
79(X509V3_EXT_D2I)d2i_SXNET, 790,
80(X509V3_EXT_I2D)i2d_SXNET,
81NULL, NULL,
82NULL,
83#ifdef SXNET_TEST 80#ifdef SXNET_TEST
84(X509V3_EXT_V2I)sxnet_v2i, 81(X509V3_EXT_V2I)sxnet_v2i,
85#else 82#else
86NULL, 830,
87#endif 84#endif
88(X509V3_EXT_I2R)sxnet_i2r, 85(X509V3_EXT_I2R)sxnet_i2r,
89NULL, 860,
90NULL 87NULL
91}; 88};
92 89
90ASN1_SEQUENCE(SXNETID) = {
91 ASN1_SIMPLE(SXNETID, zone, ASN1_INTEGER),
92 ASN1_SIMPLE(SXNETID, user, ASN1_OCTET_STRING)
93} ASN1_SEQUENCE_END(SXNETID)
93 94
94int i2d_SXNET(SXNET *a, unsigned char **pp) 95IMPLEMENT_ASN1_FUNCTIONS(SXNETID)
95{
96 M_ASN1_I2D_vars(a);
97
98 M_ASN1_I2D_len (a->version, i2d_ASN1_INTEGER);
99 M_ASN1_I2D_len_SEQUENCE_type (SXNETID, a->ids, i2d_SXNETID);
100
101 M_ASN1_I2D_seq_total();
102
103 M_ASN1_I2D_put (a->version, i2d_ASN1_INTEGER);
104 M_ASN1_I2D_put_SEQUENCE_type (SXNETID, a->ids, i2d_SXNETID);
105 96
106 M_ASN1_I2D_finish(); 97ASN1_SEQUENCE(SXNET) = {
107} 98 ASN1_SIMPLE(SXNET, version, ASN1_INTEGER),
108 99 ASN1_SEQUENCE_OF(SXNET, ids, SXNETID)
109SXNET *SXNET_new(void) 100} ASN1_SEQUENCE_END(SXNET)
110{
111 SXNET *ret=NULL;
112 ASN1_CTX c;
113 M_ASN1_New_Malloc(ret, SXNET);
114 M_ASN1_New(ret->version,M_ASN1_INTEGER_new);
115 M_ASN1_New(ret->ids,sk_SXNETID_new_null);
116 return (ret);
117 M_ASN1_New_Error(ASN1_F_SXNET_NEW);
118}
119 101
120SXNET *d2i_SXNET(SXNET **a, unsigned char **pp, long length) 102IMPLEMENT_ASN1_FUNCTIONS(SXNET)
121{
122 M_ASN1_D2I_vars(a,SXNET *,SXNET_new);
123 M_ASN1_D2I_Init();
124 M_ASN1_D2I_start_sequence();
125 M_ASN1_D2I_get (ret->version, d2i_ASN1_INTEGER);
126 M_ASN1_D2I_get_seq_type (SXNETID, ret->ids, d2i_SXNETID, SXNETID_free);
127 M_ASN1_D2I_Finish(a, SXNET_free, ASN1_F_D2I_SXNET);
128}
129
130void SXNET_free(SXNET *a)
131{
132 if (a == NULL) return;
133 M_ASN1_INTEGER_free(a->version);
134 sk_SXNETID_pop_free(a->ids, SXNETID_free);
135 OPENSSL_free (a);
136}
137
138int i2d_SXNETID(SXNETID *a, unsigned char **pp)
139{
140 M_ASN1_I2D_vars(a);
141
142 M_ASN1_I2D_len (a->zone, i2d_ASN1_INTEGER);
143 M_ASN1_I2D_len (a->user, i2d_ASN1_OCTET_STRING);
144
145 M_ASN1_I2D_seq_total();
146
147 M_ASN1_I2D_put (a->zone, i2d_ASN1_INTEGER);
148 M_ASN1_I2D_put (a->user, i2d_ASN1_OCTET_STRING);
149
150 M_ASN1_I2D_finish();
151}
152
153SXNETID *SXNETID_new(void)
154{
155 SXNETID *ret=NULL;
156 ASN1_CTX c;
157 M_ASN1_New_Malloc(ret, SXNETID);
158 ret->zone = NULL;
159 M_ASN1_New(ret->user,M_ASN1_OCTET_STRING_new);
160 return (ret);
161 M_ASN1_New_Error(ASN1_F_SXNETID_NEW);
162}
163
164SXNETID *d2i_SXNETID(SXNETID **a, unsigned char **pp, long length)
165{
166 M_ASN1_D2I_vars(a,SXNETID *,SXNETID_new);
167 M_ASN1_D2I_Init();
168 M_ASN1_D2I_start_sequence();
169 M_ASN1_D2I_get(ret->zone, d2i_ASN1_INTEGER);
170 M_ASN1_D2I_get(ret->user, d2i_ASN1_OCTET_STRING);
171 M_ASN1_D2I_Finish(a, SXNETID_free, ASN1_F_D2I_SXNETID);
172}
173
174void SXNETID_free(SXNETID *a)
175{
176 if (a == NULL) return;
177 M_ASN1_INTEGER_free(a->zone);
178 M_ASN1_OCTET_STRING_free(a->user);
179 OPENSSL_free (a);
180}
181 103
182static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, 104static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out,
183 int indent) 105 int indent)
diff --git a/src/lib/libcrypto/x509v3/v3_utl.c b/src/lib/libcrypto/x509v3/v3_utl.c
index 619f161b58..283e943e46 100644
--- a/src/lib/libcrypto/x509v3/v3_utl.c
+++ b/src/lib/libcrypto/x509v3/v3_utl.c
@@ -66,7 +66,7 @@
66 66
67static char *strip_spaces(char *name); 67static char *strip_spaces(char *name);
68static int sk_strcmp(const char * const *a, const char * const *b); 68static int sk_strcmp(const char * const *a, const char * const *b);
69static STACK *get_email(X509_NAME *name, STACK_OF(GENERAL_NAME) *gens); 69static STACK *get_email(X509_NAME *name, GENERAL_NAMES *gens);
70static void str_free(void *str); 70static void str_free(void *str);
71static int append_ia5(STACK **sk, ASN1_IA5STRING *email); 71static int append_ia5(STACK **sk, ASN1_IA5STRING *email);
72 72
@@ -154,21 +154,40 @@ ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value)
154{ 154{
155 BIGNUM *bn = NULL; 155 BIGNUM *bn = NULL;
156 ASN1_INTEGER *aint; 156 ASN1_INTEGER *aint;
157 int isneg, ishex;
158 int ret;
157 bn = BN_new(); 159 bn = BN_new();
158 if(!value) { 160 if (!value) {
159 X509V3err(X509V3_F_S2I_ASN1_INTEGER,X509V3_R_INVALID_NULL_VALUE); 161 X509V3err(X509V3_F_S2I_ASN1_INTEGER,X509V3_R_INVALID_NULL_VALUE);
160 return 0; 162 return 0;
161 } 163 }
162 if(!BN_dec2bn(&bn, value)) { 164 if (value[0] == '-') {
165 value++;
166 isneg = 1;
167 } else isneg = 0;
168
169 if (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X'))) {
170 value += 2;
171 ishex = 1;
172 } else ishex = 0;
173
174 if (ishex) ret = BN_hex2bn(&bn, value);
175 else ret = BN_dec2bn(&bn, value);
176
177 if (!ret) {
163 X509V3err(X509V3_F_S2I_ASN1_INTEGER,X509V3_R_BN_DEC2BN_ERROR); 178 X509V3err(X509V3_F_S2I_ASN1_INTEGER,X509V3_R_BN_DEC2BN_ERROR);
164 return 0; 179 return 0;
165 } 180 }
166 181
167 if(!(aint = BN_to_ASN1_INTEGER(bn, NULL))) { 182 if (isneg && BN_is_zero(bn)) isneg = 0;
183
184 aint = BN_to_ASN1_INTEGER(bn, NULL);
185 BN_free(bn);
186 if (!aint) {
168 X509V3err(X509V3_F_S2I_ASN1_INTEGER,X509V3_R_BN_TO_ASN1_INTEGER_ERROR); 187 X509V3err(X509V3_F_S2I_ASN1_INTEGER,X509V3_R_BN_TO_ASN1_INTEGER_ERROR);
169 return 0; 188 return 0;
170 } 189 }
171 BN_free(bn); 190 if (isneg) aint->type |= V_ASN1_NEG;
172 return aint; 191 return aint;
173} 192}
174 193
@@ -221,7 +240,7 @@ int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint)
221 240
222/*#define DEBUG*/ 241/*#define DEBUG*/
223 242
224STACK_OF(CONF_VALUE) *X509V3_parse_list(char *line) 243STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line)
225{ 244{
226 char *p, *q, c; 245 char *p, *q, c;
227 char *ntmp, *vtmp; 246 char *ntmp, *vtmp;
@@ -250,7 +269,7 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(char *line)
250 *p = 0; 269 *p = 0;
251 ntmp = strip_spaces(q); 270 ntmp = strip_spaces(q);
252 q = p + 1; 271 q = p + 1;
253#ifdef DEBUG 272#if 0
254 printf("%s\n", ntmp); 273 printf("%s\n", ntmp);
255#endif 274#endif
256 if(!ntmp) { 275 if(!ntmp) {
@@ -266,7 +285,7 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(char *line)
266 state = HDR_NAME; 285 state = HDR_NAME;
267 *p = 0; 286 *p = 0;
268 vtmp = strip_spaces(q); 287 vtmp = strip_spaces(q);
269#ifdef DEBUG 288#if 0
270 printf("%s\n", ntmp); 289 printf("%s\n", ntmp);
271#endif 290#endif
272 if(!vtmp) { 291 if(!vtmp) {
@@ -283,7 +302,7 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(char *line)
283 302
284 if(state == HDR_VALUE) { 303 if(state == HDR_VALUE) {
285 vtmp = strip_spaces(q); 304 vtmp = strip_spaces(q);
286#ifdef DEBUG 305#if 0
287 printf("%s=%s\n", ntmp, vtmp); 306 printf("%s=%s\n", ntmp, vtmp);
288#endif 307#endif
289 if(!vtmp) { 308 if(!vtmp) {
@@ -293,7 +312,7 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(char *line)
293 X509V3_add_value(ntmp, vtmp, &values); 312 X509V3_add_value(ntmp, vtmp, &values);
294 } else { 313 } else {
295 ntmp = strip_spaces(q); 314 ntmp = strip_spaces(q);
296#ifdef DEBUG 315#if 0
297 printf("%s\n", ntmp); 316 printf("%s\n", ntmp);
298#endif 317#endif
299 if(!ntmp) { 318 if(!ntmp) {
@@ -439,7 +458,7 @@ static int sk_strcmp(const char * const *a, const char * const *b)
439 458
440STACK *X509_get1_email(X509 *x) 459STACK *X509_get1_email(X509 *x)
441{ 460{
442 STACK_OF(GENERAL_NAME) *gens; 461 GENERAL_NAMES *gens;
443 STACK *ret; 462 STACK *ret;
444 gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); 463 gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL);
445 ret = get_email(X509_get_subject_name(x), gens); 464 ret = get_email(X509_get_subject_name(x), gens);
@@ -449,7 +468,7 @@ STACK *X509_get1_email(X509 *x)
449 468
450STACK *X509_REQ_get1_email(X509_REQ *x) 469STACK *X509_REQ_get1_email(X509_REQ *x)
451{ 470{
452 STACK_OF(GENERAL_NAME) *gens; 471 GENERAL_NAMES *gens;
453 STACK_OF(X509_EXTENSION) *exts; 472 STACK_OF(X509_EXTENSION) *exts;
454 STACK *ret; 473 STACK *ret;
455 exts = X509_REQ_get_extensions(x); 474 exts = X509_REQ_get_extensions(x);
@@ -461,7 +480,7 @@ STACK *X509_REQ_get1_email(X509_REQ *x)
461} 480}
462 481
463 482
464static STACK *get_email(X509_NAME *name, STACK_OF(GENERAL_NAME) *gens) 483static STACK *get_email(X509_NAME *name, GENERAL_NAMES *gens)
465{ 484{
466 STACK *ret = NULL; 485 STACK *ret = NULL;
467 X509_NAME_ENTRY *ne; 486 X509_NAME_ENTRY *ne;
diff --git a/src/lib/libcrypto/x509v3/v3conf.c b/src/lib/libcrypto/x509v3/v3conf.c
index 21cf746f45..67ee14f334 100644
--- a/src/lib/libcrypto/x509v3/v3conf.c
+++ b/src/lib/libcrypto/x509v3/v3conf.c
@@ -60,7 +60,6 @@
60#include <stdio.h> 60#include <stdio.h>
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include <openssl/asn1.h> 62#include <openssl/asn1.h>
63#include <openssl/asn1_mac.h>
64#include <openssl/conf.h> 63#include <openssl/conf.h>
65#include <openssl/x509.h> 64#include <openssl/x509.h>
66#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
diff --git a/src/lib/libcrypto/x509v3/v3err.c b/src/lib/libcrypto/x509v3/v3err.c
index aa4a605dc4..6458e95bb9 100644
--- a/src/lib/libcrypto/x509v3/v3err.c
+++ b/src/lib/libcrypto/x509v3/v3err.c
@@ -63,7 +63,7 @@
63#include <openssl/x509v3.h> 63#include <openssl/x509v3.h>
64 64
65/* BEGIN ERROR CODES */ 65/* BEGIN ERROR CODES */
66#ifndef NO_ERR 66#ifndef OPENSSL_NO_ERR
67static ERR_STRING_DATA X509V3_str_functs[]= 67static ERR_STRING_DATA X509V3_str_functs[]=
68 { 68 {
69{ERR_PACK(0,X509V3_F_COPY_EMAIL,0), "COPY_EMAIL"}, 69{ERR_PACK(0,X509V3_F_COPY_EMAIL,0), "COPY_EMAIL"},
@@ -98,6 +98,7 @@ static ERR_STRING_DATA X509V3_str_functs[]=
98{ERR_PACK(0,X509V3_F_V2I_GENERAL_NAME,0), "v2i_GENERAL_NAME"}, 98{ERR_PACK(0,X509V3_F_V2I_GENERAL_NAME,0), "v2i_GENERAL_NAME"},
99{ERR_PACK(0,X509V3_F_V2I_GENERAL_NAMES,0), "v2i_GENERAL_NAMES"}, 99{ERR_PACK(0,X509V3_F_V2I_GENERAL_NAMES,0), "v2i_GENERAL_NAMES"},
100{ERR_PACK(0,X509V3_F_V3_GENERIC_EXTENSION,0), "V3_GENERIC_EXTENSION"}, 100{ERR_PACK(0,X509V3_F_V3_GENERIC_EXTENSION,0), "V3_GENERIC_EXTENSION"},
101{ERR_PACK(0,X509V3_F_X509V3_ADD_I2D,0), "X509V3_ADD_I2D"},
101{ERR_PACK(0,X509V3_F_X509V3_ADD_VALUE,0), "X509V3_add_value"}, 102{ERR_PACK(0,X509V3_F_X509V3_ADD_VALUE,0), "X509V3_add_value"},
102{ERR_PACK(0,X509V3_F_X509V3_EXT_ADD,0), "X509V3_EXT_add"}, 103{ERR_PACK(0,X509V3_F_X509V3_EXT_ADD,0), "X509V3_EXT_add"},
103{ERR_PACK(0,X509V3_F_X509V3_EXT_ADD_ALIAS,0), "X509V3_EXT_add_alias"}, 104{ERR_PACK(0,X509V3_F_X509V3_EXT_ADD_ALIAS,0), "X509V3_EXT_add_alias"},
@@ -106,6 +107,7 @@ static ERR_STRING_DATA X509V3_str_functs[]=
106{ERR_PACK(0,X509V3_F_X509V3_GET_VALUE_BOOL,0), "X509V3_get_value_bool"}, 107{ERR_PACK(0,X509V3_F_X509V3_GET_VALUE_BOOL,0), "X509V3_get_value_bool"},
107{ERR_PACK(0,X509V3_F_X509V3_PARSE_LIST,0), "X509V3_parse_list"}, 108{ERR_PACK(0,X509V3_F_X509V3_PARSE_LIST,0), "X509V3_parse_list"},
108{ERR_PACK(0,X509V3_F_X509_PURPOSE_ADD,0), "X509_PURPOSE_add"}, 109{ERR_PACK(0,X509V3_F_X509_PURPOSE_ADD,0), "X509_PURPOSE_add"},
110{ERR_PACK(0,X509V3_F_X509_PURPOSE_SET,0), "X509_PURPOSE_set"},
109{0,NULL} 111{0,NULL}
110 }; 112 };
111 113
@@ -117,8 +119,10 @@ static ERR_STRING_DATA X509V3_str_reasons[]=
117{X509V3_R_BN_TO_ASN1_INTEGER_ERROR ,"bn to asn1 integer error"}, 119{X509V3_R_BN_TO_ASN1_INTEGER_ERROR ,"bn to asn1 integer error"},
118{X509V3_R_DUPLICATE_ZONE_ID ,"duplicate zone id"}, 120{X509V3_R_DUPLICATE_ZONE_ID ,"duplicate zone id"},
119{X509V3_R_ERROR_CONVERTING_ZONE ,"error converting zone"}, 121{X509V3_R_ERROR_CONVERTING_ZONE ,"error converting zone"},
122{X509V3_R_ERROR_CREATING_EXTENSION ,"error creating extension"},
120{X509V3_R_ERROR_IN_EXTENSION ,"error in extension"}, 123{X509V3_R_ERROR_IN_EXTENSION ,"error in extension"},
121{X509V3_R_EXPECTED_A_SECTION_NAME ,"expected a section name"}, 124{X509V3_R_EXPECTED_A_SECTION_NAME ,"expected a section name"},
125{X509V3_R_EXTENSION_EXISTS ,"extension exists"},
122{X509V3_R_EXTENSION_NAME_ERROR ,"extension name error"}, 126{X509V3_R_EXTENSION_NAME_ERROR ,"extension name error"},
123{X509V3_R_EXTENSION_NOT_FOUND ,"extension not found"}, 127{X509V3_R_EXTENSION_NOT_FOUND ,"extension not found"},
124{X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED,"extension setting not supported"}, 128{X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED,"extension setting not supported"},
@@ -135,6 +139,7 @@ static ERR_STRING_DATA X509V3_str_reasons[]=
135{X509V3_R_INVALID_OBJECT_IDENTIFIER ,"invalid object identifier"}, 139{X509V3_R_INVALID_OBJECT_IDENTIFIER ,"invalid object identifier"},
136{X509V3_R_INVALID_OPTION ,"invalid option"}, 140{X509V3_R_INVALID_OPTION ,"invalid option"},
137{X509V3_R_INVALID_POLICY_IDENTIFIER ,"invalid policy identifier"}, 141{X509V3_R_INVALID_POLICY_IDENTIFIER ,"invalid policy identifier"},
142{X509V3_R_INVALID_PURPOSE ,"invalid purpose"},
138{X509V3_R_INVALID_SECTION ,"invalid section"}, 143{X509V3_R_INVALID_SECTION ,"invalid section"},
139{X509V3_R_INVALID_SYNTAX ,"invalid syntax"}, 144{X509V3_R_INVALID_SYNTAX ,"invalid syntax"},
140{X509V3_R_ISSUER_DECODE_ERROR ,"issuer decode error"}, 145{X509V3_R_ISSUER_DECODE_ERROR ,"issuer decode error"},
@@ -167,7 +172,7 @@ void ERR_load_X509V3_strings(void)
167 if (init) 172 if (init)
168 { 173 {
169 init=0; 174 init=0;
170#ifndef NO_ERR 175#ifndef OPENSSL_NO_ERR
171 ERR_load_strings(ERR_LIB_X509V3,X509V3_str_functs); 176 ERR_load_strings(ERR_LIB_X509V3,X509V3_str_functs);
172 ERR_load_strings(ERR_LIB_X509V3,X509V3_str_reasons); 177 ERR_load_strings(ERR_LIB_X509V3,X509V3_str_reasons);
173#endif 178#endif
diff --git a/src/lib/libcrypto/x509v3/v3prin.c b/src/lib/libcrypto/x509v3/v3prin.c
index ee798859f0..b529814319 100644
--- a/src/lib/libcrypto/x509v3/v3prin.c
+++ b/src/lib/libcrypto/x509v3/v3prin.c
@@ -59,9 +59,7 @@
59 59
60 60
61#include <stdio.h> 61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/asn1.h> 62#include <openssl/asn1.h>
64#include <openssl/asn1_mac.h>
65#include <openssl/conf.h> 63#include <openssl/conf.h>
66#include <openssl/x509.h> 64#include <openssl/x509.h>
67#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
diff --git a/src/lib/libcrypto/x509v3/x509v3.h b/src/lib/libcrypto/x509v3/x509v3.h
index 0453b12d63..daecc55271 100644
--- a/src/lib/libcrypto/x509v3/x509v3.h
+++ b/src/lib/libcrypto/x509v3/x509v3.h
@@ -88,6 +88,9 @@ typedef void * (*X509V3_EXT_R2I)(struct v3_ext_method *method, struct v3_ext_ctx
88struct v3_ext_method { 88struct v3_ext_method {
89int ext_nid; 89int ext_nid;
90int ext_flags; 90int ext_flags;
91/* If this is set the following four fields are ignored */
92ASN1_ITEM_EXP *it;
93/* Old style ASN1 calls */
91X509V3_EXT_NEW ext_new; 94X509V3_EXT_NEW ext_new;
92X509V3_EXT_FREE ext_free; 95X509V3_EXT_FREE ext_free;
93X509V3_EXT_D2I d2i; 96X509V3_EXT_D2I d2i;
@@ -156,35 +159,56 @@ ASN1_OBJECT *type_id;
156ASN1_TYPE *value; 159ASN1_TYPE *value;
157} OTHERNAME; 160} OTHERNAME;
158 161
162typedef struct EDIPartyName_st {
163 ASN1_STRING *nameAssigner;
164 ASN1_STRING *partyName;
165} EDIPARTYNAME;
166
159typedef struct GENERAL_NAME_st { 167typedef struct GENERAL_NAME_st {
160 168
161#define GEN_OTHERNAME (0|V_ASN1_CONTEXT_SPECIFIC) 169#define GEN_OTHERNAME 0
162#define GEN_EMAIL (1|V_ASN1_CONTEXT_SPECIFIC) 170#define GEN_EMAIL 1
163#define GEN_DNS (2|V_ASN1_CONTEXT_SPECIFIC) 171#define GEN_DNS 2
164#define GEN_X400 (3|V_ASN1_CONTEXT_SPECIFIC) 172#define GEN_X400 3
165#define GEN_DIRNAME (4|V_ASN1_CONTEXT_SPECIFIC) 173#define GEN_DIRNAME 4
166#define GEN_EDIPARTY (5|V_ASN1_CONTEXT_SPECIFIC) 174#define GEN_EDIPARTY 5
167#define GEN_URI (6|V_ASN1_CONTEXT_SPECIFIC) 175#define GEN_URI 6
168#define GEN_IPADD (7|V_ASN1_CONTEXT_SPECIFIC) 176#define GEN_IPADD 7
169#define GEN_RID (8|V_ASN1_CONTEXT_SPECIFIC) 177#define GEN_RID 8
170 178
171int type; 179int type;
172union { 180union {
173 char *ptr; 181 char *ptr;
174 ASN1_IA5STRING *ia5;/* rfc822Name, dNSName, uniformResourceIdentifier */ 182 OTHERNAME *otherName; /* otherName */
183 ASN1_IA5STRING *rfc822Name;
184 ASN1_IA5STRING *dNSName;
185 ASN1_TYPE *x400Address;
186 X509_NAME *directoryName;
187 EDIPARTYNAME *ediPartyName;
188 ASN1_IA5STRING *uniformResourceIdentifier;
189 ASN1_OCTET_STRING *iPAddress;
190 ASN1_OBJECT *registeredID;
191
192 /* Old names */
175 ASN1_OCTET_STRING *ip; /* iPAddress */ 193 ASN1_OCTET_STRING *ip; /* iPAddress */
176 X509_NAME *dirn; /* dirn */ 194 X509_NAME *dirn; /* dirn */
195 ASN1_IA5STRING *ia5;/* rfc822Name, dNSName, uniformResourceIdentifier */
177 ASN1_OBJECT *rid; /* registeredID */ 196 ASN1_OBJECT *rid; /* registeredID */
178 OTHERNAME *otherName; /* otherName */ 197 ASN1_TYPE *other; /* x400Address */
179 ASN1_TYPE *other; /* ediPartyName, x400Address */
180} d; 198} d;
181} GENERAL_NAME; 199} GENERAL_NAME;
182 200
201typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES;
202
183typedef struct ACCESS_DESCRIPTION_st { 203typedef struct ACCESS_DESCRIPTION_st {
184 ASN1_OBJECT *method; 204 ASN1_OBJECT *method;
185 GENERAL_NAME *location; 205 GENERAL_NAME *location;
186} ACCESS_DESCRIPTION; 206} ACCESS_DESCRIPTION;
187 207
208typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
209
210typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE;
211
188DECLARE_STACK_OF(GENERAL_NAME) 212DECLARE_STACK_OF(GENERAL_NAME)
189DECLARE_ASN1_SET_OF(GENERAL_NAME) 213DECLARE_ASN1_SET_OF(GENERAL_NAME)
190 214
@@ -192,23 +216,27 @@ DECLARE_STACK_OF(ACCESS_DESCRIPTION)
192DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) 216DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION)
193 217
194typedef struct DIST_POINT_NAME_st { 218typedef struct DIST_POINT_NAME_st {
195/* NB: this is a CHOICE type and only one of these should be set */ 219int type;
196STACK_OF(GENERAL_NAME) *fullname; 220union {
197STACK_OF(X509_NAME_ENTRY) *relativename; 221 GENERAL_NAMES *fullname;
222 STACK_OF(X509_NAME_ENTRY) *relativename;
223} name;
198} DIST_POINT_NAME; 224} DIST_POINT_NAME;
199 225
200typedef struct DIST_POINT_st { 226typedef struct DIST_POINT_st {
201DIST_POINT_NAME *distpoint; 227DIST_POINT_NAME *distpoint;
202ASN1_BIT_STRING *reasons; 228ASN1_BIT_STRING *reasons;
203STACK_OF(GENERAL_NAME) *CRLissuer; 229GENERAL_NAMES *CRLissuer;
204} DIST_POINT; 230} DIST_POINT;
205 231
232typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;
233
206DECLARE_STACK_OF(DIST_POINT) 234DECLARE_STACK_OF(DIST_POINT)
207DECLARE_ASN1_SET_OF(DIST_POINT) 235DECLARE_ASN1_SET_OF(DIST_POINT)
208 236
209typedef struct AUTHORITY_KEYID_st { 237typedef struct AUTHORITY_KEYID_st {
210ASN1_OCTET_STRING *keyid; 238ASN1_OCTET_STRING *keyid;
211STACK_OF(GENERAL_NAME) *issuer; 239GENERAL_NAMES *issuer;
212ASN1_INTEGER *serial; 240ASN1_INTEGER *serial;
213} AUTHORITY_KEYID; 241} AUTHORITY_KEYID;
214 242
@@ -254,6 +282,8 @@ typedef struct POLICYINFO_st {
254 STACK_OF(POLICYQUALINFO) *qualifiers; 282 STACK_OF(POLICYQUALINFO) *qualifiers;
255} POLICYINFO; 283} POLICYINFO;
256 284
285typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;
286
257DECLARE_STACK_OF(POLICYINFO) 287DECLARE_STACK_OF(POLICYINFO)
258DECLARE_ASN1_SET_OF(POLICYINFO) 288DECLARE_ASN1_SET_OF(POLICYINFO)
259 289
@@ -262,32 +292,24 @@ DECLARE_ASN1_SET_OF(POLICYINFO)
262 292
263#define X509V3_set_ctx_test(ctx) \ 293#define X509V3_set_ctx_test(ctx) \
264 X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST) 294 X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)
265#define X509V3_set_ctx_nodb(ctx) ctx->db = NULL; 295#define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL;
266 296
267#define EXT_BITSTRING(nid, table) { nid, 0, \ 297#define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \
268 (X509V3_EXT_NEW)ASN1_BIT_STRING_new, \ 298 0,0,0,0, \
269 (X509V3_EXT_FREE)ASN1_BIT_STRING_free, \ 299 0,0, \
270 (X509V3_EXT_D2I)d2i_ASN1_BIT_STRING, \
271 (X509V3_EXT_I2D)i2d_ASN1_BIT_STRING, \
272 NULL, NULL, \
273 (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \ 300 (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \
274 (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \ 301 (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \
275 NULL, NULL, \ 302 NULL, NULL, \
276 (char *)table} 303 table}
277 304
278#define EXT_IA5STRING(nid) { nid, 0, \ 305#define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \
279 (X509V3_EXT_NEW)ASN1_IA5STRING_new, \ 306 0,0,0,0, \
280 (X509V3_EXT_FREE)ASN1_IA5STRING_free, \
281 (X509V3_EXT_D2I)d2i_ASN1_IA5STRING, \
282 (X509V3_EXT_I2D)i2d_ASN1_IA5STRING, \
283 (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \ 307 (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \
284 (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \ 308 (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \
285 NULL, NULL, NULL, NULL, \ 309 0,0,0,0, \
286 NULL} 310 NULL}
287 311
288#define EXT_END { -1, 0, NULL, NULL, NULL, NULL, NULL, NULL, \ 312#define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
289 NULL, NULL, NULL, NULL, \
290 NULL}
291 313
292 314
293/* X509_PURPOSE stuff */ 315/* X509_PURPOSE stuff */
@@ -302,6 +324,7 @@ DECLARE_ASN1_SET_OF(POLICYINFO)
302#define EXFLAG_V1 0x40 324#define EXFLAG_V1 0x40
303#define EXFLAG_INVALID 0x80 325#define EXFLAG_INVALID 0x80
304#define EXFLAG_SET 0x100 326#define EXFLAG_SET 0x100
327#define EXFLAG_CRITICAL 0x200
305 328
306#define KU_DIGITAL_SIGNATURE 0x0080 329#define KU_DIGITAL_SIGNATURE 0x0080
307#define KU_NON_REPUDIATION 0x0040 330#define KU_NON_REPUDIATION 0x0040
@@ -320,12 +343,15 @@ DECLARE_ASN1_SET_OF(POLICYINFO)
320#define NS_SSL_CA 0x04 343#define NS_SSL_CA 0x04
321#define NS_SMIME_CA 0x02 344#define NS_SMIME_CA 0x02
322#define NS_OBJSIGN_CA 0x01 345#define NS_OBJSIGN_CA 0x01
346#define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA)
323 347
324#define XKU_SSL_SERVER 0x1 348#define XKU_SSL_SERVER 0x1
325#define XKU_SSL_CLIENT 0x2 349#define XKU_SSL_CLIENT 0x2
326#define XKU_SMIME 0x4 350#define XKU_SMIME 0x4
327#define XKU_CODE_SIGN 0x8 351#define XKU_CODE_SIGN 0x8
328#define XKU_SGC 0x10 352#define XKU_SGC 0x10
353#define XKU_OCSP_SIGN 0x20
354#define XKU_TIMESTAMP 0x40
329 355
330#define X509_PURPOSE_DYNAMIC 0x1 356#define X509_PURPOSE_DYNAMIC 0x1
331#define X509_PURPOSE_DYNAMIC_NAME 0x2 357#define X509_PURPOSE_DYNAMIC_NAME 0x2
@@ -348,33 +374,40 @@ typedef struct x509_purpose_st {
348#define X509_PURPOSE_SMIME_ENCRYPT 5 374#define X509_PURPOSE_SMIME_ENCRYPT 5
349#define X509_PURPOSE_CRL_SIGN 6 375#define X509_PURPOSE_CRL_SIGN 6
350#define X509_PURPOSE_ANY 7 376#define X509_PURPOSE_ANY 7
377#define X509_PURPOSE_OCSP_HELPER 8
351 378
352#define X509_PURPOSE_MIN 1 379#define X509_PURPOSE_MIN 1
353#define X509_PURPOSE_MAX 7 380#define X509_PURPOSE_MAX 8
381
382/* Flags for X509V3_EXT_print() */
383
384#define X509V3_EXT_UNKNOWN_MASK (0xfL << 16)
385/* Return error for unknown extensions */
386#define X509V3_EXT_DEFAULT 0
387/* Print error for unknown extensions */
388#define X509V3_EXT_ERROR_UNKNOWN (1L << 16)
389/* ASN1 parse unknown extensions */
390#define X509V3_EXT_PARSE_UNKNOWN (2L << 16)
391/* BIO_dump unknown extensions */
392#define X509V3_EXT_DUMP_UNKNOWN (3L << 16)
393
394/* Flags for X509V3_add1_i2d */
395
396#define X509V3_ADD_OP_MASK 0xfL
397#define X509V3_ADD_DEFAULT 0L
398#define X509V3_ADD_APPEND 1L
399#define X509V3_ADD_REPLACE 2L
400#define X509V3_ADD_REPLACE_EXISTING 3L
401#define X509V3_ADD_KEEP_EXISTING 4L
402#define X509V3_ADD_DELETE 5L
403#define X509V3_ADD_SILENT 0x10
354 404
355DECLARE_STACK_OF(X509_PURPOSE) 405DECLARE_STACK_OF(X509_PURPOSE)
356 406
357void ERR_load_X509V3_strings(void); 407DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)
358int i2d_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS *a, unsigned char **pp);
359BASIC_CONSTRAINTS *d2i_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS **a, unsigned char **pp, long length);
360BASIC_CONSTRAINTS *BASIC_CONSTRAINTS_new(void);
361void BASIC_CONSTRAINTS_free(BASIC_CONSTRAINTS *a);
362
363int i2d_GENERAL_NAME(GENERAL_NAME *a, unsigned char **pp);
364GENERAL_NAME *d2i_GENERAL_NAME(GENERAL_NAME **a, unsigned char **pp, long length);
365GENERAL_NAME *GENERAL_NAME_new(void);
366void GENERAL_NAME_free(GENERAL_NAME *a);
367STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret);
368
369int i2d_SXNET(SXNET *a, unsigned char **pp);
370SXNET *d2i_SXNET(SXNET **a, unsigned char **pp, long length);
371SXNET *SXNET_new(void);
372void SXNET_free(SXNET *a);
373 408
374int i2d_SXNETID(SXNETID *a, unsigned char **pp); 409DECLARE_ASN1_FUNCTIONS(SXNET)
375SXNETID *d2i_SXNETID(SXNETID **a, unsigned char **pp, long length); 410DECLARE_ASN1_FUNCTIONS(SXNETID)
376SXNETID *SXNETID_new(void);
377void SXNETID_free(SXNETID *a);
378 411
379int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen); 412int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen);
380int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen); 413int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen);
@@ -384,108 +417,66 @@ ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone);
384ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone); 417ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone);
385ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone); 418ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone);
386 419
387int i2d_AUTHORITY_KEYID(AUTHORITY_KEYID *a, unsigned char **pp); 420DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID)
388AUTHORITY_KEYID *d2i_AUTHORITY_KEYID(AUTHORITY_KEYID **a, unsigned char **pp, long length);
389AUTHORITY_KEYID *AUTHORITY_KEYID_new(void);
390void AUTHORITY_KEYID_free(AUTHORITY_KEYID *a);
391 421
392int i2d_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD *a, unsigned char **pp); 422DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD)
393PKEY_USAGE_PERIOD *d2i_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD **a, unsigned char **pp, long length); 423
394PKEY_USAGE_PERIOD *PKEY_USAGE_PERIOD_new(void); 424DECLARE_ASN1_FUNCTIONS(GENERAL_NAME)
395void PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *a); 425
426STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret);
427int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen);
428
429DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES)
396 430
397STACK_OF(GENERAL_NAME) *GENERAL_NAMES_new(void);
398void GENERAL_NAMES_free(STACK_OF(GENERAL_NAME) *a);
399STACK_OF(GENERAL_NAME) *d2i_GENERAL_NAMES(STACK_OF(GENERAL_NAME) **a, unsigned char **pp, long length);
400int i2d_GENERAL_NAMES(STACK_OF(GENERAL_NAME) *a, unsigned char **pp);
401STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, 431STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method,
402 STACK_OF(GENERAL_NAME) *gen, STACK_OF(CONF_VALUE) *extlist); 432 GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist);
403STACK_OF(GENERAL_NAME) *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method, 433GENERAL_NAMES *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method,
404 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); 434 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
405 435
406int i2d_OTHERNAME(OTHERNAME *a, unsigned char **pp); 436DECLARE_ASN1_FUNCTIONS(OTHERNAME)
407OTHERNAME *OTHERNAME_new(void); 437DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME)
408OTHERNAME *d2i_OTHERNAME(OTHERNAME **a, unsigned char **pp, long length);
409void OTHERNAME_free(OTHERNAME *a);
410 438
411char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5); 439char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5);
412ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); 440ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
413 441
414int i2d_ext_ku(STACK_OF(ASN1_OBJECT) *a, unsigned char **pp); 442DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE)
415STACK_OF(ASN1_OBJECT) *d2i_ext_ku(STACK_OF(ASN1_OBJECT) **a, 443int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION* a);
416 unsigned char **pp, long length); 444
417void ext_ku_free(STACK_OF(ASN1_OBJECT) *a); 445DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES)
418STACK_OF(ASN1_OBJECT) *ext_ku_new(void); 446DECLARE_ASN1_FUNCTIONS(POLICYINFO)
419 447DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO)
420int i2d_CERTIFICATEPOLICIES(STACK_OF(POLICYINFO) *a, unsigned char **pp); 448DECLARE_ASN1_FUNCTIONS(USERNOTICE)
421STACK_OF(POLICYINFO) *CERTIFICATEPOLICIES_new(void); 449DECLARE_ASN1_FUNCTIONS(NOTICEREF)
422void CERTIFICATEPOLICIES_free(STACK_OF(POLICYINFO) *a);
423STACK_OF(POLICYINFO) *d2i_CERTIFICATEPOLICIES(STACK_OF(POLICYINFO) **a, unsigned char **pp, long length);
424
425int i2d_POLICYINFO(POLICYINFO *a, unsigned char **pp);
426POLICYINFO *POLICYINFO_new(void);
427POLICYINFO *d2i_POLICYINFO(POLICYINFO **a, unsigned char **pp, long length);
428void POLICYINFO_free(POLICYINFO *a);
429
430int i2d_POLICYQUALINFO(POLICYQUALINFO *a, unsigned char **pp);
431POLICYQUALINFO *POLICYQUALINFO_new(void);
432POLICYQUALINFO *d2i_POLICYQUALINFO(POLICYQUALINFO **a, unsigned char **pp,
433 long length);
434void POLICYQUALINFO_free(POLICYQUALINFO *a);
435
436int i2d_USERNOTICE(USERNOTICE *a, unsigned char **pp);
437USERNOTICE *USERNOTICE_new(void);
438USERNOTICE *d2i_USERNOTICE(USERNOTICE **a, unsigned char **pp, long length);
439void USERNOTICE_free(USERNOTICE *a);
440
441int i2d_NOTICEREF(NOTICEREF *a, unsigned char **pp);
442NOTICEREF *NOTICEREF_new(void);
443NOTICEREF *d2i_NOTICEREF(NOTICEREF **a, unsigned char **pp, long length);
444void NOTICEREF_free(NOTICEREF *a);
445
446int i2d_CRL_DIST_POINTS(STACK_OF(DIST_POINT) *a, unsigned char **pp);
447STACK_OF(DIST_POINT) *CRL_DIST_POINTS_new(void);
448void CRL_DIST_POINTS_free(STACK_OF(DIST_POINT) *a);
449STACK_OF(DIST_POINT) *d2i_CRL_DIST_POINTS(STACK_OF(DIST_POINT) **a,
450 unsigned char **pp,long length);
451
452int i2d_DIST_POINT(DIST_POINT *a, unsigned char **pp);
453DIST_POINT *DIST_POINT_new(void);
454DIST_POINT *d2i_DIST_POINT(DIST_POINT **a, unsigned char **pp, long length);
455void DIST_POINT_free(DIST_POINT *a);
456
457int i2d_DIST_POINT_NAME(DIST_POINT_NAME *a, unsigned char **pp);
458DIST_POINT_NAME *DIST_POINT_NAME_new(void);
459void DIST_POINT_NAME_free(DIST_POINT_NAME *a);
460DIST_POINT_NAME *d2i_DIST_POINT_NAME(DIST_POINT_NAME **a, unsigned char **pp,
461 long length);
462
463int i2d_ACCESS_DESCRIPTION(ACCESS_DESCRIPTION *a, unsigned char **pp);
464ACCESS_DESCRIPTION *ACCESS_DESCRIPTION_new(void);
465void ACCESS_DESCRIPTION_free(ACCESS_DESCRIPTION *a);
466ACCESS_DESCRIPTION *d2i_ACCESS_DESCRIPTION(ACCESS_DESCRIPTION **a, unsigned char **pp,
467 long length);
468
469STACK_OF(ACCESS_DESCRIPTION) *AUTHORITY_INFO_ACCESS_new(void);
470void AUTHORITY_INFO_ACCESS_free(STACK_OF(ACCESS_DESCRIPTION) *a);
471STACK_OF(ACCESS_DESCRIPTION) *d2i_AUTHORITY_INFO_ACCESS(STACK_OF(ACCESS_DESCRIPTION) **a,
472 unsigned char **pp, long length);
473int i2d_AUTHORITY_INFO_ACCESS(STACK_OF(ACCESS_DESCRIPTION) *a, unsigned char **pp);
474 450
451DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS)
452DECLARE_ASN1_FUNCTIONS(DIST_POINT)
453DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME)
475 454
455DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION)
456DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS)
476 457
477#ifdef HEADER_CONF_H 458#ifdef HEADER_CONF_H
478GENERAL_NAME *v2i_GENERAL_NAME(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, CONF_VALUE *cnf); 459GENERAL_NAME *v2i_GENERAL_NAME(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, CONF_VALUE *cnf);
479void X509V3_conf_free(CONF_VALUE *val); 460void X509V3_conf_free(CONF_VALUE *val);
461
462X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value);
463X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, char *value);
464int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, STACK_OF(X509_EXTENSION) **sk);
465int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509 *cert);
466int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_REQ *req);
467int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl);
468
480X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, char *value); 469X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, char *value);
481X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, char *value); 470X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, char *value);
482int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509 *cert); 471int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509 *cert);
483int X509V3_EXT_REQ_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); 472int X509V3_EXT_REQ_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_REQ *req);
484int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); 473int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl);
474
485int X509V3_add_value_bool_nf(char *name, int asn1_bool, 475int X509V3_add_value_bool_nf(char *name, int asn1_bool,
486 STACK_OF(CONF_VALUE) **extlist); 476 STACK_OF(CONF_VALUE) **extlist);
487int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool); 477int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool);
488int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint); 478int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint);
479void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf);
489void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash); 480void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash);
490#endif 481#endif
491 482
@@ -516,11 +507,13 @@ void X509V3_EXT_cleanup(void);
516X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext); 507X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext);
517X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid); 508X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid);
518int X509V3_add_standard_extensions(void); 509int X509V3_add_standard_extensions(void);
519STACK_OF(CONF_VALUE) *X509V3_parse_list(char *line); 510STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line);
520void *X509V3_EXT_d2i(X509_EXTENSION *ext); 511void *X509V3_EXT_d2i(X509_EXTENSION *ext);
521void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx); 512void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx);
522 513
514
523X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); 515X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc);
516int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags);
524 517
525char *hex_to_string(unsigned char *buffer, long len); 518char *hex_to_string(unsigned char *buffer, long len);
526unsigned char *string_to_hex(char *str, long *len); 519unsigned char *string_to_hex(char *str, long *len);
@@ -528,10 +521,14 @@ int name_cmp(const char *name, const char *cmp);
528 521
529void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, 522void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
530 int ml); 523 int ml);
531int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, int flag, int indent); 524int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent);
532int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent); 525int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
533 526
527int X509V3_extensions_print(BIO *out, char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent);
528
534int X509_check_purpose(X509 *x, int id, int ca); 529int X509_check_purpose(X509 *x, int id, int ca);
530int X509_supported_extension(X509_EXTENSION *ex);
531int X509_PURPOSE_set(int *p, int purpose);
535int X509_check_issued(X509 *issuer, X509 *subject); 532int X509_check_issued(X509 *issuer, X509 *subject);
536int X509_PURPOSE_get_count(void); 533int X509_PURPOSE_get_count(void);
537X509_PURPOSE * X509_PURPOSE_get0(int idx); 534X509_PURPOSE * X509_PURPOSE_get0(int idx);
@@ -555,6 +552,7 @@ void X509_email_free(STACK *sk);
555/* The following lines are auto generated by the script mkerr.pl. Any changes 552/* The following lines are auto generated by the script mkerr.pl. Any changes
556 * made after this point may be overwritten when the script is next run. 553 * made after this point may be overwritten when the script is next run.
557 */ 554 */
555void ERR_load_X509V3_strings(void);
558 556
559/* Error codes for the X509V3 functions. */ 557/* Error codes for the X509V3 functions. */
560 558
@@ -591,6 +589,7 @@ void X509_email_free(STACK *sk);
591#define X509V3_F_V2I_GENERAL_NAME 117 589#define X509V3_F_V2I_GENERAL_NAME 117
592#define X509V3_F_V2I_GENERAL_NAMES 118 590#define X509V3_F_V2I_GENERAL_NAMES 118
593#define X509V3_F_V3_GENERIC_EXTENSION 116 591#define X509V3_F_V3_GENERIC_EXTENSION 116
592#define X509V3_F_X509V3_ADD_I2D 140
594#define X509V3_F_X509V3_ADD_VALUE 105 593#define X509V3_F_X509V3_ADD_VALUE 105
595#define X509V3_F_X509V3_EXT_ADD 104 594#define X509V3_F_X509V3_EXT_ADD 104
596#define X509V3_F_X509V3_EXT_ADD_ALIAS 106 595#define X509V3_F_X509V3_EXT_ADD_ALIAS 106
@@ -599,6 +598,7 @@ void X509_email_free(STACK *sk);
599#define X509V3_F_X509V3_GET_VALUE_BOOL 110 598#define X509V3_F_X509V3_GET_VALUE_BOOL 110
600#define X509V3_F_X509V3_PARSE_LIST 109 599#define X509V3_F_X509V3_PARSE_LIST 109
601#define X509V3_F_X509_PURPOSE_ADD 137 600#define X509V3_F_X509_PURPOSE_ADD 137
601#define X509V3_F_X509_PURPOSE_SET 141
602 602
603/* Reason codes. */ 603/* Reason codes. */
604#define X509V3_R_BAD_IP_ADDRESS 118 604#define X509V3_R_BAD_IP_ADDRESS 118
@@ -607,8 +607,10 @@ void X509_email_free(STACK *sk);
607#define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101 607#define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101
608#define X509V3_R_DUPLICATE_ZONE_ID 133 608#define X509V3_R_DUPLICATE_ZONE_ID 133
609#define X509V3_R_ERROR_CONVERTING_ZONE 131 609#define X509V3_R_ERROR_CONVERTING_ZONE 131
610#define X509V3_R_ERROR_CREATING_EXTENSION 144
610#define X509V3_R_ERROR_IN_EXTENSION 128 611#define X509V3_R_ERROR_IN_EXTENSION 128
611#define X509V3_R_EXPECTED_A_SECTION_NAME 137 612#define X509V3_R_EXPECTED_A_SECTION_NAME 137
613#define X509V3_R_EXTENSION_EXISTS 145
612#define X509V3_R_EXTENSION_NAME_ERROR 115 614#define X509V3_R_EXTENSION_NAME_ERROR 115
613#define X509V3_R_EXTENSION_NOT_FOUND 102 615#define X509V3_R_EXTENSION_NOT_FOUND 102
614#define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103 616#define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103
@@ -625,6 +627,7 @@ void X509_email_free(STACK *sk);
625#define X509V3_R_INVALID_OBJECT_IDENTIFIER 110 627#define X509V3_R_INVALID_OBJECT_IDENTIFIER 110
626#define X509V3_R_INVALID_OPTION 138 628#define X509V3_R_INVALID_OPTION 138
627#define X509V3_R_INVALID_POLICY_IDENTIFIER 134 629#define X509V3_R_INVALID_POLICY_IDENTIFIER 134
630#define X509V3_R_INVALID_PURPOSE 146
628#define X509V3_R_INVALID_SECTION 135 631#define X509V3_R_INVALID_SECTION 135
629#define X509V3_R_INVALID_SYNTAX 143 632#define X509V3_R_INVALID_SYNTAX 143
630#define X509V3_R_ISSUER_DECODE_ERROR 126 633#define X509V3_R_ISSUER_DECODE_ERROR 126
@@ -650,4 +653,3 @@ void X509_email_free(STACK *sk);
650} 653}
651#endif 654#endif
652#endif 655#endif
653