summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ocsp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ocsp')
-rw-r--r--src/lib/libcrypto/ocsp/Makefile.ssl293
-rw-r--r--src/lib/libcrypto/ocsp/ocsp.h22
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_cl.c1
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_err.c3
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_ext.c47
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_ht.c56
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_lib.c3
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_prn.c23
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_vfy.c4
9 files changed, 82 insertions, 370 deletions
diff --git a/src/lib/libcrypto/ocsp/Makefile.ssl b/src/lib/libcrypto/ocsp/Makefile.ssl
deleted file mode 100644
index 02477be538..0000000000
--- a/src/lib/libcrypto/ocsp/Makefile.ssl
+++ /dev/null
@@ -1,293 +0,0 @@
1#
2# OpenSSL/ocsp/Makefile.ssl
3#
4
5DIR= ocsp
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I$(TOP) -I../../include
9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl
12INSTALLTOP=/usr/local/ssl
13MAKE= make -f Makefile.ssl
14MAKEDEPPROG= makedepend
15MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
16MAKEFILE= Makefile.ssl
17AR= ar r
18
19CFLAGS= $(INCLUDES) $(CFLAG)
20
21GENERAL=Makefile README
22TEST=
23APPS=
24
25LIB=$(TOP)/libcrypto.a
26LIBSRC= ocsp_asn.c ocsp_ext.c ocsp_ht.c ocsp_lib.c ocsp_cl.c \
27 ocsp_srv.c ocsp_prn.c ocsp_vfy.c ocsp_err.c
28
29LIBOBJ= ocsp_asn.o ocsp_ext.o ocsp_ht.o ocsp_lib.o ocsp_cl.o \
30 ocsp_srv.o ocsp_prn.o ocsp_vfy.o ocsp_err.o
31
32SRC= $(LIBSRC)
33
34EXHEADER= ocsp.h
35HEADER= $(EXHEADER)
36
37ALL= $(GENERAL) $(SRC) $(HEADER)
38
39top:
40 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
41
42all: lib
43
44lib: $(LIBOBJ)
45 $(AR) $(LIB) $(LIBOBJ)
46 $(RANLIB) $(LIB) || echo Never mind.
47 @touch lib
48
49files:
50 $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
51
52links:
53 @sh $(TOP)/util/point.sh Makefile.ssl Makefile ;
54 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
55 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
56 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
57
58install:
59 @for i in $(EXHEADER) ; \
60 do \
61 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
62 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
63 done;
64
65tags:
66 ctags $(SRC)
67
68tests:
69
70lint:
71 lint -DLINT $(INCLUDES) $(SRC)>fluff
72
73depend:
74 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
75
76dclean:
77 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
78 mv -f Makefile.new $(MAKEFILE)
79
80clean:
81 rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
82
83# DO NOT DELETE THIS LINE -- make depend depends on it.
84
85ocsp_asn.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
86ocsp_asn.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
87ocsp_asn.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
88ocsp_asn.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
89ocsp_asn.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
90ocsp_asn.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
91ocsp_asn.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
92ocsp_asn.o: ../../include/openssl/e_os2.h ../../include/openssl/evp.h
93ocsp_asn.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
94ocsp_asn.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
95ocsp_asn.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
96ocsp_asn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
97ocsp_asn.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
98ocsp_asn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
99ocsp_asn.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
100ocsp_asn.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
101ocsp_asn.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
102ocsp_asn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
103ocsp_asn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
104ocsp_asn.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
105ocsp_asn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
106ocsp_asn.o: ../../include/openssl/x509v3.h ocsp_asn.c
107ocsp_cl.o: ../../e_os.h ../../include/openssl/aes.h
108ocsp_cl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
109ocsp_cl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
110ocsp_cl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
111ocsp_cl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
112ocsp_cl.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
113ocsp_cl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
114ocsp_cl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
115ocsp_cl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
116ocsp_cl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
117ocsp_cl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
118ocsp_cl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
119ocsp_cl.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
120ocsp_cl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
121ocsp_cl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
122ocsp_cl.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
123ocsp_cl.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
124ocsp_cl.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
125ocsp_cl.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
126ocsp_cl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
127ocsp_cl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
128ocsp_cl.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
129ocsp_cl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
130ocsp_cl.o: ../../include/openssl/x509v3.h ../cryptlib.h ocsp_cl.c
131ocsp_err.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
132ocsp_err.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
133ocsp_err.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
134ocsp_err.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
135ocsp_err.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
136ocsp_err.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
137ocsp_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
138ocsp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
139ocsp_err.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
140ocsp_err.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
141ocsp_err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
142ocsp_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
143ocsp_err.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
144ocsp_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
145ocsp_err.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
146ocsp_err.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
147ocsp_err.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
148ocsp_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
149ocsp_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
150ocsp_err.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
151ocsp_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
152ocsp_err.o: ../../include/openssl/x509v3.h ocsp_err.c
153ocsp_ext.o: ../../e_os.h ../../include/openssl/aes.h
154ocsp_ext.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
155ocsp_ext.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
156ocsp_ext.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
157ocsp_ext.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
158ocsp_ext.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
159ocsp_ext.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
160ocsp_ext.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
161ocsp_ext.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
162ocsp_ext.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
163ocsp_ext.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
164ocsp_ext.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
165ocsp_ext.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
166ocsp_ext.o: ../../include/openssl/opensslconf.h
167ocsp_ext.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
168ocsp_ext.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
169ocsp_ext.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
170ocsp_ext.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
171ocsp_ext.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
172ocsp_ext.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
173ocsp_ext.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
174ocsp_ext.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
175ocsp_ext.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
176ocsp_ext.o: ../cryptlib.h ocsp_ext.c
177ocsp_ht.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
178ocsp_ht.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
179ocsp_ht.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
180ocsp_ht.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
181ocsp_ht.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
182ocsp_ht.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
183ocsp_ht.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
184ocsp_ht.o: ../../include/openssl/err.h ../../include/openssl/evp.h
185ocsp_ht.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
186ocsp_ht.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
187ocsp_ht.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
188ocsp_ht.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
189ocsp_ht.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
190ocsp_ht.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
191ocsp_ht.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
192ocsp_ht.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
193ocsp_ht.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
194ocsp_ht.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
195ocsp_ht.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
196ocsp_ht.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
197ocsp_ht.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
198ocsp_ht.o: ../../include/openssl/x509v3.h ocsp_ht.c
199ocsp_lib.o: ../../e_os.h ../../include/openssl/aes.h
200ocsp_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
201ocsp_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
202ocsp_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
203ocsp_lib.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
204ocsp_lib.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
205ocsp_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
206ocsp_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
207ocsp_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
208ocsp_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
209ocsp_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
210ocsp_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
211ocsp_lib.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
212ocsp_lib.o: ../../include/openssl/opensslconf.h
213ocsp_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
214ocsp_lib.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
215ocsp_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
216ocsp_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
217ocsp_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
218ocsp_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
219ocsp_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
220ocsp_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
221ocsp_lib.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
222ocsp_lib.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
223ocsp_lib.o: ../cryptlib.h ocsp_lib.c
224ocsp_prn.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
225ocsp_prn.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
226ocsp_prn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
227ocsp_prn.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
228ocsp_prn.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
229ocsp_prn.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
230ocsp_prn.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
231ocsp_prn.o: ../../include/openssl/err.h ../../include/openssl/evp.h
232ocsp_prn.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
233ocsp_prn.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
234ocsp_prn.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
235ocsp_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
236ocsp_prn.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
237ocsp_prn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
238ocsp_prn.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
239ocsp_prn.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
240ocsp_prn.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
241ocsp_prn.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
242ocsp_prn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
243ocsp_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
244ocsp_prn.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
245ocsp_prn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
246ocsp_prn.o: ../../include/openssl/x509v3.h ocsp_prn.c
247ocsp_srv.o: ../../e_os.h ../../include/openssl/aes.h
248ocsp_srv.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
249ocsp_srv.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
250ocsp_srv.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
251ocsp_srv.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
252ocsp_srv.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
253ocsp_srv.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
254ocsp_srv.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
255ocsp_srv.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
256ocsp_srv.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
257ocsp_srv.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
258ocsp_srv.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
259ocsp_srv.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
260ocsp_srv.o: ../../include/openssl/opensslconf.h
261ocsp_srv.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
262ocsp_srv.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
263ocsp_srv.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
264ocsp_srv.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
265ocsp_srv.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
266ocsp_srv.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
267ocsp_srv.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
268ocsp_srv.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
269ocsp_srv.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
270ocsp_srv.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
271ocsp_srv.o: ../cryptlib.h ocsp_srv.c
272ocsp_vfy.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
273ocsp_vfy.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
274ocsp_vfy.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
275ocsp_vfy.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
276ocsp_vfy.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
277ocsp_vfy.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
278ocsp_vfy.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
279ocsp_vfy.o: ../../include/openssl/err.h ../../include/openssl/evp.h
280ocsp_vfy.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
281ocsp_vfy.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
282ocsp_vfy.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
283ocsp_vfy.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
284ocsp_vfy.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
285ocsp_vfy.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
286ocsp_vfy.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
287ocsp_vfy.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
288ocsp_vfy.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
289ocsp_vfy.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
290ocsp_vfy.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
291ocsp_vfy.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
292ocsp_vfy.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
293ocsp_vfy.o: ../../include/openssl/x509v3.h ocsp_vfy.c
diff --git a/src/lib/libcrypto/ocsp/ocsp.h b/src/lib/libcrypto/ocsp/ocsp.h
index a0577a717e..31e45744ba 100644
--- a/src/lib/libcrypto/ocsp/ocsp.h
+++ b/src/lib/libcrypto/ocsp/ocsp.h
@@ -64,6 +64,7 @@
64#ifndef HEADER_OCSP_H 64#ifndef HEADER_OCSP_H
65#define HEADER_OCSP_H 65#define HEADER_OCSP_H
66 66
67#include <openssl/ossl_typ.h>
67#include <openssl/x509.h> 68#include <openssl/x509.h>
68#include <openssl/x509v3.h> 69#include <openssl/x509v3.h>
69#include <openssl/safestack.h> 70#include <openssl/safestack.h>
@@ -394,17 +395,20 @@ typedef struct ocsp_service_locator_st
394#define ASN1_BIT_STRING_digest(data,type,md,len) \ 395#define ASN1_BIT_STRING_digest(data,type,md,len) \
395 ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len) 396 ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)
396 397
397#define OCSP_CERTID_dup(cid) ASN1_dup_of(OCSP_CERTID,i2d_OCSP_CERTID,d2i_OCSP_CERTID,cid)
398
399#define OCSP_CERTSTATUS_dup(cs)\ 398#define OCSP_CERTSTATUS_dup(cs)\
400 (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\ 399 (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\
401 (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs)) 400 (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs))
402 401
402OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id);
403
403OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req); 404OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req);
404OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, 405OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req,
405 int maxline); 406 int maxline);
406int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx); 407int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx);
407void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx); 408void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx);
409int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req);
410int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx,
411 const char *name, const char *value);
408 412
409OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer); 413OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer);
410 414
@@ -474,11 +478,6 @@ int OCSP_basic_sign(OCSP_BASICRESP *brsp,
474 X509 *signer, EVP_PKEY *key, const EVP_MD *dgst, 478 X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,
475 STACK_OF(X509) *certs, unsigned long flags); 479 STACK_OF(X509) *certs, unsigned long flags);
476 480
477ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d,
478 void *data, STACK_OF(ASN1_OBJECT) *sk);
479#define ASN1_STRING_encode_of(type,s,i2d,data,sk) \
480 ASN1_STRING_encode(s, CHECKED_I2D_OF(type, i2d), data, sk)
481
482X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim); 481X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim);
483 482
484X509_EXTENSION *OCSP_accept_responses_new(char **oids); 483X509_EXTENSION *OCSP_accept_responses_new(char **oids);
@@ -547,9 +546,9 @@ DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)
547DECLARE_ASN1_FUNCTIONS(OCSP_CRLID) 546DECLARE_ASN1_FUNCTIONS(OCSP_CRLID)
548DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC) 547DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC)
549 548
550char *OCSP_response_status_str(long s); 549const char *OCSP_response_status_str(long s);
551char *OCSP_cert_status_str(long s); 550const char *OCSP_cert_status_str(long s);
552char *OCSP_crl_reason_str(long s); 551const char *OCSP_crl_reason_str(long s);
553 552
554int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a, unsigned long flags); 553int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST* a, unsigned long flags);
555int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags); 554int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags);
@@ -582,7 +581,8 @@ void ERR_load_OCSP_strings(void);
582#define OCSP_F_OCSP_REQUEST_VERIFY 116 581#define OCSP_F_OCSP_REQUEST_VERIFY 116
583#define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111 582#define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111
584#define OCSP_F_OCSP_SENDREQ_BIO 112 583#define OCSP_F_OCSP_SENDREQ_BIO 112
585#define OCSP_F_PARSE_HTTP_LINE1 117 584#define OCSP_F_OCSP_SENDREQ_NBIO 117
585#define OCSP_F_PARSE_HTTP_LINE1 118
586#define OCSP_F_REQUEST_VERIFY 113 586#define OCSP_F_REQUEST_VERIFY 113
587 587
588/* Reason codes. */ 588/* Reason codes. */
diff --git a/src/lib/libcrypto/ocsp/ocsp_cl.c b/src/lib/libcrypto/ocsp/ocsp_cl.c
index 17bab5fc59..9c14d9da27 100644
--- a/src/lib/libcrypto/ocsp/ocsp_cl.c
+++ b/src/lib/libcrypto/ocsp/ocsp_cl.c
@@ -155,7 +155,6 @@ int OCSP_request_sign(OCSP_REQUEST *req,
155 goto err; 155 goto err;
156 156
157 if (!(req->optionalSignature = sig = OCSP_SIGNATURE_new())) goto err; 157 if (!(req->optionalSignature = sig = OCSP_SIGNATURE_new())) goto err;
158 if (!dgst) dgst = EVP_sha1();
159 if (key) 158 if (key)
160 { 159 {
161 if (!X509_check_private_key(signer, key)) 160 if (!X509_check_private_key(signer, key))
diff --git a/src/lib/libcrypto/ocsp/ocsp_err.c b/src/lib/libcrypto/ocsp/ocsp_err.c
index d2f2e79f44..0cedcea682 100644
--- a/src/lib/libcrypto/ocsp/ocsp_err.c
+++ b/src/lib/libcrypto/ocsp/ocsp_err.c
@@ -1,6 +1,6 @@
1/* crypto/ocsp/ocsp_err.c */ 1/* crypto/ocsp/ocsp_err.c */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
@@ -86,6 +86,7 @@ static ERR_STRING_DATA OCSP_str_functs[]=
86{ERR_FUNC(OCSP_F_OCSP_REQUEST_VERIFY), "OCSP_request_verify"}, 86{ERR_FUNC(OCSP_F_OCSP_REQUEST_VERIFY), "OCSP_request_verify"},
87{ERR_FUNC(OCSP_F_OCSP_RESPONSE_GET1_BASIC), "OCSP_response_get1_basic"}, 87{ERR_FUNC(OCSP_F_OCSP_RESPONSE_GET1_BASIC), "OCSP_response_get1_basic"},
88{ERR_FUNC(OCSP_F_OCSP_SENDREQ_BIO), "OCSP_sendreq_bio"}, 88{ERR_FUNC(OCSP_F_OCSP_SENDREQ_BIO), "OCSP_sendreq_bio"},
89{ERR_FUNC(OCSP_F_OCSP_SENDREQ_NBIO), "OCSP_sendreq_nbio"},
89{ERR_FUNC(OCSP_F_PARSE_HTTP_LINE1), "PARSE_HTTP_LINE1"}, 90{ERR_FUNC(OCSP_F_PARSE_HTTP_LINE1), "PARSE_HTTP_LINE1"},
90{ERR_FUNC(OCSP_F_REQUEST_VERIFY), "REQUEST_VERIFY"}, 91{ERR_FUNC(OCSP_F_REQUEST_VERIFY), "REQUEST_VERIFY"},
91{0,NULL} 92{0,NULL}
diff --git a/src/lib/libcrypto/ocsp/ocsp_ext.c b/src/lib/libcrypto/ocsp/ocsp_ext.c
index 815cc29d58..ec884cb08f 100644
--- a/src/lib/libcrypto/ocsp/ocsp_ext.c
+++ b/src/lib/libcrypto/ocsp/ocsp_ext.c
@@ -264,7 +264,7 @@ int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc)
264 } 264 }
265 265
266/* also CRL Entry Extensions */ 266/* also CRL Entry Extensions */
267 267#if 0
268ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, 268ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d,
269 void *data, STACK_OF(ASN1_OBJECT) *sk) 269 void *data, STACK_OF(ASN1_OBJECT) *sk)
270 { 270 {
@@ -305,6 +305,7 @@ err:
305 if (b) OPENSSL_free(b); 305 if (b) OPENSSL_free(b);
306 return NULL; 306 return NULL;
307 } 307 }
308#endif
308 309
309/* Nonce handling functions */ 310/* Nonce handling functions */
310 311
@@ -442,17 +443,10 @@ X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim)
442 if (!(ASN1_GENERALIZEDTIME_set_string(cid->crlTime, tim))) 443 if (!(ASN1_GENERALIZEDTIME_set_string(cid->crlTime, tim)))
443 goto err; 444 goto err;
444 } 445 }
445 if (!(x = X509_EXTENSION_new())) goto err; 446 x = X509V3_EXT_i2d(NID_id_pkix_OCSP_CrlID, 0, cid);
446 if (!(x->object = OBJ_nid2obj(NID_id_pkix_OCSP_CrlID))) goto err;
447 if (!(ASN1_STRING_encode_of(OCSP_CRLID,x->value,i2d_OCSP_CRLID,cid,
448 NULL)))
449 goto err;
450 OCSP_CRLID_free(cid);
451 return x;
452err: 447err:
453 if (x) X509_EXTENSION_free(x);
454 if (cid) OCSP_CRLID_free(cid); 448 if (cid) OCSP_CRLID_free(cid);
455 return NULL; 449 return x;
456 } 450 }
457 451
458/* AcceptableResponses ::= SEQUENCE OF OBJECT IDENTIFIER */ 452/* AcceptableResponses ::= SEQUENCE OF OBJECT IDENTIFIER */
@@ -470,18 +464,10 @@ X509_EXTENSION *OCSP_accept_responses_new(char **oids)
470 sk_ASN1_OBJECT_push(sk, o); 464 sk_ASN1_OBJECT_push(sk, o);
471 oids++; 465 oids++;
472 } 466 }
473 if (!(x = X509_EXTENSION_new())) goto err; 467 x = X509V3_EXT_i2d(NID_id_pkix_OCSP_acceptableResponses, 0, sk);
474 if (!(x->object = OBJ_nid2obj(NID_id_pkix_OCSP_acceptableResponses)))
475 goto err;
476 if (!(ASN1_STRING_encode_of(ASN1_OBJECT,x->value,i2d_ASN1_OBJECT,NULL,
477 sk)))
478 goto err;
479 sk_ASN1_OBJECT_pop_free(sk, ASN1_OBJECT_free);
480 return x;
481err: 468err:
482 if (x) X509_EXTENSION_free(x);
483 if (sk) sk_ASN1_OBJECT_pop_free(sk, ASN1_OBJECT_free); 469 if (sk) sk_ASN1_OBJECT_pop_free(sk, ASN1_OBJECT_free);
484 return NULL; 470 return x;
485 } 471 }
486 472
487/* ArchiveCutoff ::= GeneralizedTime */ 473/* ArchiveCutoff ::= GeneralizedTime */
@@ -492,16 +478,10 @@ X509_EXTENSION *OCSP_archive_cutoff_new(char* tim)
492 478
493 if (!(gt = ASN1_GENERALIZEDTIME_new())) goto err; 479 if (!(gt = ASN1_GENERALIZEDTIME_new())) goto err;
494 if (!(ASN1_GENERALIZEDTIME_set_string(gt, tim))) goto err; 480 if (!(ASN1_GENERALIZEDTIME_set_string(gt, tim))) goto err;
495 if (!(x = X509_EXTENSION_new())) goto err; 481 x = X509V3_EXT_i2d(NID_id_pkix_OCSP_archiveCutoff, 0, gt);
496 if (!(x->object=OBJ_nid2obj(NID_id_pkix_OCSP_archiveCutoff)))goto err;
497 if (!(ASN1_STRING_encode_of(ASN1_GENERALIZEDTIME,x->value,
498 i2d_ASN1_GENERALIZEDTIME,gt,NULL))) goto err;
499 ASN1_GENERALIZEDTIME_free(gt);
500 return x;
501err: 482err:
502 if (gt) ASN1_GENERALIZEDTIME_free(gt); 483 if (gt) ASN1_GENERALIZEDTIME_free(gt);
503 if (x) X509_EXTENSION_free(x); 484 return x;
504 return NULL;
505 } 485 }
506 486
507/* per ACCESS_DESCRIPTION parameter are oids, of which there are currently 487/* per ACCESS_DESCRIPTION parameter are oids, of which there are currently
@@ -530,16 +510,9 @@ X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME* issuer, char **urls)
530 if (!sk_ACCESS_DESCRIPTION_push(sloc->locator, ad)) goto err; 510 if (!sk_ACCESS_DESCRIPTION_push(sloc->locator, ad)) goto err;
531 urls++; 511 urls++;
532 } 512 }
533 if (!(x = X509_EXTENSION_new())) goto err; 513 x = X509V3_EXT_i2d(NID_id_pkix_OCSP_serviceLocator, 0, sloc);
534 if (!(x->object = OBJ_nid2obj(NID_id_pkix_OCSP_serviceLocator)))
535 goto err;
536 if (!(ASN1_STRING_encode_of(OCSP_SERVICELOC,x->value,
537 i2d_OCSP_SERVICELOC,sloc,NULL))) goto err;
538 OCSP_SERVICELOC_free(sloc);
539 return x;
540err: 514err:
541 if (x) X509_EXTENSION_free(x);
542 if (sloc) OCSP_SERVICELOC_free(sloc); 515 if (sloc) OCSP_SERVICELOC_free(sloc);
543 return NULL; 516 return x;
544 } 517 }
545 518
diff --git a/src/lib/libcrypto/ocsp/ocsp_ht.c b/src/lib/libcrypto/ocsp/ocsp_ht.c
index 6abb30b2c0..12bbfcffd1 100644
--- a/src/lib/libcrypto/ocsp/ocsp_ht.c
+++ b/src/lib/libcrypto/ocsp/ocsp_ht.c
@@ -118,39 +118,65 @@ void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx)
118 OPENSSL_free(rctx); 118 OPENSSL_free(rctx);
119 } 119 }
120 120
121OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req, 121int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req)
122 int maxline)
123 { 122 {
124 static char post_hdr[] = "POST %s HTTP/1.0\r\n" 123 static const char req_hdr[] =
125 "Content-Type: application/ocsp-request\r\n" 124 "Content-Type: application/ocsp-request\r\n"
126 "Content-Length: %d\r\n\r\n"; 125 "Content-Length: %d\r\n\r\n";
126 if (BIO_printf(rctx->mem, req_hdr, i2d_OCSP_REQUEST(req, NULL)) <= 0)
127 return 0;
128 if (i2d_OCSP_REQUEST_bio(rctx->mem, req) <= 0)
129 return 0;
130 rctx->state = OHS_ASN1_WRITE;
131 rctx->asn1_len = BIO_get_mem_data(rctx->mem, NULL);
132 return 1;
133 }
134
135int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx,
136 const char *name, const char *value)
137 {
138 if (!name)
139 return 0;
140 if (BIO_puts(rctx->mem, name) <= 0)
141 return 0;
142 if (value)
143 {
144 if (BIO_write(rctx->mem, ": ", 2) != 2)
145 return 0;
146 if (BIO_puts(rctx->mem, value) <= 0)
147 return 0;
148 }
149 if (BIO_write(rctx->mem, "\r\n", 2) != 2)
150 return 0;
151 return 1;
152 }
153
154OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req,
155 int maxline)
156 {
157 static const char post_hdr[] = "POST %s HTTP/1.0\r\n";
127 158
128 OCSP_REQ_CTX *rctx; 159 OCSP_REQ_CTX *rctx;
129 rctx = OPENSSL_malloc(sizeof(OCSP_REQ_CTX)); 160 rctx = OPENSSL_malloc(sizeof(OCSP_REQ_CTX));
130 rctx->state = OHS_FIRSTLINE; 161 rctx->state = OHS_ERROR;
131 rctx->mem = BIO_new(BIO_s_mem()); 162 rctx->mem = BIO_new(BIO_s_mem());
132 rctx->io = io; 163 rctx->io = io;
164 rctx->asn1_len = 0;
133 if (maxline > 0) 165 if (maxline > 0)
134 rctx->iobuflen = maxline; 166 rctx->iobuflen = maxline;
135 else 167 else
136 rctx->iobuflen = OCSP_MAX_LINE_LEN; 168 rctx->iobuflen = OCSP_MAX_LINE_LEN;
137 rctx->iobuf = OPENSSL_malloc(rctx->iobuflen); 169 rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
170 if (!rctx->iobuf)
171 return 0;
138 if (!path) 172 if (!path)
139 path = "/"; 173 path = "/";
140 174
141 if (BIO_printf(rctx->mem, post_hdr, path, 175 if (BIO_printf(rctx->mem, post_hdr, path) <= 0)
142 i2d_OCSP_REQUEST(req, NULL)) <= 0)
143 {
144 rctx->state = OHS_ERROR;
145 return 0; 176 return 0;
146 } 177
147 if (i2d_OCSP_REQUEST_bio(rctx->mem, req) <= 0) 178 if (req && !OCSP_REQ_CTX_set1_req(rctx, req))
148 {
149 rctx->state = OHS_ERROR;
150 return 0; 179 return 0;
151 }
152 rctx->state = OHS_ASN1_WRITE;
153 rctx->asn1_len = BIO_get_mem_data(rctx->mem, NULL);
154 180
155 return rctx; 181 return rctx;
156 } 182 }
diff --git a/src/lib/libcrypto/ocsp/ocsp_lib.c b/src/lib/libcrypto/ocsp/ocsp_lib.c
index 27450811d7..36905d76cd 100644
--- a/src/lib/libcrypto/ocsp/ocsp_lib.c
+++ b/src/lib/libcrypto/ocsp/ocsp_lib.c
@@ -69,6 +69,7 @@
69#include <openssl/pem.h> 69#include <openssl/pem.h>
70#include <openssl/x509v3.h> 70#include <openssl/x509v3.h>
71#include <openssl/ocsp.h> 71#include <openssl/ocsp.h>
72#include <openssl/asn1t.h>
72 73
73/* Convert a certificate and its issuer to an OCSP_CERTID */ 74/* Convert a certificate and its issuer to an OCSP_CERTID */
74 75
@@ -260,3 +261,5 @@ int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pss
260 return 0; 261 return 0;
261 262
262 } 263 }
264
265IMPLEMENT_ASN1_DUP_FUNCTION(OCSP_CERTID)
diff --git a/src/lib/libcrypto/ocsp/ocsp_prn.c b/src/lib/libcrypto/ocsp/ocsp_prn.c
index 3dfb51c1e4..1695c9c4ad 100644
--- a/src/lib/libcrypto/ocsp/ocsp_prn.c
+++ b/src/lib/libcrypto/ocsp/ocsp_prn.c
@@ -85,21 +85,21 @@ static int ocsp_certid_print(BIO *bp, OCSP_CERTID* a, int indent)
85typedef struct 85typedef struct
86 { 86 {
87 long t; 87 long t;
88 char *m; 88 const char *m;
89 } OCSP_TBLSTR; 89 } OCSP_TBLSTR;
90 90
91static char *table2string(long s, OCSP_TBLSTR *ts, int len) 91static const char *table2string(long s, const OCSP_TBLSTR *ts, int len)
92{ 92{
93 OCSP_TBLSTR *p; 93 const OCSP_TBLSTR *p;
94 for (p=ts; p < ts + len; p++) 94 for (p=ts; p < ts + len; p++)
95 if (p->t == s) 95 if (p->t == s)
96 return p->m; 96 return p->m;
97 return "(UNKNOWN)"; 97 return "(UNKNOWN)";
98} 98}
99 99
100char *OCSP_response_status_str(long s) 100const char *OCSP_response_status_str(long s)
101 { 101 {
102 static OCSP_TBLSTR rstat_tbl[] = { 102 static const OCSP_TBLSTR rstat_tbl[] = {
103 { OCSP_RESPONSE_STATUS_SUCCESSFUL, "successful" }, 103 { OCSP_RESPONSE_STATUS_SUCCESSFUL, "successful" },
104 { OCSP_RESPONSE_STATUS_MALFORMEDREQUEST, "malformedrequest" }, 104 { OCSP_RESPONSE_STATUS_MALFORMEDREQUEST, "malformedrequest" },
105 { OCSP_RESPONSE_STATUS_INTERNALERROR, "internalerror" }, 105 { OCSP_RESPONSE_STATUS_INTERNALERROR, "internalerror" },
@@ -109,18 +109,18 @@ char *OCSP_response_status_str(long s)
109 return table2string(s, rstat_tbl, 6); 109 return table2string(s, rstat_tbl, 6);
110 } 110 }
111 111
112char *OCSP_cert_status_str(long s) 112const char *OCSP_cert_status_str(long s)
113 { 113 {
114 static OCSP_TBLSTR cstat_tbl[] = { 114 static const OCSP_TBLSTR cstat_tbl[] = {
115 { V_OCSP_CERTSTATUS_GOOD, "good" }, 115 { V_OCSP_CERTSTATUS_GOOD, "good" },
116 { V_OCSP_CERTSTATUS_REVOKED, "revoked" }, 116 { V_OCSP_CERTSTATUS_REVOKED, "revoked" },
117 { V_OCSP_CERTSTATUS_UNKNOWN, "unknown" } }; 117 { V_OCSP_CERTSTATUS_UNKNOWN, "unknown" } };
118 return table2string(s, cstat_tbl, 3); 118 return table2string(s, cstat_tbl, 3);
119 } 119 }
120 120
121char *OCSP_crl_reason_str(long s) 121const char *OCSP_crl_reason_str(long s)
122 { 122 {
123 OCSP_TBLSTR reason_tbl[] = { 123 static const OCSP_TBLSTR reason_tbl[] = {
124 { OCSP_REVOKED_STATUS_UNSPECIFIED, "unspecified" }, 124 { OCSP_REVOKED_STATUS_UNSPECIFIED, "unspecified" },
125 { OCSP_REVOKED_STATUS_KEYCOMPROMISE, "keyCompromise" }, 125 { OCSP_REVOKED_STATUS_KEYCOMPROMISE, "keyCompromise" },
126 { OCSP_REVOKED_STATUS_CACOMPROMISE, "cACompromise" }, 126 { OCSP_REVOKED_STATUS_CACOMPROMISE, "cACompromise" },
@@ -266,15 +266,16 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags)
266 if (!ASN1_GENERALIZEDTIME_print(bp,single->nextUpdate)) 266 if (!ASN1_GENERALIZEDTIME_print(bp,single->nextUpdate))
267 goto err; 267 goto err;
268 } 268 }
269 if (!BIO_write(bp,"\n",1)) goto err; 269 if (BIO_write(bp,"\n",1) <= 0) goto err;
270 if (!X509V3_extensions_print(bp, 270 if (!X509V3_extensions_print(bp,
271 "Response Single Extensions", 271 "Response Single Extensions",
272 single->singleExtensions, flags, 8)) 272 single->singleExtensions, flags, 8))
273 goto err; 273 goto err;
274 if (!BIO_write(bp,"\n",1)) goto err; 274 if (BIO_write(bp,"\n",1) <= 0) goto err;
275 } 275 }
276 if (!X509V3_extensions_print(bp, "Response Extensions", 276 if (!X509V3_extensions_print(bp, "Response Extensions",
277 rd->responseExtensions, flags, 4)) 277 rd->responseExtensions, flags, 4))
278 goto err;
278 if(X509_signature_print(bp, br->signatureAlgorithm, br->signature) <= 0) 279 if(X509_signature_print(bp, br->signatureAlgorithm, br->signature) <= 0)
279 goto err; 280 goto err;
280 281
diff --git a/src/lib/libcrypto/ocsp/ocsp_vfy.c b/src/lib/libcrypto/ocsp/ocsp_vfy.c
index 4a0c3870d8..415d67e61c 100644
--- a/src/lib/libcrypto/ocsp/ocsp_vfy.c
+++ b/src/lib/libcrypto/ocsp/ocsp_vfy.c
@@ -308,6 +308,8 @@ static int ocsp_match_issuerid(X509 *cert, OCSP_CERTID *cid,
308 } 308 }
309 309
310 mdlen = EVP_MD_size(dgst); 310 mdlen = EVP_MD_size(dgst);
311 if (mdlen < 0)
312 return -1;
311 if ((cid->issuerNameHash->length != mdlen) || 313 if ((cid->issuerNameHash->length != mdlen) ||
312 (cid->issuerKeyHash->length != mdlen)) 314 (cid->issuerKeyHash->length != mdlen))
313 return 0; 315 return 0;
@@ -316,7 +318,7 @@ static int ocsp_match_issuerid(X509 *cert, OCSP_CERTID *cid,
316 return -1; 318 return -1;
317 if (memcmp(md, cid->issuerNameHash->data, mdlen)) 319 if (memcmp(md, cid->issuerNameHash->data, mdlen))
318 return 0; 320 return 0;
319 X509_pubkey_digest(cert, EVP_sha1(), md, NULL); 321 X509_pubkey_digest(cert, dgst, md, NULL);
320 if (memcmp(md, cid->issuerKeyHash->data, mdlen)) 322 if (memcmp(md, cid->issuerKeyHash->data, mdlen))
321 return 0; 323 return 0;
322 324