summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509')
-rw-r--r--src/lib/libcrypto/x509/Makefile.ssl647
-rw-r--r--src/lib/libcrypto/x509/by_file.c4
-rw-r--r--src/lib/libcrypto/x509/x509.h321
-rw-r--r--src/lib/libcrypto/x509/x509_att.c26
-rw-r--r--src/lib/libcrypto/x509/x509_cmp.c37
-rw-r--r--src/lib/libcrypto/x509/x509_d2.c2
-rw-r--r--src/lib/libcrypto/x509/x509_err.c8
-rw-r--r--src/lib/libcrypto/x509/x509_ext.c19
-rw-r--r--src/lib/libcrypto/x509/x509_lu.c40
-rw-r--r--src/lib/libcrypto/x509/x509_obj.c1
-rw-r--r--src/lib/libcrypto/x509/x509_req.c16
-rw-r--r--src/lib/libcrypto/x509/x509_trs.c29
-rw-r--r--src/lib/libcrypto/x509/x509_txt.c10
-rw-r--r--src/lib/libcrypto/x509/x509_v3.c9
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.c347
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.h67
-rw-r--r--src/lib/libcrypto/x509/x509cset.c169
-rw-r--r--src/lib/libcrypto/x509/x509spki.c1
-rw-r--r--src/lib/libcrypto/x509/x_all.c203
19 files changed, 1134 insertions, 822 deletions
diff --git a/src/lib/libcrypto/x509/Makefile.ssl b/src/lib/libcrypto/x509/Makefile.ssl
index 79f09d4f71..62243ae812 100644
--- a/src/lib/libcrypto/x509/Makefile.ssl
+++ b/src/lib/libcrypto/x509/Makefile.ssl
@@ -5,13 +5,14 @@
5DIR= x509 5DIR= x509
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
@@ -24,13 +25,13 @@ APPS=
24LIB=$(TOP)/libcrypto.a 25LIB=$(TOP)/libcrypto.a
25LIBSRC= x509_def.c x509_d2.c x509_r2x.c x509_cmp.c \ 26LIBSRC= x509_def.c x509_d2.c x509_r2x.c x509_cmp.c \
26 x509_obj.c x509_req.c x509spki.c x509_vfy.c \ 27 x509_obj.c x509_req.c x509spki.c x509_vfy.c \
27 x509_set.c x509rset.c x509_err.c \ 28 x509_set.c x509cset.c x509rset.c x509_err.c \
28 x509name.c x509_v3.c x509_ext.c x509_att.c \ 29 x509name.c x509_v3.c x509_ext.c x509_att.c \
29 x509type.c x509_lu.c x_all.c x509_txt.c \ 30 x509type.c x509_lu.c x_all.c x509_txt.c \
30 x509_trs.c by_file.c by_dir.c 31 x509_trs.c by_file.c by_dir.c
31LIBOBJ= x509_def.o x509_d2.o x509_r2x.o x509_cmp.o \ 32LIBOBJ= x509_def.o x509_d2.o x509_r2x.o x509_cmp.o \
32 x509_obj.o x509_req.o x509spki.o x509_vfy.o \ 33 x509_obj.o x509_req.o x509spki.o x509_vfy.o \
33 x509_set.o x509rset.o x509_err.o \ 34 x509_set.o x509cset.o x509rset.o x509_err.o \
34 x509name.o x509_v3.o x509_ext.o x509_att.o \ 35 x509name.o x509_v3.o x509_ext.o x509_att.o \
35 x509type.o x509_lu.o x_all.o x509_txt.o \ 36 x509type.o x509_lu.o x_all.o x509_txt.o \
36 x509_trs.o by_file.o by_dir.o 37 x509_trs.o by_file.o by_dir.o
@@ -49,8 +50,7 @@ all: lib
49 50
50lib: $(LIBOBJ) 51lib: $(LIBOBJ)
51 $(AR) $(LIB) $(LIBOBJ) 52 $(AR) $(LIB) $(LIBOBJ)
52 @echo You may get an error following this line. Please ignore. 53 $(RANLIB) $(LIB) || echo Never mind.
53 - $(RANLIB) $(LIB)
54 @touch lib 54 @touch lib
55 55
56files: 56files:
@@ -89,433 +89,322 @@ clean:
89 89
90# DO NOT DELETE THIS LINE -- make depend depends on it. 90# DO NOT DELETE THIS LINE -- make depend depends on it.
91 91
92by_dir.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 92by_dir.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
93by_dir.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 93by_dir.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
94by_dir.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 94by_dir.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
95by_dir.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 95by_dir.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
96by_dir.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
97by_dir.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
98by_dir.o: ../../include/openssl/err.h ../../include/openssl/evp.h 96by_dir.o: ../../include/openssl/err.h ../../include/openssl/evp.h
99by_dir.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 97by_dir.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
100by_dir.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 98by_dir.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
101by_dir.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 99by_dir.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
102by_dir.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 100by_dir.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
103by_dir.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
104by_dir.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
105by_dir.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
106by_dir.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
107by_dir.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 101by_dir.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
108by_dir.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 102by_dir.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
109by_dir.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 103by_dir.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
110by_dir.o: ../cryptlib.h 104by_dir.o: ../cryptlib.h by_dir.c
111by_file.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 105by_file.o: ../../e_os.h ../../include/openssl/asn1.h
112by_file.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 106by_file.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
113by_file.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 107by_file.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
114by_file.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
115by_file.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 108by_file.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
116by_file.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 109by_file.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
117by_file.o: ../../include/openssl/err.h ../../include/openssl/evp.h 110by_file.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
118by_file.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
119by_file.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
120by_file.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
121by_file.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 111by_file.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
122by_file.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 112by_file.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
123by_file.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h 113by_file.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
124by_file.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 114by_file.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
125by_file.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 115by_file.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
126by_file.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 116by_file.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
127by_file.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 117by_file.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
128by_file.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 118by_file.o: ../../include/openssl/x509_vfy.h ../cryptlib.h by_file.c
129by_file.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 119x509_att.o: ../../e_os.h ../../include/openssl/asn1.h
130by_file.o: ../cryptlib.h 120x509_att.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
131x509_att.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 121x509_att.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
132x509_att.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 122x509_att.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
133x509_att.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 123x509_att.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
134x509_att.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
135x509_att.o: ../../include/openssl/des.h ../../include/openssl/dh.h
136x509_att.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
137x509_att.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
138x509_att.o: ../../include/openssl/err.h ../../include/openssl/evp.h 124x509_att.o: ../../include/openssl/err.h ../../include/openssl/evp.h
139x509_att.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 125x509_att.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
140x509_att.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 126x509_att.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
141x509_att.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 127x509_att.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
142x509_att.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 128x509_att.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
143x509_att.o: ../../include/openssl/opensslconf.h 129x509_att.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
144x509_att.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 130x509_att.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
145x509_att.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 131x509_att.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
146x509_att.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 132x509_att.o: ../../include/openssl/x509v3.h ../cryptlib.h x509_att.c
147x509_att.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 133x509_cmp.o: ../../e_os.h ../../include/openssl/asn1.h
148x509_att.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 134x509_cmp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
149x509_att.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 135x509_cmp.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
150x509_att.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 136x509_cmp.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
151x509_att.o: ../cryptlib.h 137x509_cmp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
152x509_cmp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
153x509_cmp.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
154x509_cmp.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
155x509_cmp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
156x509_cmp.o: ../../include/openssl/des.h ../../include/openssl/dh.h
157x509_cmp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
158x509_cmp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
159x509_cmp.o: ../../include/openssl/err.h ../../include/openssl/evp.h 138x509_cmp.o: ../../include/openssl/err.h ../../include/openssl/evp.h
160x509_cmp.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 139x509_cmp.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
161x509_cmp.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 140x509_cmp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
162x509_cmp.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 141x509_cmp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
163x509_cmp.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 142x509_cmp.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
164x509_cmp.o: ../../include/openssl/opensslconf.h 143x509_cmp.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
165x509_cmp.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 144x509_cmp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
166x509_cmp.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 145x509_cmp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
167x509_cmp.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 146x509_cmp.o: ../../include/openssl/x509v3.h ../cryptlib.h x509_cmp.c
168x509_cmp.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 147x509_d2.o: ../../e_os.h ../../include/openssl/asn1.h
169x509_cmp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 148x509_d2.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
170x509_cmp.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 149x509_d2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
171x509_cmp.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
172x509_cmp.o: ../cryptlib.h
173x509_d2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
174x509_d2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
175x509_d2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
176x509_d2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
177x509_d2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 150x509_d2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
178x509_d2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 151x509_d2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
179x509_d2.o: ../../include/openssl/err.h ../../include/openssl/evp.h 152x509_d2.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
180x509_d2.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
181x509_d2.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
182x509_d2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
183x509_d2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 153x509_d2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
184x509_d2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 154x509_d2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
185x509_d2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 155x509_d2.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
186x509_d2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 156x509_d2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
187x509_d2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 157x509_d2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
188x509_d2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 158x509_d2.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
189x509_d2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 159x509_d2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x509_d2.c
190x509_d2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 160x509_def.o: ../../e_os.h ../../include/openssl/asn1.h
191x509_d2.o: ../cryptlib.h 161x509_def.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
192x509_def.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 162x509_def.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
193x509_def.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
194x509_def.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
195x509_def.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
196x509_def.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 163x509_def.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
197x509_def.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 164x509_def.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
198x509_def.o: ../../include/openssl/err.h ../../include/openssl/evp.h 165x509_def.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
199x509_def.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
200x509_def.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
201x509_def.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
202x509_def.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 166x509_def.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
203x509_def.o: ../../include/openssl/opensslconf.h 167x509_def.o: ../../include/openssl/opensslconf.h
204x509_def.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 168x509_def.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
205x509_def.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 169x509_def.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
206x509_def.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 170x509_def.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
207x509_def.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 171x509_def.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
208x509_def.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 172x509_def.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
209x509_def.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 173x509_def.o: ../cryptlib.h x509_def.c
210x509_def.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
211x509_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 174x509_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
212x509_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 175x509_err.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
213x509_err.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 176x509_err.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
214x509_err.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 177x509_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
215x509_err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 178x509_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
216x509_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 179x509_err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
217x509_err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
218x509_err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
219x509_err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
220x509_err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
221x509_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 180x509_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
222x509_err.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 181x509_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
223x509_err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 182x509_err.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
224x509_err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 183x509_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
225x509_err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 184x509_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
226x509_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 185x509_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
227x509_err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 186x509_err.o: x509_err.c
228x509_err.o: ../../include/openssl/x509_vfy.h 187x509_ext.o: ../../e_os.h ../../include/openssl/asn1.h
229x509_ext.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 188x509_ext.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
230x509_ext.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 189x509_ext.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
231x509_ext.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 190x509_ext.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
232x509_ext.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 191x509_ext.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
233x509_ext.o: ../../include/openssl/des.h ../../include/openssl/dh.h
234x509_ext.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
235x509_ext.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
236x509_ext.o: ../../include/openssl/err.h ../../include/openssl/evp.h 192x509_ext.o: ../../include/openssl/err.h ../../include/openssl/evp.h
237x509_ext.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 193x509_ext.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
238x509_ext.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 194x509_ext.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
239x509_ext.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 195x509_ext.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
240x509_ext.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 196x509_ext.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
241x509_ext.o: ../../include/openssl/opensslconf.h 197x509_ext.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
242x509_ext.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 198x509_ext.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
243x509_ext.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 199x509_ext.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
244x509_ext.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 200x509_ext.o: ../../include/openssl/x509v3.h ../cryptlib.h x509_ext.c
245x509_ext.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 201x509_lu.o: ../../e_os.h ../../include/openssl/asn1.h
246x509_ext.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 202x509_lu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
247x509_ext.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 203x509_lu.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
248x509_ext.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 204x509_lu.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
249x509_ext.o: ../cryptlib.h 205x509_lu.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
250x509_lu.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
251x509_lu.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
252x509_lu.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
253x509_lu.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
254x509_lu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
255x509_lu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
256x509_lu.o: ../../include/openssl/err.h ../../include/openssl/evp.h 206x509_lu.o: ../../include/openssl/err.h ../../include/openssl/evp.h
257x509_lu.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 207x509_lu.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
258x509_lu.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 208x509_lu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
259x509_lu.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 209x509_lu.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
260x509_lu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 210x509_lu.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
261x509_lu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
262x509_lu.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
263x509_lu.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
264x509_lu.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
265x509_lu.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 211x509_lu.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
266x509_lu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 212x509_lu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
267x509_lu.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 213x509_lu.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
268x509_lu.o: ../cryptlib.h 214x509_lu.o: ../../include/openssl/x509v3.h ../cryptlib.h x509_lu.c
269x509_obj.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 215x509_obj.o: ../../e_os.h ../../include/openssl/asn1.h
270x509_obj.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 216x509_obj.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
271x509_obj.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 217x509_obj.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
272x509_obj.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
273x509_obj.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 218x509_obj.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
274x509_obj.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 219x509_obj.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
275x509_obj.o: ../../include/openssl/err.h ../../include/openssl/evp.h 220x509_obj.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
276x509_obj.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
277x509_obj.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
278x509_obj.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
279x509_obj.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 221x509_obj.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
280x509_obj.o: ../../include/openssl/opensslconf.h 222x509_obj.o: ../../include/openssl/opensslconf.h
281x509_obj.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 223x509_obj.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
282x509_obj.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 224x509_obj.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
283x509_obj.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 225x509_obj.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
284x509_obj.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 226x509_obj.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
285x509_obj.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 227x509_obj.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
286x509_obj.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 228x509_obj.o: ../cryptlib.h x509_obj.c
287x509_obj.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 229x509_r2x.o: ../../e_os.h ../../include/openssl/asn1.h
288x509_r2x.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 230x509_r2x.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
289x509_r2x.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 231x509_r2x.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
290x509_r2x.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
291x509_r2x.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
292x509_r2x.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 232x509_r2x.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
293x509_r2x.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 233x509_r2x.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
294x509_r2x.o: ../../include/openssl/err.h ../../include/openssl/evp.h 234x509_r2x.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
295x509_r2x.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
296x509_r2x.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
297x509_r2x.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
298x509_r2x.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 235x509_r2x.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
299x509_r2x.o: ../../include/openssl/opensslconf.h 236x509_r2x.o: ../../include/openssl/opensslconf.h
300x509_r2x.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 237x509_r2x.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
301x509_r2x.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 238x509_r2x.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
302x509_r2x.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 239x509_r2x.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
303x509_r2x.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 240x509_r2x.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
304x509_r2x.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 241x509_r2x.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
305x509_r2x.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 242x509_r2x.o: ../cryptlib.h x509_r2x.c
306x509_r2x.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 243x509_req.o: ../../e_os.h ../../include/openssl/asn1.h
307x509_req.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 244x509_req.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
308x509_req.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 245x509_req.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
309x509_req.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
310x509_req.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
311x509_req.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 246x509_req.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
312x509_req.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 247x509_req.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
313x509_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h 248x509_req.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
314x509_req.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
315x509_req.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
316x509_req.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
317x509_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 249x509_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
318x509_req.o: ../../include/openssl/opensslconf.h 250x509_req.o: ../../include/openssl/opensslconf.h
319x509_req.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h 251x509_req.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
320x509_req.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h 252x509_req.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
321x509_req.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 253x509_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
322x509_req.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 254x509_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
323x509_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 255x509_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
324x509_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 256x509_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
325x509_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 257x509_req.o: ../cryptlib.h x509_req.c
326x509_req.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 258x509_set.o: ../../e_os.h ../../include/openssl/asn1.h
327x509_set.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 259x509_set.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
328x509_set.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 260x509_set.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
329x509_set.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
330x509_set.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
331x509_set.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 261x509_set.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
332x509_set.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 262x509_set.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
333x509_set.o: ../../include/openssl/err.h ../../include/openssl/evp.h 263x509_set.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
334x509_set.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
335x509_set.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
336x509_set.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
337x509_set.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 264x509_set.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
338x509_set.o: ../../include/openssl/opensslconf.h 265x509_set.o: ../../include/openssl/opensslconf.h
339x509_set.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 266x509_set.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
340x509_set.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 267x509_set.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
341x509_set.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 268x509_set.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
342x509_set.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 269x509_set.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
343x509_set.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 270x509_set.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
344x509_set.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 271x509_set.o: ../cryptlib.h x509_set.c
345x509_set.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 272x509_trs.o: ../../e_os.h ../../include/openssl/asn1.h
346x509_trs.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 273x509_trs.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
347x509_trs.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 274x509_trs.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
348x509_trs.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 275x509_trs.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
349x509_trs.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 276x509_trs.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
350x509_trs.o: ../../include/openssl/des.h ../../include/openssl/dh.h
351x509_trs.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
352x509_trs.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
353x509_trs.o: ../../include/openssl/err.h ../../include/openssl/evp.h 277x509_trs.o: ../../include/openssl/err.h ../../include/openssl/evp.h
354x509_trs.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 278x509_trs.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
355x509_trs.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 279x509_trs.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
356x509_trs.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 280x509_trs.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
357x509_trs.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 281x509_trs.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
358x509_trs.o: ../../include/openssl/opensslconf.h 282x509_trs.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
359x509_trs.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 283x509_trs.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
360x509_trs.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 284x509_trs.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
361x509_trs.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 285x509_trs.o: ../../include/openssl/x509v3.h ../cryptlib.h x509_trs.c
362x509_trs.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 286x509_txt.o: ../../e_os.h ../../include/openssl/asn1.h
363x509_trs.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 287x509_txt.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
364x509_trs.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 288x509_txt.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
365x509_trs.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
366x509_trs.o: ../cryptlib.h
367x509_txt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
368x509_txt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
369x509_txt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
370x509_txt.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
371x509_txt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 289x509_txt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
372x509_txt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 290x509_txt.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
373x509_txt.o: ../../include/openssl/err.h ../../include/openssl/evp.h 291x509_txt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
374x509_txt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
375x509_txt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
376x509_txt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
377x509_txt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 292x509_txt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
378x509_txt.o: ../../include/openssl/opensslconf.h 293x509_txt.o: ../../include/openssl/opensslconf.h
379x509_txt.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 294x509_txt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
380x509_txt.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 295x509_txt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
381x509_txt.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 296x509_txt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
382x509_txt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 297x509_txt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
383x509_txt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 298x509_txt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
384x509_txt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 299x509_txt.o: ../cryptlib.h x509_txt.c
385x509_txt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 300x509_v3.o: ../../e_os.h ../../include/openssl/asn1.h
386x509_v3.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 301x509_v3.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
387x509_v3.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 302x509_v3.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
388x509_v3.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 303x509_v3.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
389x509_v3.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 304x509_v3.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
390x509_v3.o: ../../include/openssl/des.h ../../include/openssl/dh.h
391x509_v3.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
392x509_v3.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
393x509_v3.o: ../../include/openssl/err.h ../../include/openssl/evp.h 305x509_v3.o: ../../include/openssl/err.h ../../include/openssl/evp.h
394x509_v3.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 306x509_v3.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
395x509_v3.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 307x509_v3.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
396x509_v3.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 308x509_v3.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
397x509_v3.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 309x509_v3.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
398x509_v3.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
399x509_v3.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
400x509_v3.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
401x509_v3.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
402x509_v3.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 310x509_v3.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
403x509_v3.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 311x509_v3.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
404x509_v3.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 312x509_v3.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
405x509_v3.o: ../../include/openssl/x509v3.h ../cryptlib.h 313x509_v3.o: ../../include/openssl/x509v3.h ../cryptlib.h x509_v3.c
406x509_vfy.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 314x509_vfy.o: ../../e_os.h ../../include/openssl/asn1.h
407x509_vfy.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 315x509_vfy.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
408x509_vfy.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 316x509_vfy.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
409x509_vfy.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 317x509_vfy.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
410x509_vfy.o: ../../include/openssl/des.h ../../include/openssl/dh.h 318x509_vfy.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
411x509_vfy.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
412x509_vfy.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
413x509_vfy.o: ../../include/openssl/err.h ../../include/openssl/evp.h 319x509_vfy.o: ../../include/openssl/err.h ../../include/openssl/evp.h
414x509_vfy.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 320x509_vfy.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
415x509_vfy.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 321x509_vfy.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
416x509_vfy.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 322x509_vfy.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
417x509_vfy.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 323x509_vfy.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
418x509_vfy.o: ../../include/openssl/opensslconf.h 324x509_vfy.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
419x509_vfy.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 325x509_vfy.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
420x509_vfy.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 326x509_vfy.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
421x509_vfy.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 327x509_vfy.o: ../../include/openssl/x509v3.h ../cryptlib.h x509_vfy.c
422x509_vfy.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 328x509cset.o: ../../e_os.h ../../include/openssl/asn1.h
423x509_vfy.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 329x509cset.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
424x509_vfy.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 330x509cset.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
425x509_vfy.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 331x509cset.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
426x509_vfy.o: ../cryptlib.h 332x509cset.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
427x509name.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 333x509cset.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
428x509name.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 334x509cset.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
429x509name.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 335x509cset.o: ../../include/openssl/opensslconf.h
430x509name.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 336x509cset.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
337x509cset.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
338x509cset.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
339x509cset.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
340x509cset.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
341x509cset.o: ../cryptlib.h x509cset.c
342x509name.o: ../../e_os.h ../../include/openssl/asn1.h
343x509name.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
344x509name.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
431x509name.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 345x509name.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
432x509name.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 346x509name.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
433x509name.o: ../../include/openssl/err.h ../../include/openssl/evp.h 347x509name.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
434x509name.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
435x509name.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
436x509name.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
437x509name.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 348x509name.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
438x509name.o: ../../include/openssl/opensslconf.h 349x509name.o: ../../include/openssl/opensslconf.h
439x509name.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 350x509name.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
440x509name.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 351x509name.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
441x509name.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 352x509name.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
442x509name.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 353x509name.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
443x509name.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 354x509name.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
444x509name.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 355x509name.o: ../cryptlib.h x509name.c
445x509name.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 356x509rset.o: ../../e_os.h ../../include/openssl/asn1.h
446x509rset.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 357x509rset.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
447x509rset.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 358x509rset.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
448x509rset.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
449x509rset.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
450x509rset.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 359x509rset.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
451x509rset.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 360x509rset.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
452x509rset.o: ../../include/openssl/err.h ../../include/openssl/evp.h 361x509rset.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
453x509rset.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
454x509rset.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
455x509rset.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
456x509rset.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 362x509rset.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
457x509rset.o: ../../include/openssl/opensslconf.h 363x509rset.o: ../../include/openssl/opensslconf.h
458x509rset.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 364x509rset.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
459x509rset.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 365x509rset.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
460x509rset.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 366x509rset.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
461x509rset.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 367x509rset.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
462x509rset.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 368x509rset.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
463x509rset.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 369x509rset.o: ../cryptlib.h x509rset.c
464x509rset.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 370x509spki.o: ../../e_os.h ../../include/openssl/asn1.h
465x509spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 371x509spki.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
466x509spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 372x509spki.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
467x509spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 373x509spki.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
468x509spki.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
469x509spki.o: ../../include/openssl/des.h ../../include/openssl/dh.h
470x509spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
471x509spki.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 374x509spki.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
472x509spki.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 375x509spki.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
473x509spki.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 376x509spki.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
474x509spki.o: ../../include/openssl/md4.h ../../include/openssl/md5.h 377x509spki.o: ../../include/openssl/opensslconf.h
475x509spki.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h 378x509spki.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
476x509spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 379x509spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
477x509spki.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 380x509spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
478x509spki.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 381x509spki.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
479x509spki.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 382x509spki.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
480x509spki.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 383x509spki.o: ../cryptlib.h x509spki.c
481x509spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 384x509type.o: ../../e_os.h ../../include/openssl/asn1.h
482x509spki.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 385x509type.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
483x509spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 386x509type.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
484x509type.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
485x509type.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
486x509type.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
487x509type.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
488x509type.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 387x509type.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
489x509type.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 388x509type.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
490x509type.o: ../../include/openssl/err.h ../../include/openssl/evp.h 389x509type.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
491x509type.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
492x509type.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
493x509type.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
494x509type.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 390x509type.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
495x509type.o: ../../include/openssl/opensslconf.h 391x509type.o: ../../include/openssl/opensslconf.h
496x509type.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 392x509type.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
497x509type.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 393x509type.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
498x509type.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 394x509type.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
499x509type.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 395x509type.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
500x509type.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 396x509type.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
501x509type.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 397x509type.o: ../cryptlib.h x509type.c
502x509type.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 398x_all.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
503x_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 399x_all.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
504x_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 400x_all.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
505x_all.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 401x_all.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
506x_all.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
507x_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
508x_all.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
509x_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h 402x_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h
510x_all.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 403x_all.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
511x_all.o: ../../include/openssl/md2.h ../../include/openssl/md4.h 404x_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
512x_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 405x_all.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
513x_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 406x_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
514x_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
515x_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
516x_all.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
517x_all.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
518x_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 407x_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
519x_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 408x_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
520x_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 409x_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
521x_all.o: ../cryptlib.h 410x_all.o: ../cryptlib.h x_all.c
diff --git a/src/lib/libcrypto/x509/by_file.c b/src/lib/libcrypto/x509/by_file.c
index 78e9240a8d..92e00d2d73 100644
--- a/src/lib/libcrypto/x509/by_file.c
+++ b/src/lib/libcrypto/x509/by_file.c
@@ -66,7 +66,7 @@
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67#include <openssl/pem.h> 67#include <openssl/pem.h>
68 68
69#ifndef NO_STDIO 69#ifndef OPENSSL_NO_STDIO
70 70
71static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, 71static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
72 long argl, char **ret); 72 long argl, char **ret);
@@ -294,5 +294,5 @@ int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type)
294} 294}
295 295
296 296
297#endif /* NO_STDIO */ 297#endif /* OPENSSL_NO_STDIO */
298 298
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index 813c8adffd..c75aa0c717 100644
--- a/src/lib/libcrypto/x509/x509.h
+++ b/src/lib/libcrypto/x509/x509.h
@@ -60,47 +60,46 @@
60#define HEADER_X509_H 60#define HEADER_X509_H
61 61
62#include <openssl/symhacks.h> 62#include <openssl/symhacks.h>
63#ifndef NO_BUFFER 63#ifndef OPENSSL_NO_BUFFER
64#include <openssl/buffer.h> 64#include <openssl/buffer.h>
65#endif 65#endif
66#ifndef NO_EVP 66#ifndef OPENSSL_NO_EVP
67#include <openssl/evp.h> 67#include <openssl/evp.h>
68#endif 68#endif
69#ifndef NO_BIO 69#ifndef OPENSSL_NO_BIO
70#include <openssl/bio.h> 70#include <openssl/bio.h>
71#endif 71#endif
72#include <openssl/stack.h> 72#include <openssl/stack.h>
73#include <openssl/asn1.h> 73#include <openssl/asn1.h>
74#include <openssl/safestack.h> 74#include <openssl/safestack.h>
75 75
76#ifndef NO_RSA 76#ifndef OPENSSL_NO_RSA
77#include <openssl/rsa.h> 77#include <openssl/rsa.h>
78#endif 78#endif
79 79
80#ifndef NO_DSA 80#ifndef OPENSSL_NO_DSA
81#include <openssl/dsa.h> 81#include <openssl/dsa.h>
82#endif 82#endif
83 83
84#ifndef NO_DH 84#ifndef OPENSSL_NO_DH
85#include <openssl/dh.h> 85#include <openssl/dh.h>
86#endif 86#endif
87 87#ifndef OPENSSL_NO_SHA
88#include <openssl/sha.h>
89#endif
88#include <openssl/evp.h> 90#include <openssl/evp.h>
89 91#include <openssl/e_os2.h>
92#include <openssl/ossl_typ.h>
90 93
91#ifdef __cplusplus 94#ifdef __cplusplus
92extern "C" { 95extern "C" {
93#endif 96#endif
94 97
95#ifdef WIN32 98#ifdef OPENSSL_SYS_WIN32
96/* Under Win32 this is defined in wincrypt.h */ 99/* Under Win32 this is defined in wincrypt.h */
97#undef X509_NAME 100#undef X509_NAME
98#endif 101#endif
99 102
100 /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */
101#define DECLARE_PKCS12_STACK_OF(type) /* Nothing */
102#define IMPLEMENT_PKCS12_STACK_OF(type) /* Nothing */
103
104#define X509_FILETYPE_PEM 1 103#define X509_FILETYPE_PEM 1
105#define X509_FILETYPE_ASN1 2 104#define X509_FILETYPE_ASN1 2
106#define X509_FILETYPE_DEFAULT 3 105#define X509_FILETYPE_DEFAULT 3
@@ -123,11 +122,11 @@ typedef struct X509_objects_st
123 int (*i2a)(); 122 int (*i2a)();
124 } X509_OBJECTS; 123 } X509_OBJECTS;
125 124
126typedef struct X509_algor_st 125struct X509_algor_st
127 { 126 {
128 ASN1_OBJECT *algorithm; 127 ASN1_OBJECT *algorithm;
129 ASN1_TYPE *parameter; 128 ASN1_TYPE *parameter;
130 } X509_ALGOR; 129 } /* X509_ALGOR */;
131 130
132DECLARE_STACK_OF(X509_ALGOR) 131DECLARE_STACK_OF(X509_ALGOR)
133DECLARE_ASN1_SET_OF(X509_ALGOR) 132DECLARE_ASN1_SET_OF(X509_ALGOR)
@@ -163,17 +162,17 @@ DECLARE_STACK_OF(X509_NAME_ENTRY)
163DECLARE_ASN1_SET_OF(X509_NAME_ENTRY) 162DECLARE_ASN1_SET_OF(X509_NAME_ENTRY)
164 163
165/* we always keep X509_NAMEs in 2 forms. */ 164/* we always keep X509_NAMEs in 2 forms. */
166typedef struct X509_name_st 165struct X509_name_st
167 { 166 {
168 STACK_OF(X509_NAME_ENTRY) *entries; 167 STACK_OF(X509_NAME_ENTRY) *entries;
169 int modified; /* true if 'bytes' needs to be built */ 168 int modified; /* true if 'bytes' needs to be built */
170#ifndef NO_BUFFER 169#ifndef OPENSSL_NO_BUFFER
171 BUF_MEM *bytes; 170 BUF_MEM *bytes;
172#else 171#else
173 char *bytes; 172 char *bytes;
174#endif 173#endif
175 unsigned long hash; /* Keep the hash around for lookups */ 174 unsigned long hash; /* Keep the hash around for lookups */
176 } X509_NAME; 175 } /* X509_NAME */;
177 176
178DECLARE_STACK_OF(X509_NAME) 177DECLARE_STACK_OF(X509_NAME)
179 178
@@ -182,11 +181,8 @@ DECLARE_STACK_OF(X509_NAME)
182typedef struct X509_extension_st 181typedef struct X509_extension_st
183 { 182 {
184 ASN1_OBJECT *object; 183 ASN1_OBJECT *object;
185 short critical; 184 ASN1_BOOLEAN critical;
186 short netscape_hack;
187 ASN1_OCTET_STRING *value; 185 ASN1_OCTET_STRING *value;
188 struct v3_ext_method *method; /* V3 method to use */
189 void *ext_val; /* extension value */
190 } X509_EXTENSION; 186 } X509_EXTENSION;
191 187
192DECLARE_STACK_OF(X509_EXTENSION) 188DECLARE_STACK_OF(X509_EXTENSION)
@@ -196,27 +192,26 @@ DECLARE_ASN1_SET_OF(X509_EXTENSION)
196typedef struct x509_attributes_st 192typedef struct x509_attributes_st
197 { 193 {
198 ASN1_OBJECT *object; 194 ASN1_OBJECT *object;
199 int set; /* 1 for a set, 0 for a single item (which is wrong) */ 195 int single; /* 0 for a set, 1 for a single item (which is wrong) */
200 union { 196 union {
201 char *ptr; 197 char *ptr;
202/* 1 */ STACK_OF(ASN1_TYPE) *set; 198/* 0 */ STACK_OF(ASN1_TYPE) *set;
203/* 0 */ ASN1_TYPE *single; 199/* 1 */ ASN1_TYPE *single;
204 } value; 200 } value;
205 } X509_ATTRIBUTE; 201 } X509_ATTRIBUTE;
206 202
207DECLARE_STACK_OF(X509_ATTRIBUTE) 203DECLARE_STACK_OF(X509_ATTRIBUTE)
208DECLARE_ASN1_SET_OF(X509_ATTRIBUTE) 204DECLARE_ASN1_SET_OF(X509_ATTRIBUTE)
209 205
206
210typedef struct X509_req_info_st 207typedef struct X509_req_info_st
211 { 208 {
212 unsigned char *asn1; 209 ASN1_ENCODING enc;
213 int length;
214 ASN1_INTEGER *version; 210 ASN1_INTEGER *version;
215 X509_NAME *subject; 211 X509_NAME *subject;
216 X509_PUBKEY *pubkey; 212 X509_PUBKEY *pubkey;
217 /* d=2 hl=2 l= 0 cons: cont: 00 */ 213 /* d=2 hl=2 l= 0 cons: cont: 00 */
218 STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ 214 STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
219 int req_kludge;
220 } X509_REQ_INFO; 215 } X509_REQ_INFO;
221 216
222typedef struct X509_req_st 217typedef struct X509_req_st
@@ -256,7 +251,7 @@ typedef struct x509_cert_aux_st
256 STACK_OF(X509_ALGOR) *other; /* other unspecified info */ 251 STACK_OF(X509_ALGOR) *other; /* other unspecified info */
257 } X509_CERT_AUX; 252 } X509_CERT_AUX;
258 253
259typedef struct x509_st 254struct x509_st
260 { 255 {
261 X509_CINF *cert_info; 256 X509_CINF *cert_info;
262 X509_ALGOR *sig_alg; 257 X509_ALGOR *sig_alg;
@@ -273,11 +268,11 @@ typedef struct x509_st
273 unsigned long ex_nscert; 268 unsigned long ex_nscert;
274 ASN1_OCTET_STRING *skid; 269 ASN1_OCTET_STRING *skid;
275 struct AUTHORITY_KEYID_st *akid; 270 struct AUTHORITY_KEYID_st *akid;
276#ifndef NO_SHA 271#ifndef OPENSSL_NO_SHA
277 unsigned char sha1_hash[SHA_DIGEST_LENGTH]; 272 unsigned char sha1_hash[SHA_DIGEST_LENGTH];
278#endif 273#endif
279 X509_CERT_AUX *aux; 274 X509_CERT_AUX *aux;
280 } X509; 275 } /* X509 */;
281 276
282DECLARE_STACK_OF(X509) 277DECLARE_STACK_OF(X509)
283DECLARE_ASN1_SET_OF(X509) 278DECLARE_ASN1_SET_OF(X509)
@@ -304,10 +299,12 @@ DECLARE_STACK_OF(X509_TRUST)
304#define X509_TRUST_SSL_SERVER 3 299#define X509_TRUST_SSL_SERVER 3
305#define X509_TRUST_EMAIL 4 300#define X509_TRUST_EMAIL 4
306#define X509_TRUST_OBJECT_SIGN 5 301#define X509_TRUST_OBJECT_SIGN 5
302#define X509_TRUST_OCSP_SIGN 6
303#define X509_TRUST_OCSP_REQUEST 7
307 304
308/* Keep these up to date! */ 305/* Keep these up to date! */
309#define X509_TRUST_MIN 1 306#define X509_TRUST_MIN 1
310#define X509_TRUST_MAX 5 307#define X509_TRUST_MAX 7
311 308
312 309
313/* trust_flags values */ 310/* trust_flags values */
@@ -320,6 +317,21 @@ DECLARE_STACK_OF(X509_TRUST)
320#define X509_TRUST_REJECTED 2 317#define X509_TRUST_REJECTED 2
321#define X509_TRUST_UNTRUSTED 3 318#define X509_TRUST_UNTRUSTED 3
322 319
320/* Flags for X509_print_ex() */
321
322#define X509_FLAG_COMPAT 0
323#define X509_FLAG_NO_HEADER 1L
324#define X509_FLAG_NO_VERSION (1L << 1)
325#define X509_FLAG_NO_SERIAL (1L << 2)
326#define X509_FLAG_NO_SIGNAME (1L << 3)
327#define X509_FLAG_NO_ISSUER (1L << 4)
328#define X509_FLAG_NO_VALIDITY (1L << 5)
329#define X509_FLAG_NO_SUBJECT (1L << 6)
330#define X509_FLAG_NO_PUBKEY (1L << 7)
331#define X509_FLAG_NO_EXTENSIONS (1L << 8)
332#define X509_FLAG_NO_SIGDUMP (1L << 9)
333#define X509_FLAG_NO_AUX (1L << 10)
334
323/* Flags specific to X509_NAME_print_ex() */ 335/* Flags specific to X509_NAME_print_ex() */
324 336
325/* The field separator information */ 337/* The field separator information */
@@ -351,6 +363,8 @@ DECLARE_STACK_OF(X509_TRUST)
351 363
352#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24) 364#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
353 365
366#define XN_FLAG_FN_ALIGN (1 << 25) /* Align field names to 20 characters */
367
354/* Complete set of RFC2253 flags */ 368/* Complete set of RFC2253 flags */
355 369
356#define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \ 370#define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \
@@ -373,7 +387,8 @@ DECLARE_STACK_OF(X509_TRUST)
373 ASN1_STRFLGS_ESC_MSB | \ 387 ASN1_STRFLGS_ESC_MSB | \
374 XN_FLAG_SEP_MULTILINE | \ 388 XN_FLAG_SEP_MULTILINE | \
375 XN_FLAG_SPC_EQ | \ 389 XN_FLAG_SPC_EQ | \
376 XN_FLAG_FN_LN) 390 XN_FLAG_FN_LN | \
391 XN_FLAG_FN_ALIGN)
377 392
378typedef struct X509_revoked_st 393typedef struct X509_revoked_st
379 { 394 {
@@ -397,14 +412,14 @@ typedef struct X509_crl_info_st
397 STACK_OF(X509_EXTENSION) /* [0] */ *extensions; 412 STACK_OF(X509_EXTENSION) /* [0] */ *extensions;
398 } X509_CRL_INFO; 413 } X509_CRL_INFO;
399 414
400typedef struct X509_crl_st 415struct X509_crl_st
401 { 416 {
402 /* actual signature */ 417 /* actual signature */
403 X509_CRL_INFO *crl; 418 X509_CRL_INFO *crl;
404 X509_ALGOR *sig_alg; 419 X509_ALGOR *sig_alg;
405 ASN1_BIT_STRING *signature; 420 ASN1_BIT_STRING *signature;
406 int references; 421 int references;
407 } X509_CRL; 422 } /* X509_CRL */;
408 423
409DECLARE_STACK_OF(X509_CRL) 424DECLARE_STACK_OF(X509_CRL)
410DECLARE_ASN1_SET_OF(X509_CRL) 425DECLARE_ASN1_SET_OF(X509_CRL)
@@ -430,7 +445,7 @@ typedef struct private_key_st
430 int references; 445 int references;
431 } X509_PKEY; 446 } X509_PKEY;
432 447
433#ifndef NO_EVP 448#ifndef OPENSSL_NO_EVP
434typedef struct X509_info_st 449typedef struct X509_info_st
435 { 450 {
436 X509 *x509; 451 X509 *x509;
@@ -686,7 +701,7 @@ extern "C" {
686const char *X509_verify_cert_error_string(long n); 701const char *X509_verify_cert_error_string(long n);
687 702
688#ifndef SSLEAY_MACROS 703#ifndef SSLEAY_MACROS
689#ifndef NO_EVP 704#ifndef OPENSSL_NO_EVP
690int X509_verify(X509 *a, EVP_PKEY *r); 705int X509_verify(X509 *a, EVP_PKEY *r);
691 706
692int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); 707int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
@@ -700,11 +715,15 @@ int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);
700 715
701int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); 716int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki);
702 717
718int X509_signature_print(BIO *bp,X509_ALGOR *alg, ASN1_STRING *sig);
719
703int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); 720int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
704int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); 721int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
705int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); 722int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
706int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); 723int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);
707 724
725int X509_pubkey_digest(const X509 *data,const EVP_MD *type,
726 unsigned char *md, unsigned int *len);
708int X509_digest(const X509 *data,const EVP_MD *type, 727int X509_digest(const X509 *data,const EVP_MD *type,
709 unsigned char *md, unsigned int *len); 728 unsigned char *md, unsigned int *len);
710int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type, 729int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type,
@@ -715,14 +734,14 @@ int X509_NAME_digest(const X509_NAME *data,const EVP_MD *type,
715 unsigned char *md, unsigned int *len); 734 unsigned char *md, unsigned int *len);
716#endif 735#endif
717 736
718#ifndef NO_FP_API 737#ifndef OPENSSL_NO_FP_API
719X509 *d2i_X509_fp(FILE *fp, X509 **x509); 738X509 *d2i_X509_fp(FILE *fp, X509 **x509);
720int i2d_X509_fp(FILE *fp,X509 *x509); 739int i2d_X509_fp(FILE *fp,X509 *x509);
721X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl); 740X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl);
722int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl); 741int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl);
723X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req); 742X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req);
724int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req); 743int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req);
725#ifndef NO_RSA 744#ifndef OPENSSL_NO_RSA
726RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa); 745RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa);
727int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa); 746int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa);
728RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa); 747RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa);
@@ -730,7 +749,7 @@ int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa);
730RSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa); 749RSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa);
731int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa); 750int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa);
732#endif 751#endif
733#ifndef NO_DSA 752#ifndef OPENSSL_NO_DSA
734DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); 753DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa);
735int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); 754int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa);
736DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); 755DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa);
@@ -748,14 +767,14 @@ int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey);
748EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); 767EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a);
749#endif 768#endif
750 769
751#ifndef NO_BIO 770#ifndef OPENSSL_NO_BIO
752X509 *d2i_X509_bio(BIO *bp,X509 **x509); 771X509 *d2i_X509_bio(BIO *bp,X509 **x509);
753int i2d_X509_bio(BIO *bp,X509 *x509); 772int i2d_X509_bio(BIO *bp,X509 *x509);
754X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl); 773X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl);
755int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl); 774int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl);
756X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req); 775X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req);
757int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req); 776int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req);
758#ifndef NO_RSA 777#ifndef OPENSSL_NO_RSA
759RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa); 778RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa);
760int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa); 779int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa);
761RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa); 780RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa);
@@ -763,7 +782,7 @@ int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa);
763RSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa); 782RSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa);
764int i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa); 783int i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa);
765#endif 784#endif
766#ifndef NO_DSA 785#ifndef OPENSSL_NO_DSA
767DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa); 786DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa);
768int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa); 787int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa);
769DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); 788DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa);
@@ -789,7 +808,7 @@ X509_REQ *X509_REQ_dup(X509_REQ *req);
789X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); 808X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn);
790X509_NAME *X509_NAME_dup(X509_NAME *xn); 809X509_NAME *X509_NAME_dup(X509_NAME *xn);
791X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); 810X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);
792#ifndef NO_RSA 811#ifndef OPENSSL_NO_RSA
793RSA *RSAPublicKey_dup(RSA *rsa); 812RSA *RSAPublicKey_dup(RSA *rsa);
794RSA *RSAPrivateKey_dup(RSA *rsa); 813RSA *RSAPrivateKey_dup(RSA *rsa);
795#endif 814#endif
@@ -810,25 +829,12 @@ const char * X509_get_default_private_dir(void );
810 829
811X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); 830X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
812X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey); 831X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey);
813void ERR_load_X509_strings(void );
814 832
815X509_ALGOR * X509_ALGOR_new(void ); 833DECLARE_ASN1_FUNCTIONS(X509_ALGOR)
816void X509_ALGOR_free(X509_ALGOR *a); 834DECLARE_ASN1_FUNCTIONS(X509_VAL)
817int i2d_X509_ALGOR(X509_ALGOR *a,unsigned char **pp);
818X509_ALGOR * d2i_X509_ALGOR(X509_ALGOR **a,unsigned char **pp,
819 long length);
820 835
821X509_VAL * X509_VAL_new(void ); 836DECLARE_ASN1_FUNCTIONS(X509_PUBKEY)
822void X509_VAL_free(X509_VAL *a);
823int i2d_X509_VAL(X509_VAL *a,unsigned char **pp);
824X509_VAL * d2i_X509_VAL(X509_VAL **a,unsigned char **pp,
825 long length);
826 837
827X509_PUBKEY * X509_PUBKEY_new(void );
828void X509_PUBKEY_free(X509_PUBKEY *a);
829int i2d_X509_PUBKEY(X509_PUBKEY *a,unsigned char **pp);
830X509_PUBKEY * d2i_X509_PUBKEY(X509_PUBKEY **a,unsigned char **pp,
831 long length);
832int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); 838int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
833EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); 839EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key);
834int X509_get_pubkey_parameters(EVP_PKEY *pkey, 840int X509_get_pubkey_parameters(EVP_PKEY *pkey,
@@ -836,69 +842,37 @@ int X509_get_pubkey_parameters(EVP_PKEY *pkey,
836int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp); 842int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp);
837EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,unsigned char **pp, 843EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,unsigned char **pp,
838 long length); 844 long length);
839#ifndef NO_RSA 845#ifndef OPENSSL_NO_RSA
840int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp); 846int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp);
841RSA * d2i_RSA_PUBKEY(RSA **a,unsigned char **pp, 847RSA * d2i_RSA_PUBKEY(RSA **a,unsigned char **pp,
842 long length); 848 long length);
843#endif 849#endif
844#ifndef NO_DSA 850#ifndef OPENSSL_NO_DSA
845int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp); 851int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp);
846DSA * d2i_DSA_PUBKEY(DSA **a,unsigned char **pp, 852DSA * d2i_DSA_PUBKEY(DSA **a,unsigned char **pp,
847 long length); 853 long length);
848#endif 854#endif
849 855
850X509_SIG * X509_SIG_new(void ); 856DECLARE_ASN1_FUNCTIONS(X509_SIG)
851void X509_SIG_free(X509_SIG *a); 857DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO)
852int i2d_X509_SIG(X509_SIG *a,unsigned char **pp); 858DECLARE_ASN1_FUNCTIONS(X509_REQ)
853X509_SIG * d2i_X509_SIG(X509_SIG **a,unsigned char **pp,long length);
854
855X509_REQ_INFO *X509_REQ_INFO_new(void);
856void X509_REQ_INFO_free(X509_REQ_INFO *a);
857int i2d_X509_REQ_INFO(X509_REQ_INFO *a,unsigned char **pp);
858X509_REQ_INFO *d2i_X509_REQ_INFO(X509_REQ_INFO **a,unsigned char **pp,
859 long length);
860 859
861X509_REQ * X509_REQ_new(void); 860DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE)
862void X509_REQ_free(X509_REQ *a);
863int i2d_X509_REQ(X509_REQ *a,unsigned char **pp);
864X509_REQ * d2i_X509_REQ(X509_REQ **a,unsigned char **pp,long length);
865
866X509_ATTRIBUTE *X509_ATTRIBUTE_new(void );
867void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a);
868int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a,unsigned char **pp);
869X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a,unsigned char **pp,
870 long length);
871X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); 861X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value);
872 862
863DECLARE_ASN1_FUNCTIONS(X509_EXTENSION)
873 864
874X509_EXTENSION *X509_EXTENSION_new(void ); 865DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY)
875void X509_EXTENSION_free(X509_EXTENSION *a);
876int i2d_X509_EXTENSION(X509_EXTENSION *a,unsigned char **pp);
877X509_EXTENSION *d2i_X509_EXTENSION(X509_EXTENSION **a,unsigned char **pp,
878 long length);
879 866
880X509_NAME_ENTRY *X509_NAME_ENTRY_new(void); 867DECLARE_ASN1_FUNCTIONS(X509_NAME)
881void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a);
882int i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a,unsigned char **pp);
883X509_NAME_ENTRY *d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a,unsigned char **pp,
884 long length);
885 868
886X509_NAME * X509_NAME_new(void);
887void X509_NAME_free(X509_NAME *a);
888int i2d_X509_NAME(X509_NAME *a,unsigned char **pp);
889X509_NAME * d2i_X509_NAME(X509_NAME **a,unsigned char **pp,long length);
890int X509_NAME_set(X509_NAME **xn, X509_NAME *name); 869int X509_NAME_set(X509_NAME **xn, X509_NAME *name);
891 870
871DECLARE_ASN1_FUNCTIONS(X509_CINF)
892 872
893X509_CINF * X509_CINF_new(void); 873DECLARE_ASN1_FUNCTIONS(X509)
894void X509_CINF_free(X509_CINF *a); 874DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)
895int i2d_X509_CINF(X509_CINF *a,unsigned char **pp);
896X509_CINF * d2i_X509_CINF(X509_CINF **a,unsigned char **pp,long length);
897 875
898X509 * X509_new(void);
899void X509_free(X509 *a);
900int i2d_X509(X509 *a,unsigned char **pp);
901X509 * d2i_X509(X509 **a,unsigned char **pp,long length);
902int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 876int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
903 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 877 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
904int X509_set_ex_data(X509 *r, int idx, void *arg); 878int X509_set_ex_data(X509 *r, int idx, void *arg);
@@ -906,60 +880,32 @@ void *X509_get_ex_data(X509 *r, int idx);
906int i2d_X509_AUX(X509 *a,unsigned char **pp); 880int i2d_X509_AUX(X509 *a,unsigned char **pp);
907X509 * d2i_X509_AUX(X509 **a,unsigned char **pp,long length); 881X509 * d2i_X509_AUX(X509 **a,unsigned char **pp,long length);
908 882
909X509_CERT_AUX * X509_CERT_AUX_new(void);
910void X509_CERT_AUX_free(X509_CERT_AUX *a);
911int i2d_X509_CERT_AUX(X509_CERT_AUX *a,unsigned char **pp);
912X509_CERT_AUX * d2i_X509_CERT_AUX(X509_CERT_AUX **a,unsigned char **pp,
913 long length);
914int X509_alias_set1(X509 *x, unsigned char *name, int len); 883int X509_alias_set1(X509 *x, unsigned char *name, int len);
915int X509_keyid_set1(X509 *x, unsigned char *id, int len); 884int X509_keyid_set1(X509 *x, unsigned char *id, int len);
916unsigned char * X509_alias_get0(X509 *x, int *len); 885unsigned char * X509_alias_get0(X509 *x, int *len);
917int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int); 886int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int);
887int X509_TRUST_set(int *t, int trust);
918int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj); 888int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj);
919int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj); 889int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj);
920void X509_trust_clear(X509 *x); 890void X509_trust_clear(X509 *x);
921void X509_reject_clear(X509 *x); 891void X509_reject_clear(X509 *x);
922 892
923X509_REVOKED * X509_REVOKED_new(void); 893DECLARE_ASN1_FUNCTIONS(X509_REVOKED)
924void X509_REVOKED_free(X509_REVOKED *a); 894DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO)
925int i2d_X509_REVOKED(X509_REVOKED *a,unsigned char **pp); 895DECLARE_ASN1_FUNCTIONS(X509_CRL)
926X509_REVOKED * d2i_X509_REVOKED(X509_REVOKED **a,unsigned char **pp,long length);
927 896
928X509_CRL_INFO *X509_CRL_INFO_new(void); 897int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
929void X509_CRL_INFO_free(X509_CRL_INFO *a);
930int i2d_X509_CRL_INFO(X509_CRL_INFO *a,unsigned char **pp);
931X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a,unsigned char **pp,
932 long length);
933
934X509_CRL * X509_CRL_new(void);
935void X509_CRL_free(X509_CRL *a);
936int i2d_X509_CRL(X509_CRL *a,unsigned char **pp);
937X509_CRL * d2i_X509_CRL(X509_CRL **a,unsigned char **pp,long length);
938 898
939X509_PKEY * X509_PKEY_new(void ); 899X509_PKEY * X509_PKEY_new(void );
940void X509_PKEY_free(X509_PKEY *a); 900void X509_PKEY_free(X509_PKEY *a);
941int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp); 901int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp);
942X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,unsigned char **pp,long length); 902X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,unsigned char **pp,long length);
943 903
944NETSCAPE_SPKI * NETSCAPE_SPKI_new(void ); 904DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
945void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a); 905DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
946int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a,unsigned char **pp); 906DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE)
947NETSCAPE_SPKI * d2i_NETSCAPE_SPKI(NETSCAPE_SPKI **a,unsigned char **pp,
948 long length);
949 907
950NETSCAPE_SPKAC *NETSCAPE_SPKAC_new(void ); 908#ifndef OPENSSL_NO_EVP
951void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a);
952int i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a,unsigned char **pp);
953NETSCAPE_SPKAC *d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC **a,unsigned char **pp,
954 long length);
955
956
957int i2d_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE *a, unsigned char **pp);
958NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new(void);
959NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a, unsigned char **pp, long length);
960void NETSCAPE_CERT_SEQUENCE_free(NETSCAPE_CERT_SEQUENCE *a);
961
962#ifndef NO_EVP
963X509_INFO * X509_INFO_new(void); 909X509_INFO * X509_INFO_new(void);
964void X509_INFO_free(X509_INFO *a); 910void X509_INFO_free(X509_INFO *a);
965char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); 911char * X509_NAME_oneline(X509_NAME *a,char *buf,int size);
@@ -973,6 +919,16 @@ int ASN1_digest(int (*i2d)(),const EVP_MD *type,char *data,
973int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, 919int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
974 ASN1_BIT_STRING *signature, 920 ASN1_BIT_STRING *signature,
975 char *data,EVP_PKEY *pkey, const EVP_MD *type); 921 char *data,EVP_PKEY *pkey, const EVP_MD *type);
922
923int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data,
924 unsigned char *md,unsigned int *len);
925
926int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1,
927 ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey);
928
929int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
930 ASN1_BIT_STRING *signature,
931 void *data, EVP_PKEY *pkey, const EVP_MD *type);
976#endif 932#endif
977 933
978int X509_set_version(X509 *x,long version); 934int X509_set_version(X509 *x,long version);
@@ -986,6 +942,7 @@ int X509_set_notBefore(X509 *x, ASN1_TIME *tm);
986int X509_set_notAfter(X509 *x, ASN1_TIME *tm); 942int X509_set_notAfter(X509 *x, ASN1_TIME *tm);
987int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); 943int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
988EVP_PKEY * X509_get_pubkey(X509 *x); 944EVP_PKEY * X509_get_pubkey(X509 *x);
945ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x);
989int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */); 946int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */);
990 947
991int X509_REQ_set_version(X509_REQ *x,long version); 948int X509_REQ_set_version(X509_REQ *x,long version);
@@ -1008,14 +965,23 @@ X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc);
1008X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); 965X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc);
1009int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr); 966int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
1010int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, 967int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
1011 ASN1_OBJECT *obj, int type, 968 const ASN1_OBJECT *obj, int type,
1012 unsigned char *bytes, int len); 969 const unsigned char *bytes, int len);
1013int X509_REQ_add1_attr_by_NID(X509_REQ *req, 970int X509_REQ_add1_attr_by_NID(X509_REQ *req,
1014 int nid, int type, 971 int nid, int type,
1015 unsigned char *bytes, int len); 972 const unsigned char *bytes, int len);
1016int X509_REQ_add1_attr_by_txt(X509_REQ *req, 973int X509_REQ_add1_attr_by_txt(X509_REQ *req,
1017 char *attrname, int type, 974 const char *attrname, int type,
1018 unsigned char *bytes, int len); 975 const unsigned char *bytes, int len);
976
977int X509_CRL_set_version(X509_CRL *x, long version);
978int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
979int X509_CRL_set_lastUpdate(X509_CRL *x, ASN1_TIME *tm);
980int X509_CRL_set_nextUpdate(X509_CRL *x, ASN1_TIME *tm);
981int X509_CRL_sort(X509_CRL *crl);
982
983int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);
984int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm);
1019 985
1020int X509_check_private_key(X509 *x509,EVP_PKEY *pkey); 986int X509_check_private_key(X509 *x509,EVP_PKEY *pkey);
1021 987
@@ -1033,17 +999,20 @@ int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
1033unsigned long X509_NAME_hash(X509_NAME *x); 999unsigned long X509_NAME_hash(X509_NAME *x);
1034 1000
1035int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); 1001int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
1036#ifndef NO_FP_API 1002#ifndef OPENSSL_NO_FP_API
1003int X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
1037int X509_print_fp(FILE *bp,X509 *x); 1004int X509_print_fp(FILE *bp,X509 *x);
1038int X509_CRL_print_fp(FILE *bp,X509_CRL *x); 1005int X509_CRL_print_fp(FILE *bp,X509_CRL *x);
1039int X509_REQ_print_fp(FILE *bp,X509_REQ *req); 1006int X509_REQ_print_fp(FILE *bp,X509_REQ *req);
1040int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags); 1007int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags);
1041#endif 1008#endif
1042 1009
1043#ifndef NO_BIO 1010#ifndef OPENSSL_NO_BIO
1044int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); 1011int X509_NAME_print(BIO *bp, X509_NAME *name, int obase);
1045int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags); 1012int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags);
1013int X509_print_ex(BIO *bp,X509 *x, unsigned long nmflag, unsigned long cflag);
1046int X509_print(BIO *bp,X509 *x); 1014int X509_print(BIO *bp,X509 *x);
1015int X509_ocspid_print(BIO *bp,X509 *x);
1047int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent); 1016int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent);
1048int X509_CRL_print(BIO *bp,X509_CRL *x); 1017int X509_CRL_print(BIO *bp,X509_CRL *x);
1049int X509_REQ_print(BIO *bp,X509_REQ *req); 1018int X509_REQ_print(BIO *bp,X509_REQ *req);
@@ -1104,6 +1073,8 @@ X509_EXTENSION *X509_get_ext(X509 *x, int loc);
1104X509_EXTENSION *X509_delete_ext(X509 *x, int loc); 1073X509_EXTENSION *X509_delete_ext(X509 *x, int loc);
1105int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); 1074int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
1106void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); 1075void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx);
1076int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
1077 unsigned long flags);
1107 1078
1108int X509_CRL_get_ext_count(X509_CRL *x); 1079int X509_CRL_get_ext_count(X509_CRL *x);
1109int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos); 1080int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos);
@@ -1113,6 +1084,8 @@ X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc);
1113X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); 1084X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
1114int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); 1085int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
1115void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); 1086void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx);
1087int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
1088 unsigned long flags);
1116 1089
1117int X509_REVOKED_get_ext_count(X509_REVOKED *x); 1090int X509_REVOKED_get_ext_count(X509_REVOKED *x);
1118int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); 1091int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos);
@@ -1122,6 +1095,8 @@ X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc);
1122X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); 1095X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc);
1123int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); 1096int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc);
1124void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); 1097void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx);
1098int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
1099 unsigned long flags);
1125 1100
1126X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, 1101X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
1127 int nid, int crit, ASN1_OCTET_STRING *data); 1102 int nid, int crit, ASN1_OCTET_STRING *data);
@@ -1145,22 +1120,22 @@ X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc);
1145STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, 1120STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
1146 X509_ATTRIBUTE *attr); 1121 X509_ATTRIBUTE *attr);
1147STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, 1122STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x,
1148 ASN1_OBJECT *obj, int type, 1123 const ASN1_OBJECT *obj, int type,
1149 unsigned char *bytes, int len); 1124 const unsigned char *bytes, int len);
1150STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, 1125STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x,
1151 int nid, int type, 1126 int nid, int type,
1152 unsigned char *bytes, int len); 1127 const unsigned char *bytes, int len);
1153STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, 1128STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x,
1154 char *attrname, int type, 1129 const char *attrname, int type,
1155 unsigned char *bytes, int len); 1130 const unsigned char *bytes, int len);
1156X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, 1131X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
1157 int atrtype, void *data, int len); 1132 int atrtype, const void *data, int len);
1158X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, 1133X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
1159 ASN1_OBJECT *obj, int atrtype, void *data, int len); 1134 const ASN1_OBJECT *obj, int atrtype, const void *data, int len);
1160X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, 1135X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
1161 char *atrname, int type, unsigned char *bytes, int len); 1136 const char *atrname, int type, const unsigned char *bytes, int len);
1162int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, ASN1_OBJECT *obj); 1137int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);
1163int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, void *data, int len); 1138int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len);
1164void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, 1139void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx,
1165 int atrtype, void *data); 1140 int atrtype, void *data);
1166int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr); 1141int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr);
@@ -1174,31 +1149,17 @@ X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name,
1174 ASN1_INTEGER *serial); 1149 ASN1_INTEGER *serial);
1175X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name); 1150X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name);
1176 1151
1177int i2d_PBEPARAM(PBEPARAM *a, unsigned char **pp); 1152DECLARE_ASN1_FUNCTIONS(PBEPARAM)
1178PBEPARAM *PBEPARAM_new(void); 1153DECLARE_ASN1_FUNCTIONS(PBE2PARAM)
1179PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, unsigned char **pp, long length); 1154DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM)
1180void PBEPARAM_free(PBEPARAM *a); 1155
1181X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, int saltlen); 1156X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, int saltlen);
1182X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, 1157X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
1183 unsigned char *salt, int saltlen); 1158 unsigned char *salt, int saltlen);
1184 1159
1185int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **pp);
1186PBKDF2PARAM *PBKDF2PARAM_new(void);
1187PBKDF2PARAM *d2i_PBKDF2PARAM(PBKDF2PARAM **a, unsigned char **pp, long length);
1188void PBKDF2PARAM_free(PBKDF2PARAM *a);
1189
1190int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **pp);
1191PBE2PARAM *PBE2PARAM_new(void);
1192PBE2PARAM *d2i_PBE2PARAM(PBE2PARAM **a, unsigned char **pp, long length);
1193void PBE2PARAM_free(PBE2PARAM *a);
1194
1195/* PKCS#8 utilities */ 1160/* PKCS#8 utilities */
1196 1161
1197int i2d_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO *a, unsigned char **pp); 1162DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)
1198PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new(void);
1199PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a,
1200 unsigned char **pp, long length);
1201void PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *a);
1202 1163
1203EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8); 1164EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8);
1204PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey); 1165PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey);
@@ -1220,6 +1181,7 @@ int X509_TRUST_get_trust(X509_TRUST *xp);
1220/* The following lines are auto generated by the script mkerr.pl. Any changes 1181/* The following lines are auto generated by the script mkerr.pl. Any changes
1221 * made after this point may be overwritten when the script is next run. 1182 * made after this point may be overwritten when the script is next run.
1222 */ 1183 */
1184void ERR_load_X509_strings(void);
1223 1185
1224/* Error codes for the X509 functions. */ 1186/* Error codes for the X509 functions. */
1225 1187
@@ -1258,9 +1220,12 @@ int X509_TRUST_get_trust(X509_TRUST *xp);
1258#define X509_F_X509_REQ_TO_X509 123 1220#define X509_F_X509_REQ_TO_X509 123
1259#define X509_F_X509_STORE_ADD_CERT 124 1221#define X509_F_X509_STORE_ADD_CERT 124
1260#define X509_F_X509_STORE_ADD_CRL 125 1222#define X509_F_X509_STORE_ADD_CRL 125
1223#define X509_F_X509_STORE_CTX_INIT 143
1224#define X509_F_X509_STORE_CTX_NEW 142
1261#define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134 1225#define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134
1262#define X509_F_X509_TO_X509_REQ 126 1226#define X509_F_X509_TO_X509_REQ 126
1263#define X509_F_X509_TRUST_ADD 133 1227#define X509_F_X509_TRUST_ADD 133
1228#define X509_F_X509_TRUST_SET 141
1264#define X509_F_X509_VERIFY_CERT 127 1229#define X509_F_X509_VERIFY_CERT 127
1265 1230
1266/* Reason codes. */ 1231/* Reason codes. */
@@ -1271,6 +1236,7 @@ int X509_TRUST_get_trust(X509_TRUST *xp);
1271#define X509_R_ERR_ASN1_LIB 102 1236#define X509_R_ERR_ASN1_LIB 102
1272#define X509_R_INVALID_DIRECTORY 113 1237#define X509_R_INVALID_DIRECTORY 113
1273#define X509_R_INVALID_FIELD_NAME 119 1238#define X509_R_INVALID_FIELD_NAME 119
1239#define X509_R_INVALID_TRUST 123
1274#define X509_R_KEY_TYPE_MISMATCH 115 1240#define X509_R_KEY_TYPE_MISMATCH 115
1275#define X509_R_KEY_VALUES_MISMATCH 116 1241#define X509_R_KEY_VALUES_MISMATCH 116
1276#define X509_R_LOADING_CERT_DIR 103 1242#define X509_R_LOADING_CERT_DIR 103
@@ -1291,4 +1257,3 @@ int X509_TRUST_get_trust(X509_TRUST *xp);
1291} 1257}
1292#endif 1258#endif
1293#endif 1259#endif
1294
diff --git a/src/lib/libcrypto/x509/x509_att.c b/src/lib/libcrypto/x509/x509_att.c
index caafde658f..0bae3d32a1 100644
--- a/src/lib/libcrypto/x509/x509_att.c
+++ b/src/lib/libcrypto/x509/x509_att.c
@@ -149,8 +149,8 @@ err2:
149} 149}
150 150
151STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, 151STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x,
152 ASN1_OBJECT *obj, int type, 152 const ASN1_OBJECT *obj, int type,
153 unsigned char *bytes, int len) 153 const unsigned char *bytes, int len)
154{ 154{
155 X509_ATTRIBUTE *attr; 155 X509_ATTRIBUTE *attr;
156 STACK_OF(X509_ATTRIBUTE) *ret; 156 STACK_OF(X509_ATTRIBUTE) *ret;
@@ -163,7 +163,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x,
163 163
164STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, 164STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x,
165 int nid, int type, 165 int nid, int type,
166 unsigned char *bytes, int len) 166 const unsigned char *bytes, int len)
167{ 167{
168 X509_ATTRIBUTE *attr; 168 X509_ATTRIBUTE *attr;
169 STACK_OF(X509_ATTRIBUTE) *ret; 169 STACK_OF(X509_ATTRIBUTE) *ret;
@@ -175,8 +175,8 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x,
175} 175}
176 176
177STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, 177STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x,
178 char *attrname, int type, 178 const char *attrname, int type,
179 unsigned char *bytes, int len) 179 const unsigned char *bytes, int len)
180{ 180{
181 X509_ATTRIBUTE *attr; 181 X509_ATTRIBUTE *attr;
182 STACK_OF(X509_ATTRIBUTE) *ret; 182 STACK_OF(X509_ATTRIBUTE) *ret;
@@ -188,7 +188,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x,
188} 188}
189 189
190X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, 190X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
191 int atrtype, void *data, int len) 191 int atrtype, const void *data, int len)
192{ 192{
193 ASN1_OBJECT *obj; 193 ASN1_OBJECT *obj;
194 X509_ATTRIBUTE *ret; 194 X509_ATTRIBUTE *ret;
@@ -205,7 +205,7 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,
205} 205}
206 206
207X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, 207X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
208 ASN1_OBJECT *obj, int atrtype, void *data, int len) 208 const ASN1_OBJECT *obj, int atrtype, const void *data, int len)
209{ 209{
210 X509_ATTRIBUTE *ret; 210 X509_ATTRIBUTE *ret;
211 211
@@ -234,7 +234,7 @@ err:
234} 234}
235 235
236X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, 236X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
237 char *atrname, int type, unsigned char *bytes, int len) 237 const char *atrname, int type, const unsigned char *bytes, int len)
238 { 238 {
239 ASN1_OBJECT *obj; 239 ASN1_OBJECT *obj;
240 X509_ATTRIBUTE *nattr; 240 X509_ATTRIBUTE *nattr;
@@ -252,7 +252,7 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
252 return nattr; 252 return nattr;
253 } 253 }
254 254
255int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, ASN1_OBJECT *obj) 255int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj)
256{ 256{
257 if ((attr == NULL) || (obj == NULL)) 257 if ((attr == NULL) || (obj == NULL))
258 return(0); 258 return(0);
@@ -261,7 +261,7 @@ int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, ASN1_OBJECT *obj)
261 return(1); 261 return(1);
262} 262}
263 263
264int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, void *data, int len) 264int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len)
265{ 265{
266 ASN1_TYPE *ttmp; 266 ASN1_TYPE *ttmp;
267 ASN1_STRING *stmp; 267 ASN1_STRING *stmp;
@@ -283,7 +283,7 @@ int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, void *data, int
283 if(!(attr->value.set = sk_ASN1_TYPE_new_null())) goto err; 283 if(!(attr->value.set = sk_ASN1_TYPE_new_null())) goto err;
284 if(!(ttmp = ASN1_TYPE_new())) goto err; 284 if(!(ttmp = ASN1_TYPE_new())) goto err;
285 if(!sk_ASN1_TYPE_push(attr->value.set, ttmp)) goto err; 285 if(!sk_ASN1_TYPE_push(attr->value.set, ttmp)) goto err;
286 attr->set = 1; 286 attr->single = 0;
287 ASN1_TYPE_set(ttmp, atype, stmp); 287 ASN1_TYPE_set(ttmp, atype, stmp);
288 return 1; 288 return 1;
289 err: 289 err:
@@ -293,7 +293,7 @@ int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, void *data, int
293 293
294int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr) 294int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr)
295{ 295{
296 if(attr->set) return sk_ASN1_TYPE_num(attr->value.set); 296 if(!attr->single) return sk_ASN1_TYPE_num(attr->value.set);
297 if(attr->value.single) return 1; 297 if(attr->value.single) return 1;
298 return 0; 298 return 0;
299} 299}
@@ -321,6 +321,6 @@ ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx)
321{ 321{
322 if (attr == NULL) return(NULL); 322 if (attr == NULL) return(NULL);
323 if(idx >= X509_ATTRIBUTE_count(attr)) return NULL; 323 if(idx >= X509_ATTRIBUTE_count(attr)) return NULL;
324 if(attr->set) return sk_ASN1_TYPE_value(attr->value.set, idx); 324 if(!attr->single) return sk_ASN1_TYPE_value(attr->value.set, idx);
325 else return attr->value.single; 325 else return attr->value.single;
326} 326}
diff --git a/src/lib/libcrypto/x509/x509_cmp.c b/src/lib/libcrypto/x509/x509_cmp.c
index 3f9f9b3d47..cd20b6d66f 100644
--- a/src/lib/libcrypto/x509/x509_cmp.c
+++ b/src/lib/libcrypto/x509/x509_cmp.c
@@ -75,24 +75,26 @@ int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b)
75 return(X509_NAME_cmp(ai->issuer,bi->issuer)); 75 return(X509_NAME_cmp(ai->issuer,bi->issuer));
76 } 76 }
77 77
78#ifndef NO_MD5 78#ifndef OPENSSL_NO_MD5
79unsigned long X509_issuer_and_serial_hash(X509 *a) 79unsigned long X509_issuer_and_serial_hash(X509 *a)
80 { 80 {
81 unsigned long ret=0; 81 unsigned long ret=0;
82 MD5_CTX ctx; 82 EVP_MD_CTX ctx;
83 unsigned char md[16]; 83 unsigned char md[16];
84 char str[256]; 84 char str[256];
85 85
86 EVP_MD_CTX_init(&ctx);
86 X509_NAME_oneline(a->cert_info->issuer,str,256); 87 X509_NAME_oneline(a->cert_info->issuer,str,256);
87 ret=strlen(str); 88 ret=strlen(str);
88 MD5_Init(&ctx); 89 EVP_DigestInit_ex(&ctx, EVP_md5(), NULL);
89 MD5_Update(&ctx,(unsigned char *)str,ret); 90 EVP_DigestUpdate(&ctx,(unsigned char *)str,ret);
90 MD5_Update(&ctx,(unsigned char *)a->cert_info->serialNumber->data, 91 EVP_DigestUpdate(&ctx,(unsigned char *)a->cert_info->serialNumber->data,
91 (unsigned long)a->cert_info->serialNumber->length); 92 (unsigned long)a->cert_info->serialNumber->length);
92 MD5_Final(&(md[0]),&ctx); 93 EVP_DigestFinal_ex(&ctx,&(md[0]),NULL);
93 ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)| 94 ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)|
94 ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L) 95 ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L)
95 )&0xffffffffL; 96 )&0xffffffffL;
97 EVP_MD_CTX_cleanup(&ctx);
96 return(ret); 98 return(ret);
97 } 99 }
98#endif 100#endif
@@ -137,7 +139,7 @@ unsigned long X509_subject_name_hash(X509 *x)
137 return(X509_NAME_hash(x->cert_info->subject)); 139 return(X509_NAME_hash(x->cert_info->subject));
138 } 140 }
139 141
140#ifndef NO_SHA 142#ifndef OPENSSL_NO_SHA
141/* Compare two certificates: they must be identical for 143/* Compare two certificates: they must be identical for
142 * this to work. NB: Although "cmp" operations are generally 144 * this to work. NB: Although "cmp" operations are generally
143 * prototyped to take "const" arguments (eg. for use in 145 * prototyped to take "const" arguments (eg. for use in
@@ -192,7 +194,7 @@ int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b)
192 return(0); 194 return(0);
193 } 195 }
194 196
195#ifndef NO_MD5 197#ifndef OPENSSL_NO_MD5
196/* I now DER encode the name and hash it. Since I cache the DER encoding, 198/* I now DER encode the name and hash it. Since I cache the DER encoding,
197 * this is reasonably efficient. */ 199 * this is reasonably efficient. */
198unsigned long X509_NAME_hash(X509_NAME *x) 200unsigned long X509_NAME_hash(X509_NAME *x)
@@ -200,12 +202,9 @@ unsigned long X509_NAME_hash(X509_NAME *x)
200 unsigned long ret=0; 202 unsigned long ret=0;
201 unsigned char md[16]; 203 unsigned char md[16];
202 204
203 /* Ensure cached version is up to date */ 205 /* Make sure X509_NAME structure contains valid cached encoding */
204 i2d_X509_NAME(x,NULL); 206 i2d_X509_NAME(x,NULL);
205 /* Use cached encoding directly rather than copying: this should 207 EVP_Digest(x->bytes->data, x->bytes->length, md, NULL, EVP_md5(), NULL);
206 * keep libsafe happy.
207 */
208 MD5((unsigned char *)x->bytes->data,x->bytes->length,&(md[0]));
209 208
210 ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)| 209 ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)|
211 ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L) 210 ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L)
@@ -258,6 +257,12 @@ EVP_PKEY *X509_get_pubkey(X509 *x)
258 return(X509_PUBKEY_get(x->cert_info->key)); 257 return(X509_PUBKEY_get(x->cert_info->key));
259 } 258 }
260 259
260ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)
261 {
262 if(!x) return NULL;
263 return x->cert_info->key->public_key;
264 }
265
261int X509_check_private_key(X509 *x, EVP_PKEY *k) 266int X509_check_private_key(X509 *x, EVP_PKEY *k)
262 { 267 {
263 EVP_PKEY *xk=NULL; 268 EVP_PKEY *xk=NULL;
@@ -271,7 +276,7 @@ int X509_check_private_key(X509 *x, EVP_PKEY *k)
271 } 276 }
272 switch (k->type) 277 switch (k->type)
273 { 278 {
274#ifndef NO_RSA 279#ifndef OPENSSL_NO_RSA
275 case EVP_PKEY_RSA: 280 case EVP_PKEY_RSA:
276 if (BN_cmp(xk->pkey.rsa->n,k->pkey.rsa->n) != 0 281 if (BN_cmp(xk->pkey.rsa->n,k->pkey.rsa->n) != 0
277 || BN_cmp(xk->pkey.rsa->e,k->pkey.rsa->e) != 0) 282 || BN_cmp(xk->pkey.rsa->e,k->pkey.rsa->e) != 0)
@@ -281,7 +286,7 @@ int X509_check_private_key(X509 *x, EVP_PKEY *k)
281 } 286 }
282 break; 287 break;
283#endif 288#endif
284#ifndef NO_DSA 289#ifndef OPENSSL_NO_DSA
285 case EVP_PKEY_DSA: 290 case EVP_PKEY_DSA:
286 if (BN_cmp(xk->pkey.dsa->pub_key,k->pkey.dsa->pub_key) != 0) 291 if (BN_cmp(xk->pkey.dsa->pub_key,k->pkey.dsa->pub_key) != 0)
287 { 292 {
@@ -290,7 +295,7 @@ int X509_check_private_key(X509 *x, EVP_PKEY *k)
290 } 295 }
291 break; 296 break;
292#endif 297#endif
293#ifndef NO_DH 298#ifndef OPENSSL_NO_DH
294 case EVP_PKEY_DH: 299 case EVP_PKEY_DH:
295 /* No idea */ 300 /* No idea */
296 X509err(X509_F_X509_CHECK_PRIVATE_KEY,X509_R_CANT_CHECK_DH_KEY); 301 X509err(X509_F_X509_CHECK_PRIVATE_KEY,X509_R_CANT_CHECK_DH_KEY);
diff --git a/src/lib/libcrypto/x509/x509_d2.c b/src/lib/libcrypto/x509/x509_d2.c
index 753d53eb43..51410cfd1a 100644
--- a/src/lib/libcrypto/x509/x509_d2.c
+++ b/src/lib/libcrypto/x509/x509_d2.c
@@ -61,7 +61,7 @@
61#include <openssl/crypto.h> 61#include <openssl/crypto.h>
62#include <openssl/x509.h> 62#include <openssl/x509.h>
63 63
64#ifndef NO_STDIO 64#ifndef OPENSSL_NO_STDIO
65int X509_STORE_set_default_paths(X509_STORE *ctx) 65int X509_STORE_set_default_paths(X509_STORE *ctx)
66 { 66 {
67 X509_LOOKUP *lookup; 67 X509_LOOKUP *lookup;
diff --git a/src/lib/libcrypto/x509/x509_err.c b/src/lib/libcrypto/x509/x509_err.c
index 848add56e9..5bbf4acf76 100644
--- a/src/lib/libcrypto/x509/x509_err.c
+++ b/src/lib/libcrypto/x509/x509_err.c
@@ -63,7 +63,7 @@
63#include <openssl/x509.h> 63#include <openssl/x509.h>
64 64
65/* BEGIN ERROR CODES */ 65/* BEGIN ERROR CODES */
66#ifndef NO_ERR 66#ifndef OPENSSL_NO_ERR
67static ERR_STRING_DATA X509_str_functs[]= 67static ERR_STRING_DATA X509_str_functs[]=
68 { 68 {
69{ERR_PACK(0,X509_F_ADD_CERT_DIR,0), "ADD_CERT_DIR"}, 69{ERR_PACK(0,X509_F_ADD_CERT_DIR,0), "ADD_CERT_DIR"},
@@ -100,9 +100,12 @@ static ERR_STRING_DATA X509_str_functs[]=
100{ERR_PACK(0,X509_F_X509_REQ_TO_X509,0), "X509_REQ_to_X509"}, 100{ERR_PACK(0,X509_F_X509_REQ_TO_X509,0), "X509_REQ_to_X509"},
101{ERR_PACK(0,X509_F_X509_STORE_ADD_CERT,0), "X509_STORE_add_cert"}, 101{ERR_PACK(0,X509_F_X509_STORE_ADD_CERT,0), "X509_STORE_add_cert"},
102{ERR_PACK(0,X509_F_X509_STORE_ADD_CRL,0), "X509_STORE_add_crl"}, 102{ERR_PACK(0,X509_F_X509_STORE_ADD_CRL,0), "X509_STORE_add_crl"},
103{ERR_PACK(0,X509_F_X509_STORE_CTX_INIT,0), "X509_STORE_CTX_init"},
104{ERR_PACK(0,X509_F_X509_STORE_CTX_NEW,0), "X509_STORE_CTX_new"},
103{ERR_PACK(0,X509_F_X509_STORE_CTX_PURPOSE_INHERIT,0), "X509_STORE_CTX_purpose_inherit"}, 105{ERR_PACK(0,X509_F_X509_STORE_CTX_PURPOSE_INHERIT,0), "X509_STORE_CTX_purpose_inherit"},
104{ERR_PACK(0,X509_F_X509_TO_X509_REQ,0), "X509_to_X509_REQ"}, 106{ERR_PACK(0,X509_F_X509_TO_X509_REQ,0), "X509_to_X509_REQ"},
105{ERR_PACK(0,X509_F_X509_TRUST_ADD,0), "X509_TRUST_add"}, 107{ERR_PACK(0,X509_F_X509_TRUST_ADD,0), "X509_TRUST_add"},
108{ERR_PACK(0,X509_F_X509_TRUST_SET,0), "X509_TRUST_set"},
106{ERR_PACK(0,X509_F_X509_VERIFY_CERT,0), "X509_verify_cert"}, 109{ERR_PACK(0,X509_F_X509_VERIFY_CERT,0), "X509_verify_cert"},
107{0,NULL} 110{0,NULL}
108 }; 111 };
@@ -116,6 +119,7 @@ static ERR_STRING_DATA X509_str_reasons[]=
116{X509_R_ERR_ASN1_LIB ,"err asn1 lib"}, 119{X509_R_ERR_ASN1_LIB ,"err asn1 lib"},
117{X509_R_INVALID_DIRECTORY ,"invalid directory"}, 120{X509_R_INVALID_DIRECTORY ,"invalid directory"},
118{X509_R_INVALID_FIELD_NAME ,"invalid field name"}, 121{X509_R_INVALID_FIELD_NAME ,"invalid field name"},
122{X509_R_INVALID_TRUST ,"invalid trust"},
119{X509_R_KEY_TYPE_MISMATCH ,"key type mismatch"}, 123{X509_R_KEY_TYPE_MISMATCH ,"key type mismatch"},
120{X509_R_KEY_VALUES_MISMATCH ,"key values mismatch"}, 124{X509_R_KEY_VALUES_MISMATCH ,"key values mismatch"},
121{X509_R_LOADING_CERT_DIR ,"loading cert dir"}, 125{X509_R_LOADING_CERT_DIR ,"loading cert dir"},
@@ -143,7 +147,7 @@ void ERR_load_X509_strings(void)
143 if (init) 147 if (init)
144 { 148 {
145 init=0; 149 init=0;
146#ifndef NO_ERR 150#ifndef OPENSSL_NO_ERR
147 ERR_load_strings(ERR_LIB_X509,X509_str_functs); 151 ERR_load_strings(ERR_LIB_X509,X509_str_functs);
148 ERR_load_strings(ERR_LIB_X509,X509_str_reasons); 152 ERR_load_strings(ERR_LIB_X509,X509_str_reasons);
149#endif 153#endif
diff --git a/src/lib/libcrypto/x509/x509_ext.c b/src/lib/libcrypto/x509/x509_ext.c
index 2955989807..e7fdacb5e4 100644
--- a/src/lib/libcrypto/x509/x509_ext.c
+++ b/src/lib/libcrypto/x509/x509_ext.c
@@ -101,6 +101,12 @@ void *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx)
101 return X509V3_get_d2i(x->crl->extensions, nid, crit, idx); 101 return X509V3_get_d2i(x->crl->extensions, nid, crit, idx);
102} 102}
103 103
104int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
105 unsigned long flags)
106{
107 return X509V3_add1_i2d(&x->crl->extensions, nid, value, crit, flags);
108}
109
104int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc) 110int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc)
105 { 111 {
106 return(X509v3_add_ext(&(x->crl->extensions),ex,loc) != NULL); 112 return(X509v3_add_ext(&(x->crl->extensions),ex,loc) != NULL);
@@ -146,6 +152,13 @@ void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx)
146 return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx); 152 return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx);
147} 153}
148 154
155int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
156 unsigned long flags)
157{
158 return X509V3_add1_i2d(&x->cert_info->extensions, nid, value, crit,
159 flags);
160}
161
149int X509_REVOKED_get_ext_count(X509_REVOKED *x) 162int X509_REVOKED_get_ext_count(X509_REVOKED *x)
150 { 163 {
151 return(X509v3_get_ext_count(x->extensions)); 164 return(X509v3_get_ext_count(x->extensions));
@@ -187,5 +200,11 @@ void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx)
187 return X509V3_get_d2i(x->extensions, nid, crit, idx); 200 return X509V3_get_d2i(x->extensions, nid, crit, idx);
188} 201}
189 202
203int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
204 unsigned long flags)
205{
206 return X509V3_add1_i2d(&x->extensions, nid, value, crit, flags);
207}
208
190IMPLEMENT_STACK_OF(X509_EXTENSION) 209IMPLEMENT_STACK_OF(X509_EXTENSION)
191IMPLEMENT_ASN1_SET_OF(X509_EXTENSION) 210IMPLEMENT_ASN1_SET_OF(X509_EXTENSION)
diff --git a/src/lib/libcrypto/x509/x509_lu.c b/src/lib/libcrypto/x509/x509_lu.c
index 863c738cad..b780dae5e2 100644
--- a/src/lib/libcrypto/x509/x509_lu.c
+++ b/src/lib/libcrypto/x509/x509_lu.c
@@ -60,8 +60,7 @@
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/lhash.h> 61#include <openssl/lhash.h>
62#include <openssl/x509.h> 62#include <openssl/x509.h>
63 63#include <openssl/x509v3.h>
64static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_store_meth=NULL;
65 64
66X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method) 65X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method)
67 { 66 {
@@ -185,9 +184,23 @@ X509_STORE *X509_STORE_new(void)
185 ret->objs = sk_X509_OBJECT_new(x509_object_cmp); 184 ret->objs = sk_X509_OBJECT_new(x509_object_cmp);
186 ret->cache=1; 185 ret->cache=1;
187 ret->get_cert_methods=sk_X509_LOOKUP_new_null(); 186 ret->get_cert_methods=sk_X509_LOOKUP_new_null();
188 ret->verify=NULL; 187 ret->verify=0;
189 ret->verify_cb=NULL; 188 ret->verify_cb=0;
190 memset(&ret->ex_data,0,sizeof(CRYPTO_EX_DATA)); 189
190 ret->purpose = 0;
191 ret->trust = 0;
192
193 ret->flags = 0;
194
195 ret->get_issuer = 0;
196 ret->check_issued = 0;
197 ret->check_revocation = 0;
198 ret->get_crl = 0;
199 ret->check_crl = 0;
200 ret->cert_crl = 0;
201 ret->cleanup = 0;
202
203 CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE, ret, &ret->ex_data);
191 ret->references=1; 204 ret->references=1;
192 ret->depth=0; 205 ret->depth=0;
193 return ret; 206 return ret;
@@ -230,7 +243,7 @@ void X509_STORE_free(X509_STORE *vfy)
230 sk_X509_LOOKUP_free(sk); 243 sk_X509_LOOKUP_free(sk);
231 sk_X509_OBJECT_pop_free(vfy->objs, cleanup); 244 sk_X509_OBJECT_pop_free(vfy->objs, cleanup);
232 245
233 CRYPTO_free_ex_data(x509_store_meth,vfy,&vfy->ex_data); 246 CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE, vfy, &vfy->ex_data);
234 OPENSSL_free(vfy); 247 OPENSSL_free(vfy);
235 } 248 }
236 249
@@ -525,5 +538,20 @@ int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x)
525 return 0; 538 return 0;
526} 539}
527 540
541void X509_STORE_set_flags(X509_STORE *ctx, long flags)
542 {
543 ctx->flags |= flags;
544 }
545
546int X509_STORE_set_purpose(X509_STORE *ctx, int purpose)
547 {
548 return X509_PURPOSE_set(&ctx->purpose, purpose);
549 }
550
551int X509_STORE_set_trust(X509_STORE *ctx, int trust)
552 {
553 return X509_TRUST_set(&ctx->trust, trust);
554 }
555
528IMPLEMENT_STACK_OF(X509_LOOKUP) 556IMPLEMENT_STACK_OF(X509_LOOKUP)
529IMPLEMENT_STACK_OF(X509_OBJECT) 557IMPLEMENT_STACK_OF(X509_OBJECT)
diff --git a/src/lib/libcrypto/x509/x509_obj.c b/src/lib/libcrypto/x509/x509_obj.c
index f0271fdfa1..1e718f76eb 100644
--- a/src/lib/libcrypto/x509/x509_obj.c
+++ b/src/lib/libcrypto/x509/x509_obj.c
@@ -94,6 +94,7 @@ int i;
94 OPENSSL_free(b); 94 OPENSSL_free(b);
95 } 95 }
96 strncpy(buf,"NO X509_NAME",len); 96 strncpy(buf,"NO X509_NAME",len);
97 buf[len-1]='\0';
97 return buf; 98 return buf;
98 } 99 }
99 100
diff --git a/src/lib/libcrypto/x509/x509_req.c b/src/lib/libcrypto/x509/x509_req.c
index 7eca1bd57a..0affa3bf30 100644
--- a/src/lib/libcrypto/x509/x509_req.c
+++ b/src/lib/libcrypto/x509/x509_req.c
@@ -156,9 +156,9 @@ STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req)
156 for(i = 0; i < sk_X509_ATTRIBUTE_num(sk); i++) { 156 for(i = 0; i < sk_X509_ATTRIBUTE_num(sk); i++) {
157 attr = sk_X509_ATTRIBUTE_value(sk, i); 157 attr = sk_X509_ATTRIBUTE_value(sk, i);
158 if(X509_REQ_extension_nid(OBJ_obj2nid(attr->object))) { 158 if(X509_REQ_extension_nid(OBJ_obj2nid(attr->object))) {
159 if(attr->set && sk_ASN1_TYPE_num(attr->value.set)) 159 if(attr->single) ext = attr->value.single;
160 else if(sk_ASN1_TYPE_num(attr->value.set))
160 ext = sk_ASN1_TYPE_value(attr->value.set, 0); 161 ext = sk_ASN1_TYPE_value(attr->value.set, 0);
161 else ext = attr->value.single;
162 break; 162 break;
163 } 163 }
164 } 164 }
@@ -199,7 +199,7 @@ int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
199 if(!(attr->value.set = sk_ASN1_TYPE_new_null())) goto err; 199 if(!(attr->value.set = sk_ASN1_TYPE_new_null())) goto err;
200 if(!sk_ASN1_TYPE_push(attr->value.set, at)) goto err; 200 if(!sk_ASN1_TYPE_push(attr->value.set, at)) goto err;
201 at = NULL; 201 at = NULL;
202 attr->set = 1; 202 attr->single = 0;
203 attr->object = OBJ_nid2obj(nid); 203 attr->object = OBJ_nid2obj(nid);
204 if(!sk_X509_ATTRIBUTE_push(req->req_info->attributes, attr)) goto err; 204 if(!sk_X509_ATTRIBUTE_push(req->req_info->attributes, attr)) goto err;
205 return 1; 205 return 1;
@@ -251,8 +251,8 @@ int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr)
251} 251}
252 252
253int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, 253int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
254 ASN1_OBJECT *obj, int type, 254 const ASN1_OBJECT *obj, int type,
255 unsigned char *bytes, int len) 255 const unsigned char *bytes, int len)
256{ 256{
257 if(X509at_add1_attr_by_OBJ(&req->req_info->attributes, obj, 257 if(X509at_add1_attr_by_OBJ(&req->req_info->attributes, obj,
258 type, bytes, len)) return 1; 258 type, bytes, len)) return 1;
@@ -261,7 +261,7 @@ int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
261 261
262int X509_REQ_add1_attr_by_NID(X509_REQ *req, 262int X509_REQ_add1_attr_by_NID(X509_REQ *req,
263 int nid, int type, 263 int nid, int type,
264 unsigned char *bytes, int len) 264 const unsigned char *bytes, int len)
265{ 265{
266 if(X509at_add1_attr_by_NID(&req->req_info->attributes, nid, 266 if(X509at_add1_attr_by_NID(&req->req_info->attributes, nid,
267 type, bytes, len)) return 1; 267 type, bytes, len)) return 1;
@@ -269,8 +269,8 @@ int X509_REQ_add1_attr_by_NID(X509_REQ *req,
269} 269}
270 270
271int X509_REQ_add1_attr_by_txt(X509_REQ *req, 271int X509_REQ_add1_attr_by_txt(X509_REQ *req,
272 char *attrname, int type, 272 const char *attrname, int type,
273 unsigned char *bytes, int len) 273 const unsigned char *bytes, int len)
274{ 274{
275 if(X509at_add1_attr_by_txt(&req->req_info->attributes, attrname, 275 if(X509at_add1_attr_by_txt(&req->req_info->attributes, attrname,
276 type, bytes, len)) return 1; 276 type, bytes, len)) return 1;
diff --git a/src/lib/libcrypto/x509/x509_trs.c b/src/lib/libcrypto/x509/x509_trs.c
index 86b3b79dcc..17d69ac005 100644
--- a/src/lib/libcrypto/x509/x509_trs.c
+++ b/src/lib/libcrypto/x509/x509_trs.c
@@ -66,6 +66,7 @@ static int tr_cmp(const X509_TRUST * const *a,
66static void trtable_free(X509_TRUST *p); 66static void trtable_free(X509_TRUST *p);
67 67
68static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags); 68static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags);
69static int trust_1oid(X509_TRUST *trust, X509 *x, int flags);
69static int trust_compat(X509_TRUST *trust, X509 *x, int flags); 70static int trust_compat(X509_TRUST *trust, X509 *x, int flags);
70 71
71static int obj_trust(int id, X509 *x, int flags); 72static int obj_trust(int id, X509 *x, int flags);
@@ -79,8 +80,10 @@ static int (*default_trust)(int id, X509 *x, int flags) = obj_trust;
79static X509_TRUST trstandard[] = { 80static X509_TRUST trstandard[] = {
80{X509_TRUST_COMPAT, 0, trust_compat, "compatible", 0, NULL}, 81{X509_TRUST_COMPAT, 0, trust_compat, "compatible", 0, NULL},
81{X509_TRUST_SSL_CLIENT, 0, trust_1oidany, "SSL Client", NID_client_auth, NULL}, 82{X509_TRUST_SSL_CLIENT, 0, trust_1oidany, "SSL Client", NID_client_auth, NULL},
82{X509_TRUST_SSL_SERVER, 0, trust_1oidany, "SSL Client", NID_server_auth, NULL}, 83{X509_TRUST_SSL_SERVER, 0, trust_1oidany, "SSL Server", NID_server_auth, NULL},
83{X509_TRUST_EMAIL, 0, trust_1oidany, "S/MIME email", NID_email_protect, NULL}, 84{X509_TRUST_EMAIL, 0, trust_1oidany, "S/MIME email", NID_email_protect, NULL},
85{X509_TRUST_OCSP_SIGN, 0, trust_1oid, "OCSP responder", NID_OCSP_sign, NULL},
86{X509_TRUST_OCSP_REQUEST, 0, trust_1oid, "OCSP request", NID_ad_OCSP, NULL}
84}; 87};
85 88
86#define X509_TRUST_COUNT (sizeof(trstandard)/sizeof(X509_TRUST)) 89#define X509_TRUST_COUNT (sizeof(trstandard)/sizeof(X509_TRUST))
@@ -97,10 +100,10 @@ static int tr_cmp(const X509_TRUST * const *a,
97 100
98int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int) 101int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int)
99{ 102{
100int (*oldtrust)(int , X509 *, int); 103 int (*oldtrust)(int , X509 *, int);
101oldtrust = default_trust; 104 oldtrust = default_trust;
102default_trust = trust; 105 default_trust = trust;
103return oldtrust; 106 return oldtrust;
104} 107}
105 108
106 109
@@ -141,6 +144,16 @@ int X509_TRUST_get_by_id(int id)
141 return idx + X509_TRUST_COUNT; 144 return idx + X509_TRUST_COUNT;
142} 145}
143 146
147int X509_TRUST_set(int *t, int trust)
148{
149 if(X509_TRUST_get_by_id(trust) == -1) {
150 X509err(X509_F_X509_TRUST_SET, X509_R_INVALID_TRUST);
151 return 0;
152 }
153 *t = trust;
154 return 1;
155}
156
144int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), 157int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
145 char *name, int arg1, void *arg2) 158 char *name, int arg1, void *arg2)
146{ 159{
@@ -236,6 +249,12 @@ static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags)
236 return trust_compat(trust, x, flags); 249 return trust_compat(trust, x, flags);
237} 250}
238 251
252static int trust_1oid(X509_TRUST *trust, X509 *x, int flags)
253{
254 if(x->aux) return obj_trust(trust->arg1, x, flags);
255 return X509_TRUST_UNTRUSTED;
256}
257
239static int trust_compat(X509_TRUST *trust, X509 *x, int flags) 258static int trust_compat(X509_TRUST *trust, X509 *x, int flags)
240{ 259{
241 X509_check_purpose(x, -1, 0); 260 X509_check_purpose(x, -1, 0);
diff --git a/src/lib/libcrypto/x509/x509_txt.c b/src/lib/libcrypto/x509/x509_txt.c
index cfb478d4bc..4f83db8ba2 100644
--- a/src/lib/libcrypto/x509/x509_txt.c
+++ b/src/lib/libcrypto/x509/x509_txt.c
@@ -83,7 +83,7 @@ const char *X509_verify_cert_error_string(long n)
83 case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: 83 case X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE:
84 return("unable to decrypt certificate's signature"); 84 return("unable to decrypt certificate's signature");
85 case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: 85 case X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE:
86 return("unable to decrypt CRL's's signature"); 86 return("unable to decrypt CRL's signature");
87 case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: 87 case X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY:
88 return("unable to decode issuer public key"); 88 return("unable to decode issuer public key");
89 case X509_V_ERR_CERT_SIGNATURE_FAILURE: 89 case X509_V_ERR_CERT_SIGNATURE_FAILURE:
@@ -95,7 +95,7 @@ const char *X509_verify_cert_error_string(long n)
95 case X509_V_ERR_CRL_NOT_YET_VALID: 95 case X509_V_ERR_CRL_NOT_YET_VALID:
96 return("CRL is not yet valid"); 96 return("CRL is not yet valid");
97 case X509_V_ERR_CERT_HAS_EXPIRED: 97 case X509_V_ERR_CERT_HAS_EXPIRED:
98 return("Certificate has expired"); 98 return("certificate has expired");
99 case X509_V_ERR_CRL_HAS_EXPIRED: 99 case X509_V_ERR_CRL_HAS_EXPIRED:
100 return("CRL has expired"); 100 return("CRL has expired");
101 case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: 101 case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
@@ -141,6 +141,12 @@ const char *X509_verify_cert_error_string(long n)
141 case X509_V_ERR_KEYUSAGE_NO_CERTSIGN: 141 case X509_V_ERR_KEYUSAGE_NO_CERTSIGN:
142 return("key usage does not include certificate signing"); 142 return("key usage does not include certificate signing");
143 143
144 case X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER:
145 return("unable to get CRL issuer certificate");
146
147 case X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION:
148 return("unhandled critical extension");
149
144 default: 150 default:
145 sprintf(buf,"error number %ld",n); 151 sprintf(buf,"error number %ld",n);
146 return(buf); 152 return(buf);
diff --git a/src/lib/libcrypto/x509/x509_v3.c b/src/lib/libcrypto/x509/x509_v3.c
index 52887986fe..b5f7daa2e5 100644
--- a/src/lib/libcrypto/x509/x509_v3.c
+++ b/src/lib/libcrypto/x509/x509_v3.c
@@ -115,8 +115,8 @@ int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *sk, int crit,
115 for ( ; lastpos < n; lastpos++) 115 for ( ; lastpos < n; lastpos++)
116 { 116 {
117 ex=sk_X509_EXTENSION_value(sk,lastpos); 117 ex=sk_X509_EXTENSION_value(sk,lastpos);
118 if ( (ex->critical && crit) || 118 if ( ((ex->critical > 0) && crit) ||
119 (!ex->critical && !crit)) 119 (!(ex->critical <= 0) && !crit))
120 return(lastpos); 120 return(lastpos);
121 } 121 }
122 return(-1); 122 return(-1);
@@ -234,7 +234,7 @@ int X509_EXTENSION_set_object(X509_EXTENSION *ex, ASN1_OBJECT *obj)
234int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit) 234int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit)
235 { 235 {
236 if (ex == NULL) return(0); 236 if (ex == NULL) return(0);
237 ex->critical=(crit)?0xFF:0; 237 ex->critical=(crit)?0xFF:-1;
238 return(1); 238 return(1);
239 } 239 }
240 240
@@ -263,5 +263,6 @@ ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ex)
263int X509_EXTENSION_get_critical(X509_EXTENSION *ex) 263int X509_EXTENSION_get_critical(X509_EXTENSION *ex)
264 { 264 {
265 if (ex == NULL) return(0); 265 if (ex == NULL) return(0);
266 return(ex->critical); 266 if(ex->critical > 0) return 1;
267 return 0;
267 } 268 }
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c
index 0f4110cc64..db12f7bd35 100644
--- a/src/lib/libcrypto/x509/x509_vfy.c
+++ b/src/lib/libcrypto/x509/x509_vfy.c
@@ -75,15 +75,11 @@ static int check_issued(X509_STORE_CTX *ctx, X509 *x, X509 *issuer);
75static X509 *find_issuer(X509_STORE_CTX *ctx, STACK_OF(X509) *sk, X509 *x); 75static X509 *find_issuer(X509_STORE_CTX *ctx, STACK_OF(X509) *sk, X509 *x);
76static int check_chain_purpose(X509_STORE_CTX *ctx); 76static int check_chain_purpose(X509_STORE_CTX *ctx);
77static int check_trust(X509_STORE_CTX *ctx); 77static int check_trust(X509_STORE_CTX *ctx);
78static int check_revocation(X509_STORE_CTX *ctx);
79static int check_cert(X509_STORE_CTX *ctx);
78static int internal_verify(X509_STORE_CTX *ctx); 80static int internal_verify(X509_STORE_CTX *ctx);
79const char *X509_version="X.509" OPENSSL_VERSION_PTEXT; 81const char *X509_version="X.509" OPENSSL_VERSION_PTEXT;
80 82
81static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_store_ctx_method=NULL;
82static int x509_store_ctx_num=0;
83#if 0
84static int x509_store_num=1;
85static STACK *x509_store_method=NULL;
86#endif
87 83
88static int null_callback(int ok, X509_STORE_CTX *e) 84static int null_callback(int ok, X509_STORE_CTX *e)
89 { 85 {
@@ -113,7 +109,6 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
113 } 109 }
114 110
115 cb=ctx->verify_cb; 111 cb=ctx->verify_cb;
116 if (cb == NULL) cb=null_callback;
117 112
118 /* first we make sure the chain we are going to build is 113 /* first we make sure the chain we are going to build is
119 * present and that the first entry is in place */ 114 * present and that the first entry is in place */
@@ -299,6 +294,13 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
299 /* We may as well copy down any DSA parameters that are required */ 294 /* We may as well copy down any DSA parameters that are required */
300 X509_get_pubkey_parameters(NULL,ctx->chain); 295 X509_get_pubkey_parameters(NULL,ctx->chain);
301 296
297 /* Check revocation status: we do this after copying parameters
298 * because they may be needed for CRL signature verification.
299 */
300
301 ok = ctx->check_revocation(ctx);
302 if(!ok) goto end;
303
302 /* At this point, we have a chain and just need to verify it */ 304 /* At this point, we have a chain and just need to verify it */
303 if (ctx->verify != NULL) 305 if (ctx->verify != NULL)
304 ok=ctx->verify(ctx); 306 ok=ctx->verify(ctx);
@@ -346,8 +348,7 @@ static int check_issued(X509_STORE_CTX *ctx, X509 *x, X509 *issuer)
346 ctx->error = ret; 348 ctx->error = ret;
347 ctx->current_cert = x; 349 ctx->current_cert = x;
348 ctx->current_issuer = issuer; 350 ctx->current_issuer = issuer;
349 if (ctx->verify_cb) 351 return ctx->verify_cb(0, ctx);
350 return ctx->verify_cb(0, ctx);
351 return 0; 352 return 0;
352} 353}
353 354
@@ -372,18 +373,26 @@ static int get_issuer_sk(X509 **issuer, X509_STORE_CTX *ctx, X509 *x)
372 373
373static int check_chain_purpose(X509_STORE_CTX *ctx) 374static int check_chain_purpose(X509_STORE_CTX *ctx)
374{ 375{
375#ifdef NO_CHAIN_VERIFY 376#ifdef OPENSSL_NO_CHAIN_VERIFY
376 return 1; 377 return 1;
377#else 378#else
378 int i, ok=0; 379 int i, ok=0;
379 X509 *x; 380 X509 *x;
380 int (*cb)(); 381 int (*cb)();
381 cb=ctx->verify_cb; 382 cb=ctx->verify_cb;
382 if (cb == NULL) cb=null_callback;
383 /* Check all untrusted certificates */ 383 /* Check all untrusted certificates */
384 for (i = 0; i < ctx->last_untrusted; i++) 384 for (i = 0; i < ctx->last_untrusted; i++)
385 { 385 {
386 x = sk_X509_value(ctx->chain, i); 386 x = sk_X509_value(ctx->chain, i);
387 if (!(ctx->flags & X509_V_FLAG_IGNORE_CRITICAL)
388 && (x->ex_flags & EXFLAG_CRITICAL))
389 {
390 ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;
391 ctx->error_depth = i;
392 ctx->current_cert = x;
393 ok=cb(0,ctx);
394 if (!ok) goto end;
395 }
387 if (!X509_check_purpose(x, ctx->purpose, i)) 396 if (!X509_check_purpose(x, ctx->purpose, i))
388 { 397 {
389 if (i) 398 if (i)
@@ -414,21 +423,20 @@ static int check_chain_purpose(X509_STORE_CTX *ctx)
414 423
415static int check_trust(X509_STORE_CTX *ctx) 424static int check_trust(X509_STORE_CTX *ctx)
416{ 425{
417#ifdef NO_CHAIN_VERIFY 426#ifdef OPENSSL_NO_CHAIN_VERIFY
418 return 1; 427 return 1;
419#else 428#else
420 int i, ok; 429 int i, ok;
421 X509 *x; 430 X509 *x;
422 int (*cb)(); 431 int (*cb)();
423 cb=ctx->verify_cb; 432 cb=ctx->verify_cb;
424 if (cb == NULL) cb=null_callback;
425/* For now just check the last certificate in the chain */ 433/* For now just check the last certificate in the chain */
426 i = sk_X509_num(ctx->chain) - 1; 434 i = sk_X509_num(ctx->chain) - 1;
427 x = sk_X509_value(ctx->chain, i); 435 x = sk_X509_value(ctx->chain, i);
428 ok = X509_check_trust(x, ctx->trust, 0); 436 ok = X509_check_trust(x, ctx->trust, 0);
429 if (ok == X509_TRUST_TRUSTED) 437 if (ok == X509_TRUST_TRUSTED)
430 return 1; 438 return 1;
431 ctx->error_depth = sk_X509_num(ctx->chain) - 1; 439 ctx->error_depth = i;
432 ctx->current_cert = x; 440 ctx->current_cert = x;
433 if (ok == X509_TRUST_REJECTED) 441 if (ok == X509_TRUST_REJECTED)
434 ctx->error = X509_V_ERR_CERT_REJECTED; 442 ctx->error = X509_V_ERR_CERT_REJECTED;
@@ -439,6 +447,183 @@ static int check_trust(X509_STORE_CTX *ctx)
439#endif 447#endif
440} 448}
441 449
450static int check_revocation(X509_STORE_CTX *ctx)
451 {
452 int i, last, ok;
453 if (!(ctx->flags & X509_V_FLAG_CRL_CHECK))
454 return 1;
455 if (ctx->flags & X509_V_FLAG_CRL_CHECK_ALL)
456 last = 0;
457 else
458 last = sk_X509_num(ctx->chain) - 1;
459 for(i = 0; i <= last; i++)
460 {
461 ctx->error_depth = i;
462 ok = check_cert(ctx);
463 if (!ok) return ok;
464 }
465 return 1;
466 }
467
468static int check_cert(X509_STORE_CTX *ctx)
469 {
470 X509_CRL *crl = NULL;
471 X509 *x;
472 int ok, cnum;
473 cnum = ctx->error_depth;
474 x = sk_X509_value(ctx->chain, cnum);
475 ctx->current_cert = x;
476 /* Try to retrieve relevant CRL */
477 ok = ctx->get_crl(ctx, &crl, x);
478 /* If error looking up CRL, nothing we can do except
479 * notify callback
480 */
481 if(!ok)
482 {
483 ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL;
484 ok = ctx->verify_cb(0, ctx);
485 goto err;
486 }
487 ctx->current_crl = crl;
488 ok = ctx->check_crl(ctx, crl);
489 if (!ok) goto err;
490 ok = ctx->cert_crl(ctx, crl, x);
491 err:
492 ctx->current_crl = NULL;
493 X509_CRL_free(crl);
494 return ok;
495
496 }
497
498/* Retrieve CRL corresponding to certificate: currently just a
499 * subject lookup: maybe use AKID later...
500 * Also might look up any included CRLs too (e.g PKCS#7 signedData).
501 */
502static int get_crl(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x)
503 {
504 int ok;
505 X509_OBJECT xobj;
506 ok = X509_STORE_get_by_subject(ctx, X509_LU_CRL, X509_get_issuer_name(x), &xobj);
507 if (!ok) return 0;
508 *crl = xobj.data.crl;
509 return 1;
510 }
511
512/* Check CRL validity */
513static int check_crl(X509_STORE_CTX *ctx, X509_CRL *crl)
514 {
515 X509 *issuer = NULL;
516 EVP_PKEY *ikey = NULL;
517 int ok = 0, chnum, cnum, i;
518 time_t *ptime;
519 cnum = ctx->error_depth;
520 chnum = sk_X509_num(ctx->chain) - 1;
521 /* Find CRL issuer: if not last certificate then issuer
522 * is next certificate in chain.
523 */
524 if(cnum < chnum)
525 issuer = sk_X509_value(ctx->chain, cnum + 1);
526 else
527 {
528 issuer = sk_X509_value(ctx->chain, chnum);
529 /* If not self signed, can't check signature */
530 if(!ctx->check_issued(ctx, issuer, issuer))
531 {
532 ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER;
533 ok = ctx->verify_cb(0, ctx);
534 if(!ok) goto err;
535 }
536 }
537
538 if(issuer)
539 {
540
541 /* Attempt to get issuer certificate public key */
542 ikey = X509_get_pubkey(issuer);
543
544 if(!ikey)
545 {
546 ctx->error=X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY;
547 ok = ctx->verify_cb(0, ctx);
548 if (!ok) goto err;
549 }
550 else
551 {
552 /* Verify CRL signature */
553 if(X509_CRL_verify(crl, ikey) <= 0)
554 {
555 ctx->error=X509_V_ERR_CRL_SIGNATURE_FAILURE;
556 ok = ctx->verify_cb(0, ctx);
557 if (!ok) goto err;
558 }
559 }
560 }
561
562 /* OK, CRL signature valid check times */
563 if (ctx->flags & X509_V_FLAG_USE_CHECK_TIME)
564 ptime = &ctx->check_time;
565 else
566 ptime = NULL;
567
568 i=X509_cmp_time(X509_CRL_get_lastUpdate(crl), ptime);
569 if (i == 0)
570 {
571 ctx->error=X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD;
572 ok = ctx->verify_cb(0, ctx);
573 if (!ok) goto err;
574 }
575
576 if (i > 0)
577 {
578 ctx->error=X509_V_ERR_CRL_NOT_YET_VALID;
579 ok = ctx->verify_cb(0, ctx);
580 if (!ok) goto err;
581 }
582
583 if(X509_CRL_get_nextUpdate(crl))
584 {
585 i=X509_cmp_time(X509_CRL_get_nextUpdate(crl), ptime);
586
587 if (i == 0)
588 {
589 ctx->error=X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD;
590 ok = ctx->verify_cb(0, ctx);
591 if (!ok) goto err;
592 }
593
594 if (i < 0)
595 {
596 ctx->error=X509_V_ERR_CRL_HAS_EXPIRED;
597 ok = ctx->verify_cb(0, ctx);
598 if (!ok) goto err;
599 }
600 }
601
602 ok = 1;
603
604 err:
605 EVP_PKEY_free(ikey);
606 return ok;
607 }
608
609/* Check certificate against CRL */
610static int cert_crl(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x)
611 {
612 int idx, ok;
613 X509_REVOKED rtmp;
614 /* Look for serial number of certificate in CRL */
615 rtmp.serialNumber = X509_get_serialNumber(x);
616 idx = sk_X509_REVOKED_find(crl->crl->revoked, &rtmp);
617 /* Not found: OK */
618 if(idx == -1) return 1;
619 /* Otherwise revoked: want something cleverer than
620 * this to handle entry extensions in V2 CRLs.
621 */
622 ctx->error = X509_V_ERR_CERT_REVOKED;
623 ok = ctx->verify_cb(0, ctx);
624 return ok;
625 }
626
442static int internal_verify(X509_STORE_CTX *ctx) 627static int internal_verify(X509_STORE_CTX *ctx)
443 { 628 {
444 int i,ok=0,n; 629 int i,ok=0,n;
@@ -448,7 +633,6 @@ static int internal_verify(X509_STORE_CTX *ctx)
448 int (*cb)(); 633 int (*cb)();
449 634
450 cb=ctx->verify_cb; 635 cb=ctx->verify_cb;
451 if (cb == NULL) cb=null_callback;
452 636
453 n=sk_X509_num(ctx->chain); 637 n=sk_X509_num(ctx->chain);
454 ctx->error_depth=n-1; 638 ctx->error_depth=n-1;
@@ -491,6 +675,13 @@ static int internal_verify(X509_STORE_CTX *ctx)
491 if (!ok) goto end; 675 if (!ok) goto end;
492 } 676 }
493 if (X509_verify(xs,pkey) <= 0) 677 if (X509_verify(xs,pkey) <= 0)
678 /* XXX For the final trusted self-signed cert,
679 * this is a waste of time. That check should
680 * optional so that e.g. 'openssl x509' can be
681 * used to detect invalid self-signatures, but
682 * we don't verify again and again in SSL
683 * handshakes and the like once the cert has
684 * been declared trusted. */
494 { 685 {
495 ctx->error=X509_V_ERR_CERT_SIGNATURE_FAILURE; 686 ctx->error=X509_V_ERR_CERT_SIGNATURE_FAILURE;
496 ctx->current_cert=xs; 687 ctx->current_cert=xs;
@@ -539,8 +730,6 @@ static int internal_verify(X509_STORE_CTX *ctx)
539 if (!ok) goto end; 730 if (!ok) goto end;
540 } 731 }
541 732
542 /* CRL CHECK */
543
544 /* The last error (if any) is still in the error value */ 733 /* The last error (if any) is still in the error value */
545 ctx->current_cert=xs; 734 ctx->current_cert=xs;
546 ok=(*cb)(1,ctx); 735 ok=(*cb)(1,ctx);
@@ -648,14 +837,16 @@ ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj)
648ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *in_tm) 837ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *in_tm)
649 { 838 {
650 time_t t; 839 time_t t;
840 int type = -1;
651 841
652 if (in_tm) t = *in_tm; 842 if (in_tm) t = *in_tm;
653 else time(&t); 843 else time(&t);
654 844
655 t+=adj; 845 t+=adj;
656 if (!s) return ASN1_TIME_set(s, t); 846 if (s) type = s->type;
657 if (s->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t); 847 if (type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t);
658 return ASN1_GENERALIZEDTIME_set(s, t); 848 if (type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_set(s, t);
849 return ASN1_TIME_set(s, t);
659 } 850 }
660 851
661int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain) 852int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
@@ -702,12 +893,12 @@ int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
702 893
703int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 894int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
704 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func) 895 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
705 { 896 {
706 x509_store_ctx_num++; 897 /* This function is (usually) called only once, by
707 return CRYPTO_get_ex_new_index(x509_store_ctx_num-1, 898 * SSL_get_ex_data_X509_STORE_CTX_idx (ssl/ssl_cert.c). */
708 &x509_store_ctx_method, 899 return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, argl, argp,
709 argl,argp,new_func,dup_func,free_func); 900 new_func, dup_func, free_func);
710 } 901 }
711 902
712int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data) 903int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data)
713 { 904 {
@@ -831,8 +1022,8 @@ int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
831 } 1022 }
832 } 1023 }
833 1024
834 if (purpose) ctx->purpose = purpose; 1025 if (purpose && !ctx->purpose) ctx->purpose = purpose;
835 if (trust) ctx->trust = trust; 1026 if (trust && !ctx->trust) ctx->trust = trust;
836 return 1; 1027 return 1;
837} 1028}
838 1029
@@ -840,7 +1031,12 @@ X509_STORE_CTX *X509_STORE_CTX_new(void)
840{ 1031{
841 X509_STORE_CTX *ctx; 1032 X509_STORE_CTX *ctx;
842 ctx = (X509_STORE_CTX *)OPENSSL_malloc(sizeof(X509_STORE_CTX)); 1033 ctx = (X509_STORE_CTX *)OPENSSL_malloc(sizeof(X509_STORE_CTX));
843 if (ctx) memset(ctx, 0, sizeof(X509_STORE_CTX)); 1034 if (!ctx)
1035 {
1036 X509err(X509_F_X509_STORE_CTX_NEW,ERR_R_MALLOC_FAILURE);
1037 return NULL;
1038 }
1039 memset(ctx, 0, sizeof(X509_STORE_CTX));
844 return ctx; 1040 return ctx;
845} 1041}
846 1042
@@ -850,7 +1046,7 @@ void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
850 OPENSSL_free(ctx); 1046 OPENSSL_free(ctx);
851} 1047}
852 1048
853void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, 1049int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
854 STACK_OF(X509) *chain) 1050 STACK_OF(X509) *chain)
855 { 1051 {
856 ctx->ctx=store; 1052 ctx->ctx=store;
@@ -858,10 +1054,7 @@ void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
858 ctx->cert=x509; 1054 ctx->cert=x509;
859 ctx->untrusted=chain; 1055 ctx->untrusted=chain;
860 ctx->last_untrusted=0; 1056 ctx->last_untrusted=0;
861 ctx->purpose=0;
862 ctx->trust=0;
863 ctx->check_time=0; 1057 ctx->check_time=0;
864 ctx->flags=0;
865 ctx->other_ctx=NULL; 1058 ctx->other_ctx=NULL;
866 ctx->valid=0; 1059 ctx->valid=0;
867 ctx->chain=NULL; 1060 ctx->chain=NULL;
@@ -870,12 +1063,80 @@ void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
870 ctx->error_depth=0; 1063 ctx->error_depth=0;
871 ctx->current_cert=NULL; 1064 ctx->current_cert=NULL;
872 ctx->current_issuer=NULL; 1065 ctx->current_issuer=NULL;
873 ctx->check_issued = check_issued; 1066
874 ctx->get_issuer = X509_STORE_CTX_get1_issuer; 1067 /* Inherit callbacks and flags from X509_STORE if not set
875 ctx->verify_cb = store->verify_cb; 1068 * use defaults.
876 ctx->verify = store->verify; 1069 */
877 ctx->cleanup = 0; 1070
878 memset(&(ctx->ex_data),0,sizeof(CRYPTO_EX_DATA)); 1071
1072 if (store)
1073 {
1074 ctx->purpose=store->purpose;
1075 ctx->trust=store->trust;
1076 ctx->flags = store->flags;
1077 ctx->cleanup = store->cleanup;
1078 }
1079 else
1080 {
1081 ctx->purpose = 0;
1082 ctx->trust = 0;
1083 ctx->flags = 0;
1084 ctx->cleanup = 0;
1085 }
1086
1087 if (store && store->check_issued)
1088 ctx->check_issued = store->check_issued;
1089 else
1090 ctx->check_issued = check_issued;
1091
1092 if (store && store->get_issuer)
1093 ctx->get_issuer = store->get_issuer;
1094 else
1095 ctx->get_issuer = X509_STORE_CTX_get1_issuer;
1096
1097 if (store && store->verify_cb)
1098 ctx->verify_cb = store->verify_cb;
1099 else
1100 ctx->verify_cb = null_callback;
1101
1102 if (store && store->verify)
1103 ctx->verify = store->verify;
1104 else
1105 ctx->verify = internal_verify;
1106
1107 if (store && store->check_revocation)
1108 ctx->check_revocation = store->check_revocation;
1109 else
1110 ctx->check_revocation = check_revocation;
1111
1112 if (store && store->get_crl)
1113 ctx->get_crl = store->get_crl;
1114 else
1115 ctx->get_crl = get_crl;
1116
1117 if (store && store->check_crl)
1118 ctx->check_crl = store->check_crl;
1119 else
1120 ctx->check_crl = check_crl;
1121
1122 if (store && store->cert_crl)
1123 ctx->cert_crl = store->cert_crl;
1124 else
1125 ctx->cert_crl = cert_crl;
1126
1127
1128 /* This memset() can't make any sense anyway, so it's removed. As
1129 * X509_STORE_CTX_cleanup does a proper "free" on the ex_data, we put a
1130 * corresponding "new" here and remove this bogus initialisation. */
1131 /* memset(&(ctx->ex_data),0,sizeof(CRYPTO_EX_DATA)); */
1132 if(!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE_CTX, ctx,
1133 &(ctx->ex_data)))
1134 {
1135 OPENSSL_free(ctx);
1136 X509err(X509_F_X509_STORE_CTX_INIT,ERR_R_MALLOC_FAILURE);
1137 return 0;
1138 }
1139 return 1;
879 } 1140 }
880 1141
881/* Set alternative lookup method: just a STACK of trusted certificates. 1142/* Set alternative lookup method: just a STACK of trusted certificates.
@@ -896,7 +1157,7 @@ void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx)
896 sk_X509_pop_free(ctx->chain,X509_free); 1157 sk_X509_pop_free(ctx->chain,X509_free);
897 ctx->chain=NULL; 1158 ctx->chain=NULL;
898 } 1159 }
899 CRYPTO_free_ex_data(x509_store_ctx_method,ctx,&(ctx->ex_data)); 1160 CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE_CTX, ctx, &(ctx->ex_data));
900 memset(&ctx->ex_data,0,sizeof(CRYPTO_EX_DATA)); 1161 memset(&ctx->ex_data,0,sizeof(CRYPTO_EX_DATA));
901 } 1162 }
902 1163
@@ -911,6 +1172,12 @@ void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, long flags, time_t t)
911 ctx->flags |= X509_V_FLAG_USE_CHECK_TIME; 1172 ctx->flags |= X509_V_FLAG_USE_CHECK_TIME;
912 } 1173 }
913 1174
1175void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,
1176 int (*verify_cb)(int, X509_STORE_CTX *))
1177 {
1178 ctx->verify_cb=verify_cb;
1179 }
1180
914IMPLEMENT_STACK_OF(X509) 1181IMPLEMENT_STACK_OF(X509)
915IMPLEMENT_ASN1_SET_OF(X509) 1182IMPLEMENT_ASN1_SET_OF(X509)
916 1183
diff --git a/src/lib/libcrypto/x509/x509_vfy.h b/src/lib/libcrypto/x509/x509_vfy.h
index e289d5309a..f0be21f452 100644
--- a/src/lib/libcrypto/x509/x509_vfy.h
+++ b/src/lib/libcrypto/x509/x509_vfy.h
@@ -65,11 +65,12 @@
65#ifndef HEADER_X509_VFY_H 65#ifndef HEADER_X509_VFY_H
66#define HEADER_X509_VFY_H 66#define HEADER_X509_VFY_H
67 67
68#ifndef NO_LHASH 68#ifndef OPENSSL_NO_LHASH
69#include <openssl/lhash.h> 69#include <openssl/lhash.h>
70#endif 70#endif
71#include <openssl/bio.h> 71#include <openssl/bio.h>
72#include <openssl/crypto.h> 72#include <openssl/crypto.h>
73#include <openssl/symhacks.h>
73 74
74#ifdef __cplusplus 75#ifdef __cplusplus
75extern "C" { 76extern "C" {
@@ -154,12 +155,10 @@ typedef struct x509_lookup_method_st
154 X509_OBJECT *ret); 155 X509_OBJECT *ret);
155 } X509_LOOKUP_METHOD; 156 } X509_LOOKUP_METHOD;
156 157
157typedef struct x509_store_ctx_st X509_STORE_CTX;
158
159/* This is used to hold everything. It is used for all certificate 158/* This is used to hold everything. It is used for all certificate
160 * validation. Once we have a certificate chain, the 'verify' 159 * validation. Once we have a certificate chain, the 'verify'
161 * function is then called to actually check the cert chain. */ 160 * function is then called to actually check the cert chain. */
162typedef struct x509_store_st 161struct x509_store_st
163 { 162 {
164 /* The following is a cache of trusted certs */ 163 /* The following is a cache of trusted certs */
165 int cache; /* if true, stash any hits */ 164 int cache; /* if true, stash any hits */
@@ -167,13 +166,29 @@ typedef struct x509_store_st
167 166
168 /* These are external lookup methods */ 167 /* These are external lookup methods */
169 STACK_OF(X509_LOOKUP) *get_cert_methods; 168 STACK_OF(X509_LOOKUP) *get_cert_methods;
169
170 /* The following fields are not used by X509_STORE but are
171 * inherited by X509_STORE_CTX when it is initialised.
172 */
173
174 unsigned long flags; /* Various verify flags */
175 int purpose;
176 int trust;
177 /* Callbacks for various operations */
170 int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */ 178 int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */
171 int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */ 179 int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */
180 int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */
181 int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */
182 int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */
183 int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */
184 int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */
185 int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */
186 int (*cleanup)(X509_STORE_CTX *ctx);
172 187
173 CRYPTO_EX_DATA ex_data; 188 CRYPTO_EX_DATA ex_data;
174 int references; 189 int references;
175 int depth; /* how deep to look (still unused -- X509_STORE_CTX's depth is used) */ 190 int depth; /* how deep to look (still unused -- X509_STORE_CTX's depth is used) */
176 } X509_STORE; 191 } /* X509_STORE */;
177 192
178#define X509_STORE_set_depth(ctx,d) ((ctx)->depth=(d)) 193#define X509_STORE_set_depth(ctx,d) ((ctx)->depth=(d))
179 194
@@ -189,7 +204,7 @@ struct x509_lookup_st
189 char *method_data; /* method data */ 204 char *method_data; /* method data */
190 205
191 X509_STORE *store_ctx; /* who owns us */ 206 X509_STORE *store_ctx; /* who owns us */
192 }; 207 } /* X509_LOOKUP */;
193 208
194/* This is a used when verifying cert chains. Since the 209/* This is a used when verifying cert chains. Since the
195 * gathering of the cert chain can take some time (and have to be 210 * gathering of the cert chain can take some time (and have to be
@@ -213,6 +228,10 @@ struct x509_store_ctx_st /* X509_STORE_CTX */
213 int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */ 228 int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */
214 int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */ 229 int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */
215 int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */ 230 int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */
231 int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */
232 int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */
233 int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */
234 int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */
216 int (*cleanup)(X509_STORE_CTX *ctx); 235 int (*cleanup)(X509_STORE_CTX *ctx);
217 236
218 /* The following is built up */ 237 /* The following is built up */
@@ -226,9 +245,10 @@ struct x509_store_ctx_st /* X509_STORE_CTX */
226 int error; 245 int error;
227 X509 *current_cert; 246 X509 *current_cert;
228 X509 *current_issuer; /* cert currently being tested as valid issuer */ 247 X509 *current_issuer; /* cert currently being tested as valid issuer */
248 X509_CRL *current_crl; /* current CRL */
229 249
230 CRYPTO_EX_DATA ex_data; 250 CRYPTO_EX_DATA ex_data;
231 }; 251 } /* X509_STORE_CTX */;
232 252
233#define X509_STORE_CTX_set_depth(ctx,d) ((ctx)->depth=(d)) 253#define X509_STORE_CTX_set_depth(ctx,d) ((ctx)->depth=(d))
234 254
@@ -282,6 +302,9 @@ struct x509_store_ctx_st /* X509_STORE_CTX */
282#define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31 302#define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31
283#define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32 303#define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32
284 304
305#define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33
306#define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34
307
285/* The application is not happy */ 308/* The application is not happy */
286#define X509_V_ERR_APPLICATION_VERIFICATION 50 309#define X509_V_ERR_APPLICATION_VERIFICATION 50
287 310
@@ -289,21 +312,9 @@ struct x509_store_ctx_st /* X509_STORE_CTX */
289 312
290#define X509_V_FLAG_CB_ISSUER_CHECK 0x1 /* Send issuer+subject checks to verify_cb */ 313#define X509_V_FLAG_CB_ISSUER_CHECK 0x1 /* Send issuer+subject checks to verify_cb */
291#define X509_V_FLAG_USE_CHECK_TIME 0x2 /* Use check time instead of current time */ 314#define X509_V_FLAG_USE_CHECK_TIME 0x2 /* Use check time instead of current time */
292 315#define X509_V_FLAG_CRL_CHECK 0x4 /* Lookup CRLs */
293 /* These functions are being redefined in another directory, 316#define X509_V_FLAG_CRL_CHECK_ALL 0x8 /* Lookup CRLs for whole chain */
294 and clash when the linker is case-insensitive, so let's 317#define X509_V_FLAG_IGNORE_CRITICAL 0x10 /* Ignore unhandled critical extensions */
295 hide them a little, by giving them an extra 'o' at the
296 beginning of the name... */
297#ifdef VMS
298#undef X509v3_cleanup_extensions
299#define X509v3_cleanup_extensions oX509v3_cleanup_extensions
300#undef X509v3_add_extension
301#define X509v3_add_extension oX509v3_add_extension
302#undef X509v3_add_netscape_extensions
303#define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions
304#undef X509v3_add_standard_extensions
305#define X509v3_add_standard_extensions oX509v3_add_standard_extensions
306#endif
307 318
308int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type, 319int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type,
309 X509_NAME *name); 320 X509_NAME *name);
@@ -314,12 +325,16 @@ void X509_OBJECT_free_contents(X509_OBJECT *a);
314X509_STORE *X509_STORE_new(void ); 325X509_STORE *X509_STORE_new(void );
315void X509_STORE_free(X509_STORE *v); 326void X509_STORE_free(X509_STORE *v);
316 327
328void X509_STORE_set_flags(X509_STORE *ctx, long flags);
329int X509_STORE_set_purpose(X509_STORE *ctx, int purpose);
330int X509_STORE_set_trust(X509_STORE *ctx, int trust);
331
317X509_STORE_CTX *X509_STORE_CTX_new(void); 332X509_STORE_CTX *X509_STORE_CTX_new(void);
318 333
319int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); 334int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
320 335
321void X509_STORE_CTX_free(X509_STORE_CTX *ctx); 336void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
322void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, 337int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store,
323 X509 *x509, STACK_OF(X509) *chain); 338 X509 *x509, STACK_OF(X509) *chain);
324void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); 339void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
325void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); 340void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
@@ -338,7 +353,7 @@ int X509_STORE_get_by_subject(X509_STORE_CTX *vs,int type,X509_NAME *name,
338int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, 353int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
339 long argl, char **ret); 354 long argl, char **ret);
340 355
341#ifndef NO_STDIO 356#ifndef OPENSSL_NO_STDIO
342int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type); 357int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
343int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type); 358int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
344int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type); 359int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
@@ -358,7 +373,7 @@ int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str,
358 int len, X509_OBJECT *ret); 373 int len, X509_OBJECT *ret);
359int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); 374int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
360 375
361#ifndef NO_STDIO 376#ifndef OPENSSL_NO_STDIO
362int X509_STORE_load_locations (X509_STORE *ctx, 377int X509_STORE_load_locations (X509_STORE *ctx,
363 const char *file, const char *dir); 378 const char *file, const char *dir);
364int X509_STORE_set_default_paths(X509_STORE *ctx); 379int X509_STORE_set_default_paths(X509_STORE *ctx);
@@ -382,6 +397,8 @@ int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
382 int purpose, int trust); 397 int purpose, int trust);
383void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, long flags); 398void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, long flags);
384void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, long flags, time_t t); 399void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, long flags, time_t t);
400void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,
401 int (*verify_cb)(int, X509_STORE_CTX *));
385 402
386#ifdef __cplusplus 403#ifdef __cplusplus
387} 404}
diff --git a/src/lib/libcrypto/x509/x509cset.c b/src/lib/libcrypto/x509/x509cset.c
new file mode 100644
index 0000000000..6cac440ea9
--- /dev/null
+++ b/src/lib/libcrypto/x509/x509cset.c
@@ -0,0 +1,169 @@
1/* crypto/x509/x509cset.c */
2/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
3 * project 2001.
4 */
5/* ====================================================================
6 * Copyright (c) 2001 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/asn1.h>
62#include <openssl/objects.h>
63#include <openssl/evp.h>
64#include <openssl/x509.h>
65
66int X509_CRL_set_version(X509_CRL *x, long version)
67 {
68 if (x == NULL) return(0);
69 if (x->crl->version == NULL)
70 {
71 if ((x->crl->version=M_ASN1_INTEGER_new()) == NULL)
72 return(0);
73 }
74 return(ASN1_INTEGER_set(x->crl->version,version));
75 }
76
77int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name)
78 {
79 if ((x == NULL) || (x->crl == NULL)) return(0);
80 return(X509_NAME_set(&x->crl->issuer,name));
81 }
82
83
84int X509_CRL_set_lastUpdate(X509_CRL *x, ASN1_TIME *tm)
85 {
86 ASN1_TIME *in;
87
88 if (x == NULL) return(0);
89 in=x->crl->lastUpdate;
90 if (in != tm)
91 {
92 in=M_ASN1_TIME_dup(tm);
93 if (in != NULL)
94 {
95 M_ASN1_TIME_free(x->crl->lastUpdate);
96 x->crl->lastUpdate=in;
97 }
98 }
99 return(in != NULL);
100 }
101
102int X509_CRL_set_nextUpdate(X509_CRL *x, ASN1_TIME *tm)
103 {
104 ASN1_TIME *in;
105
106 if (x == NULL) return(0);
107 in=x->crl->nextUpdate;
108 if (in != tm)
109 {
110 in=M_ASN1_TIME_dup(tm);
111 if (in != NULL)
112 {
113 M_ASN1_TIME_free(x->crl->nextUpdate);
114 x->crl->nextUpdate=in;
115 }
116 }
117 return(in != NULL);
118 }
119
120int X509_CRL_sort(X509_CRL *c)
121 {
122 int i;
123 X509_REVOKED *r;
124 /* sort the data so it will be written in serial
125 * number order */
126 sk_X509_REVOKED_sort(c->crl->revoked);
127 for (i=0; i<sk_X509_REVOKED_num(c->crl->revoked); i++)
128 {
129 r=sk_X509_REVOKED_value(c->crl->revoked,i);
130 r->sequence=i;
131 }
132 return 1;
133 }
134
135int X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm)
136 {
137 ASN1_TIME *in;
138
139 if (x == NULL) return(0);
140 in=x->revocationDate;
141 if (in != tm)
142 {
143 in=M_ASN1_TIME_dup(tm);
144 if (in != NULL)
145 {
146 M_ASN1_TIME_free(x->revocationDate);
147 x->revocationDate=in;
148 }
149 }
150 return(in != NULL);
151 }
152
153int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial)
154 {
155 ASN1_INTEGER *in;
156
157 if (x == NULL) return(0);
158 in=x->serialNumber;
159 if (in != serial)
160 {
161 in=M_ASN1_INTEGER_dup(serial);
162 if (in != NULL)
163 {
164 M_ASN1_INTEGER_free(x->serialNumber);
165 x->serialNumber=in;
166 }
167 }
168 return(in != NULL);
169 }
diff --git a/src/lib/libcrypto/x509/x509spki.c b/src/lib/libcrypto/x509/x509spki.c
index fd0a534d88..4c3af946ec 100644
--- a/src/lib/libcrypto/x509/x509spki.c
+++ b/src/lib/libcrypto/x509/x509spki.c
@@ -59,7 +59,6 @@
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/x509.h> 61#include <openssl/x509.h>
62#include <openssl/asn1_mac.h>
63 62
64int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey) 63int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey)
65{ 64{
diff --git a/src/lib/libcrypto/x509/x_all.c b/src/lib/libcrypto/x509/x_all.c
index 9bd6e2a39b..fb5015cd4d 100644
--- a/src/lib/libcrypto/x509/x_all.c
+++ b/src/lib/libcrypto/x509/x_all.c
@@ -67,224 +67,159 @@
67 67
68int X509_verify(X509 *a, EVP_PKEY *r) 68int X509_verify(X509 *a, EVP_PKEY *r)
69 { 69 {
70 return(ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg, 70 return(ASN1_item_verify(ASN1_ITEM_rptr(X509_CINF),a->sig_alg,
71 a->signature,(char *)a->cert_info,r)); 71 a->signature,a->cert_info,r));
72 } 72 }
73 73
74int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r) 74int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r)
75 { 75 {
76 return( ASN1_verify((int (*)())i2d_X509_REQ_INFO, 76 return( ASN1_item_verify(ASN1_ITEM_rptr(X509_REQ_INFO),
77 a->sig_alg,a->signature,(char *)a->req_info,r)); 77 a->sig_alg,a->signature,a->req_info,r));
78 } 78 }
79 79
80int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r) 80int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r)
81 { 81 {
82 return(ASN1_verify((int (*)())i2d_X509_CRL_INFO, 82 return(ASN1_item_verify(ASN1_ITEM_rptr(X509_CRL_INFO),
83 a->sig_alg, a->signature,(char *)a->crl,r)); 83 a->sig_alg, a->signature,a->crl,r));
84 } 84 }
85 85
86int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r) 86int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r)
87 { 87 {
88 return(ASN1_verify((int (*)())i2d_NETSCAPE_SPKAC, 88 return(ASN1_item_verify(ASN1_ITEM_rptr(NETSCAPE_SPKAC),
89 a->sig_algor,a->signature, (char *)a->spkac,r)); 89 a->sig_algor,a->signature,a->spkac,r));
90 } 90 }
91 91
92int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) 92int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md)
93 { 93 {
94 return(ASN1_sign((int (*)())i2d_X509_CINF, x->cert_info->signature, 94 return(ASN1_item_sign(ASN1_ITEM_rptr(X509_CINF), x->cert_info->signature,
95 x->sig_alg, x->signature, (char *)x->cert_info,pkey,md)); 95 x->sig_alg, x->signature, x->cert_info,pkey,md));
96 } 96 }
97 97
98int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md) 98int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md)
99 { 99 {
100 return(ASN1_sign((int (*)())i2d_X509_REQ_INFO,x->sig_alg, NULL, 100 return(ASN1_item_sign(ASN1_ITEM_rptr(X509_REQ_INFO),x->sig_alg, NULL,
101 x->signature, (char *)x->req_info,pkey,md)); 101 x->signature, x->req_info,pkey,md));
102 } 102 }
103 103
104int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md) 104int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md)
105 { 105 {
106 return(ASN1_sign((int (*)())i2d_X509_CRL_INFO,x->crl->sig_alg, 106 return(ASN1_item_sign(ASN1_ITEM_rptr(X509_CRL_INFO),x->crl->sig_alg,
107 x->sig_alg, x->signature, (char *)x->crl,pkey,md)); 107 x->sig_alg, x->signature, x->crl,pkey,md));
108 } 108 }
109 109
110int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md) 110int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md)
111 { 111 {
112 return(ASN1_sign((int (*)())i2d_NETSCAPE_SPKAC, x->sig_algor,NULL, 112 return(ASN1_item_sign(ASN1_ITEM_rptr(NETSCAPE_SPKAC), x->sig_algor,NULL,
113 x->signature, (char *)x->spkac,pkey,md)); 113 x->signature, x->spkac,pkey,md));
114 } 114 }
115 115
116X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa) 116#ifndef OPENSSL_NO_FP_API
117 {
118 return((X509_ATTRIBUTE *)ASN1_dup((int (*)())i2d_X509_ATTRIBUTE,
119 (char *(*)())d2i_X509_ATTRIBUTE,(char *)xa));
120 }
121
122X509 *X509_dup(X509 *x509)
123 {
124 return((X509 *)ASN1_dup((int (*)())i2d_X509,
125 (char *(*)())d2i_X509,(char *)x509));
126 }
127
128X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex)
129 {
130 return((X509_EXTENSION *)ASN1_dup(
131 (int (*)())i2d_X509_EXTENSION,
132 (char *(*)())d2i_X509_EXTENSION,(char *)ex));
133 }
134
135#ifndef NO_FP_API
136X509 *d2i_X509_fp(FILE *fp, X509 **x509) 117X509 *d2i_X509_fp(FILE *fp, X509 **x509)
137 { 118 {
138 return((X509 *)ASN1_d2i_fp((char *(*)())X509_new, 119 return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509), fp, x509);
139 (char *(*)())d2i_X509, (fp),(unsigned char **)(x509)));
140 } 120 }
141 121
142int i2d_X509_fp(FILE *fp, X509 *x509) 122int i2d_X509_fp(FILE *fp, X509 *x509)
143 { 123 {
144 return(ASN1_i2d_fp(i2d_X509,fp,(unsigned char *)x509)); 124 return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509), fp, x509);
145 } 125 }
146#endif 126#endif
147 127
148X509 *d2i_X509_bio(BIO *bp, X509 **x509) 128X509 *d2i_X509_bio(BIO *bp, X509 **x509)
149 { 129 {
150 return((X509 *)ASN1_d2i_bio((char *(*)())X509_new, 130 return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509), bp, x509);
151 (char *(*)())d2i_X509, (bp),(unsigned char **)(x509)));
152 } 131 }
153 132
154int i2d_X509_bio(BIO *bp, X509 *x509) 133int i2d_X509_bio(BIO *bp, X509 *x509)
155 { 134 {
156 return(ASN1_i2d_bio(i2d_X509,bp,(unsigned char *)x509)); 135 return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509), bp, x509);
157 }
158
159X509_CRL *X509_CRL_dup(X509_CRL *crl)
160 {
161 return((X509_CRL *)ASN1_dup((int (*)())i2d_X509_CRL,
162 (char *(*)())d2i_X509_CRL,(char *)crl));
163 } 136 }
164 137
165#ifndef NO_FP_API 138#ifndef OPENSSL_NO_FP_API
166X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl) 139X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl)
167 { 140 {
168 return((X509_CRL *)ASN1_d2i_fp((char *(*)()) 141 return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509_CRL), fp, crl);
169 X509_CRL_new,(char *(*)())d2i_X509_CRL, (fp),
170 (unsigned char **)(crl)));
171 } 142 }
172 143
173int i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl) 144int i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl)
174 { 145 {
175 return(ASN1_i2d_fp(i2d_X509_CRL,fp,(unsigned char *)crl)); 146 return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509_CRL), fp, crl);
176 } 147 }
177#endif 148#endif
178 149
179X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl) 150X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl)
180 { 151 {
181 return((X509_CRL *)ASN1_d2i_bio((char *(*)()) 152 return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_CRL), bp, crl);
182 X509_CRL_new,(char *(*)())d2i_X509_CRL, (bp),
183 (unsigned char **)(crl)));
184 } 153 }
185 154
186int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl) 155int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl)
187 { 156 {
188 return(ASN1_i2d_bio(i2d_X509_CRL,bp,(unsigned char *)crl)); 157 return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_CRL), bp, crl);
189 }
190
191PKCS7 *PKCS7_dup(PKCS7 *p7)
192 {
193 return((PKCS7 *)ASN1_dup((int (*)())i2d_PKCS7,
194 (char *(*)())d2i_PKCS7,(char *)p7));
195 } 158 }
196 159
197#ifndef NO_FP_API 160#ifndef OPENSSL_NO_FP_API
198PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7) 161PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7)
199 { 162 {
200 return((PKCS7 *)ASN1_d2i_fp((char *(*)()) 163 return ASN1_item_d2i_fp(ASN1_ITEM_rptr(PKCS7), fp, p7);
201 PKCS7_new,(char *(*)())d2i_PKCS7, (fp),
202 (unsigned char **)(p7)));
203 } 164 }
204 165
205int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7) 166int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7)
206 { 167 {
207 return(ASN1_i2d_fp(i2d_PKCS7,fp,(unsigned char *)p7)); 168 return ASN1_item_i2d_fp(ASN1_ITEM_rptr(PKCS7), fp, p7);
208 } 169 }
209#endif 170#endif
210 171
211PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7) 172PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7)
212 { 173 {
213 return((PKCS7 *)ASN1_d2i_bio((char *(*)()) 174 return ASN1_item_d2i_bio(ASN1_ITEM_rptr(PKCS7), bp, p7);
214 PKCS7_new,(char *(*)())d2i_PKCS7, (bp),
215 (unsigned char **)(p7)));
216 } 175 }
217 176
218int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7) 177int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7)
219 { 178 {
220 return(ASN1_i2d_bio(i2d_PKCS7,bp,(unsigned char *)p7)); 179 return ASN1_item_i2d_bio(ASN1_ITEM_rptr(PKCS7), bp, p7);
221 } 180 }
222 181
223X509_REQ *X509_REQ_dup(X509_REQ *req) 182#ifndef OPENSSL_NO_FP_API
224 {
225 return((X509_REQ *)ASN1_dup((int (*)())i2d_X509_REQ,
226 (char *(*)())d2i_X509_REQ,(char *)req));
227 }
228
229#ifndef NO_FP_API
230X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req) 183X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req)
231 { 184 {
232 return((X509_REQ *)ASN1_d2i_fp((char *(*)()) 185 return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509_REQ), fp, req);
233 X509_REQ_new, (char *(*)())d2i_X509_REQ, (fp),
234 (unsigned char **)(req)));
235 } 186 }
236 187
237int i2d_X509_REQ_fp(FILE *fp, X509_REQ *req) 188int i2d_X509_REQ_fp(FILE *fp, X509_REQ *req)
238 { 189 {
239 return(ASN1_i2d_fp(i2d_X509_REQ,fp,(unsigned char *)req)); 190 return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509_REQ), fp, req);
240 } 191 }
241#endif 192#endif
242 193
243X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req) 194X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req)
244 { 195 {
245 return((X509_REQ *)ASN1_d2i_bio((char *(*)()) 196 return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_REQ), bp, req);
246 X509_REQ_new, (char *(*)())d2i_X509_REQ, (bp),
247 (unsigned char **)(req)));
248 } 197 }
249 198
250int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req) 199int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req)
251 { 200 {
252 return(ASN1_i2d_bio(i2d_X509_REQ,bp,(unsigned char *)req)); 201 return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_REQ), bp, req);
253 }
254
255#ifndef NO_RSA
256RSA *RSAPublicKey_dup(RSA *rsa)
257 {
258 return((RSA *)ASN1_dup((int (*)())i2d_RSAPublicKey,
259 (char *(*)())d2i_RSAPublicKey,(char *)rsa));
260 } 202 }
261 203
262RSA *RSAPrivateKey_dup(RSA *rsa) 204#ifndef OPENSSL_NO_RSA
263 {
264 return((RSA *)ASN1_dup((int (*)())i2d_RSAPrivateKey,
265 (char *(*)())d2i_RSAPrivateKey,(char *)rsa));
266 }
267 205
268#ifndef NO_FP_API 206#ifndef OPENSSL_NO_FP_API
269RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa) 207RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa)
270 { 208 {
271 return((RSA *)ASN1_d2i_fp((char *(*)()) 209 return ASN1_item_d2i_fp(ASN1_ITEM_rptr(RSAPrivateKey), fp, rsa);
272 RSA_new,(char *(*)())d2i_RSAPrivateKey, (fp),
273 (unsigned char **)(rsa)));
274 } 210 }
275 211
276int i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa) 212int i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa)
277 { 213 {
278 return(ASN1_i2d_fp(i2d_RSAPrivateKey,fp,(unsigned char *)rsa)); 214 return ASN1_item_i2d_fp(ASN1_ITEM_rptr(RSAPrivateKey), fp, rsa);
279 } 215 }
280 216
281RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa) 217RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa)
282 { 218 {
283 return((RSA *)ASN1_d2i_fp((char *(*)()) 219 return ASN1_item_d2i_fp(ASN1_ITEM_rptr(RSAPublicKey), fp, rsa);
284 RSA_new,(char *(*)())d2i_RSAPublicKey, (fp),
285 (unsigned char **)(rsa)));
286 } 220 }
287 221
222
288RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa) 223RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa)
289 { 224 {
290 return((RSA *)ASN1_d2i_fp((char *(*)()) 225 return((RSA *)ASN1_d2i_fp((char *(*)())
@@ -294,7 +229,7 @@ RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa)
294 229
295int i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa) 230int i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa)
296 { 231 {
297 return(ASN1_i2d_fp(i2d_RSAPublicKey,fp,(unsigned char *)rsa)); 232 return ASN1_item_i2d_fp(ASN1_ITEM_rptr(RSAPublicKey), fp, rsa);
298 } 233 }
299 234
300int i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa) 235int i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa)
@@ -305,23 +240,20 @@ int i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa)
305 240
306RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa) 241RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa)
307 { 242 {
308 return((RSA *)ASN1_d2i_bio((char *(*)()) 243 return ASN1_item_d2i_bio(ASN1_ITEM_rptr(RSAPrivateKey), bp, rsa);
309 RSA_new,(char *(*)())d2i_RSAPrivateKey, (bp),
310 (unsigned char **)(rsa)));
311 } 244 }
312 245
313int i2d_RSAPrivateKey_bio(BIO *bp, RSA *rsa) 246int i2d_RSAPrivateKey_bio(BIO *bp, RSA *rsa)
314 { 247 {
315 return(ASN1_i2d_bio(i2d_RSAPrivateKey,bp,(unsigned char *)rsa)); 248 return ASN1_item_i2d_bio(ASN1_ITEM_rptr(RSAPrivateKey), bp, rsa);
316 } 249 }
317 250
318RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa) 251RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa)
319 { 252 {
320 return((RSA *)ASN1_d2i_bio((char *(*)()) 253 return ASN1_item_d2i_bio(ASN1_ITEM_rptr(RSAPublicKey), bp, rsa);
321 RSA_new,(char *(*)())d2i_RSAPublicKey, (bp),
322 (unsigned char **)(rsa)));
323 } 254 }
324 255
256
325RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa) 257RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa)
326 { 258 {
327 return((RSA *)ASN1_d2i_bio((char *(*)()) 259 return((RSA *)ASN1_d2i_bio((char *(*)())
@@ -331,7 +263,7 @@ RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa)
331 263
332int i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa) 264int i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa)
333 { 265 {
334 return(ASN1_i2d_bio(i2d_RSAPublicKey,bp,(unsigned char *)rsa)); 266 return ASN1_item_i2d_bio(ASN1_ITEM_rptr(RSAPublicKey), bp, rsa);
335 } 267 }
336 268
337int i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa) 269int i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa)
@@ -340,8 +272,8 @@ int i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa)
340 } 272 }
341#endif 273#endif
342 274
343#ifndef NO_DSA 275#ifndef OPENSSL_NO_DSA
344#ifndef NO_FP_API 276#ifndef OPENSSL_NO_FP_API
345DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa) 277DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa)
346 { 278 {
347 return((DSA *)ASN1_d2i_fp((char *(*)()) 279 return((DSA *)ASN1_d2i_fp((char *(*)())
@@ -393,57 +325,48 @@ int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa)
393 325
394#endif 326#endif
395 327
396X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn) 328int X509_pubkey_digest(const X509 *data, const EVP_MD *type, unsigned char *md,
397 { 329 unsigned int *len)
398 return((X509_ALGOR *)ASN1_dup((int (*)())i2d_X509_ALGOR,
399 (char *(*)())d2i_X509_ALGOR,(char *)xn));
400 }
401
402X509_NAME *X509_NAME_dup(X509_NAME *xn)
403 {
404 return((X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME,
405 (char *(*)())d2i_X509_NAME,(char *)xn));
406 }
407
408X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne)
409 { 330 {
410 return((X509_NAME_ENTRY *)ASN1_dup((int (*)())i2d_X509_NAME_ENTRY, 331 ASN1_BIT_STRING *key;
411 (char *(*)())d2i_X509_NAME_ENTRY,(char *)ne)); 332 key = X509_get0_pubkey_bitstr(data);
333 if(!key) return 0;
334 return EVP_Digest(key->data, key->length, md, len, type, NULL);
412 } 335 }
413 336
414int X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md, 337int X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md,
415 unsigned int *len) 338 unsigned int *len)
416 { 339 {
417 return(ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len)); 340 return(ASN1_item_digest(ASN1_ITEM_rptr(X509),type,(char *)data,md,len));
418 } 341 }
419 342
420int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, unsigned char *md, 343int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, unsigned char *md,
421 unsigned int *len) 344 unsigned int *len)
422 { 345 {
423 return(ASN1_digest((int (*)())i2d_X509_CRL,type,(char *)data,md,len)); 346 return(ASN1_item_digest(ASN1_ITEM_rptr(X509_CRL),type,(char *)data,md,len));
424 } 347 }
425 348
426int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, unsigned char *md, 349int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, unsigned char *md,
427 unsigned int *len) 350 unsigned int *len)
428 { 351 {
429 return(ASN1_digest((int (*)())i2d_X509_REQ,type,(char *)data,md,len)); 352 return(ASN1_item_digest(ASN1_ITEM_rptr(X509_REQ),type,(char *)data,md,len));
430 } 353 }
431 354
432int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, unsigned char *md, 355int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, unsigned char *md,
433 unsigned int *len) 356 unsigned int *len)
434 { 357 {
435 return(ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len)); 358 return(ASN1_item_digest(ASN1_ITEM_rptr(X509_NAME),type,(char *)data,md,len));
436 } 359 }
437 360
438int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data, const EVP_MD *type, 361int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data, const EVP_MD *type,
439 unsigned char *md, unsigned int *len) 362 unsigned char *md, unsigned int *len)
440 { 363 {
441 return(ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type, 364 return(ASN1_item_digest(ASN1_ITEM_rptr(PKCS7_ISSUER_AND_SERIAL),type,
442 (char *)data,md,len)); 365 (char *)data,md,len));
443 } 366 }
444 367
445 368
446#ifndef NO_FP_API 369#ifndef OPENSSL_NO_FP_API
447X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8) 370X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8)
448 { 371 {
449 return((X509_SIG *)ASN1_d2i_fp((char *(*)())X509_SIG_new, 372 return((X509_SIG *)ASN1_d2i_fp((char *(*)())X509_SIG_new,
@@ -467,7 +390,7 @@ int i2d_PKCS8_bio(BIO *bp, X509_SIG *p8)
467 return(ASN1_i2d_bio(i2d_X509_SIG,bp,(unsigned char *)p8)); 390 return(ASN1_i2d_bio(i2d_X509_SIG,bp,(unsigned char *)p8));
468 } 391 }
469 392
470#ifndef NO_FP_API 393#ifndef OPENSSL_NO_FP_API
471PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, 394PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
472 PKCS8_PRIV_KEY_INFO **p8inf) 395 PKCS8_PRIV_KEY_INFO **p8inf)
473 { 396 {