summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pem
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/pem')
-rw-r--r--src/lib/libcrypto/pem/Makefile241
-rw-r--r--src/lib/libcrypto/pem/Makefile.ssl336
-rw-r--r--src/lib/libcrypto/pem/pem.h173
-rw-r--r--src/lib/libcrypto/pem/pem_all.c233
-rw-r--r--src/lib/libcrypto/pem/pem_err.c18
-rw-r--r--src/lib/libcrypto/pem/pem_info.c58
-rw-r--r--src/lib/libcrypto/pem/pem_lib.c33
-rw-r--r--src/lib/libcrypto/pem/pem_oth.c7
-rw-r--r--src/lib/libcrypto/pem/pem_pk8.c7
-rw-r--r--src/lib/libcrypto/pem/pem_pkey.c12
-rw-r--r--src/lib/libcrypto/pem/pem_seal.c2
-rw-r--r--src/lib/libcrypto/pem/pem_xaux.c1
12 files changed, 778 insertions, 343 deletions
diff --git a/src/lib/libcrypto/pem/Makefile b/src/lib/libcrypto/pem/Makefile
new file mode 100644
index 0000000000..742194fd24
--- /dev/null
+++ b/src/lib/libcrypto/pem/Makefile
@@ -0,0 +1,241 @@
1#
2# OpenSSL/crypto/pem/Makefile
3#
4
5DIR= pem
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I$(TOP) -I../../include
9CFLAG=-g
10MAKEFILE= Makefile
11AR= ar r
12
13CFLAGS= $(INCLUDES) $(CFLAG)
14
15GENERAL=Makefile
16TEST=
17APPS=
18
19LIB=$(TOP)/libcrypto.a
20LIBSRC= pem_sign.c pem_seal.c pem_info.c pem_lib.c pem_all.c pem_err.c \
21 pem_x509.c pem_xaux.c pem_oth.c pem_pk8.c pem_pkey.c
22
23LIBOBJ= pem_sign.o pem_seal.o pem_info.o pem_lib.o pem_all.o pem_err.o \
24 pem_x509.o pem_xaux.o pem_oth.o pem_pk8.o pem_pkey.o
25
26SRC= $(LIBSRC)
27
28EXHEADER= pem.h pem2.h
29HEADER= $(EXHEADER)
30
31ALL= $(GENERAL) $(SRC) $(HEADER)
32
33top:
34 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
35
36all: lib
37
38lib: $(LIBOBJ)
39 $(AR) $(LIB) $(LIBOBJ)
40 $(RANLIB) $(LIB) || echo Never mind.
41 @touch lib
42
43files:
44 $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
45
46links: $(EXHEADER)
47 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
48 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
49 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
50
51install:
52 @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
53 @headerlist="$(EXHEADER)"; for i in $$headerlist ; \
54 do \
55 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
56 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
57 done;
58
59tags:
60 ctags $(SRC)
61
62tests:
63
64lint:
65 lint -DLINT $(INCLUDES) $(SRC)>fluff
66
67depend:
68 @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
69 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
70
71dclean:
72 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
73 mv -f Makefile.new $(MAKEFILE)
74
75clean:
76 rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
77
78# DO NOT DELETE THIS LINE -- make depend depends on it.
79
80pem_all.o: ../../e_os.h ../../include/openssl/asn1.h
81pem_all.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
82pem_all.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
83pem_all.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
84pem_all.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
85pem_all.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
86pem_all.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
87pem_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
88pem_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
89pem_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
90pem_all.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
91pem_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
92pem_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
93pem_all.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
94pem_all.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_all.c
95pem_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
96pem_err.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
97pem_err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
98pem_err.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
99pem_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
100pem_err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
101pem_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
102pem_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
103pem_err.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
104pem_err.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
105pem_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
106pem_err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
107pem_err.o: ../../include/openssl/x509_vfy.h pem_err.c
108pem_info.o: ../../e_os.h ../../include/openssl/asn1.h
109pem_info.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
110pem_info.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
111pem_info.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
112pem_info.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
113pem_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h
114pem_info.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
115pem_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
116pem_info.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
117pem_info.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
118pem_info.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
119pem_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
120pem_info.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
121pem_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
122pem_info.o: ../cryptlib.h pem_info.c
123pem_lib.o: ../../e_os.h ../../include/openssl/asn1.h
124pem_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
125pem_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
126pem_lib.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h
127pem_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
128pem_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
129pem_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
130pem_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
131pem_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
132pem_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
133pem_lib.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h
134pem_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
135pem_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
136pem_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
137pem_lib.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
138pem_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
139pem_lib.o: ../cryptlib.h pem_lib.c
140pem_oth.o: ../../e_os.h ../../include/openssl/asn1.h
141pem_oth.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
142pem_oth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
143pem_oth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
144pem_oth.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
145pem_oth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
146pem_oth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
147pem_oth.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
148pem_oth.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
149pem_oth.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
150pem_oth.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
151pem_oth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
152pem_oth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
153pem_oth.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_oth.c
154pem_pk8.o: ../../e_os.h ../../include/openssl/asn1.h
155pem_pk8.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
156pem_pk8.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
157pem_pk8.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
158pem_pk8.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
159pem_pk8.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
160pem_pk8.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
161pem_pk8.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
162pem_pk8.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
163pem_pk8.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h
164pem_pk8.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
165pem_pk8.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
166pem_pk8.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
167pem_pk8.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
168pem_pk8.o: ../cryptlib.h pem_pk8.c
169pem_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
170pem_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
171pem_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
172pem_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
173pem_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
174pem_pkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
175pem_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
176pem_pkey.o: ../../include/openssl/opensslconf.h
177pem_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
178pem_pkey.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
179pem_pkey.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
180pem_pkey.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
181pem_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
182pem_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
183pem_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_pkey.c
184pem_seal.o: ../../e_os.h ../../include/openssl/asn1.h
185pem_seal.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
186pem_seal.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
187pem_seal.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
188pem_seal.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
189pem_seal.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
190pem_seal.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
191pem_seal.o: ../../include/openssl/opensslconf.h
192pem_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
193pem_seal.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
194pem_seal.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
195pem_seal.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
196pem_seal.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
197pem_seal.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
198pem_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_seal.c
199pem_sign.o: ../../e_os.h ../../include/openssl/asn1.h
200pem_sign.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
201pem_sign.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
202pem_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
203pem_sign.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
204pem_sign.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
205pem_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
206pem_sign.o: ../../include/openssl/opensslconf.h
207pem_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
208pem_sign.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
209pem_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
210pem_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
211pem_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
212pem_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
213pem_sign.o: ../cryptlib.h pem_sign.c
214pem_x509.o: ../../e_os.h ../../include/openssl/asn1.h
215pem_x509.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
216pem_x509.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
217pem_x509.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
218pem_x509.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
219pem_x509.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
220pem_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
221pem_x509.o: ../../include/openssl/opensslconf.h
222pem_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
223pem_x509.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
224pem_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
225pem_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
226pem_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
227pem_x509.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_x509.c
228pem_xaux.o: ../../e_os.h ../../include/openssl/asn1.h
229pem_xaux.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
230pem_xaux.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
231pem_xaux.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
232pem_xaux.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
233pem_xaux.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
234pem_xaux.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
235pem_xaux.o: ../../include/openssl/opensslconf.h
236pem_xaux.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
237pem_xaux.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
238pem_xaux.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
239pem_xaux.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
240pem_xaux.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
241pem_xaux.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_xaux.c
diff --git a/src/lib/libcrypto/pem/Makefile.ssl b/src/lib/libcrypto/pem/Makefile.ssl
new file mode 100644
index 0000000000..d3043eb401
--- /dev/null
+++ b/src/lib/libcrypto/pem/Makefile.ssl
@@ -0,0 +1,336 @@
1#
2# SSLeay/crypto/pem/Makefile
3#
4
5DIR= pem
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
22TEST=
23APPS=
24
25LIB=$(TOP)/libcrypto.a
26LIBSRC= pem_sign.c pem_seal.c pem_info.c pem_lib.c pem_all.c pem_err.c \
27 pem_x509.c pem_xaux.c pem_oth.c pem_pk8.c pem_pkey.c
28
29LIBOBJ= pem_sign.o pem_seal.o pem_info.o pem_lib.o pem_all.o pem_err.o \
30 pem_x509.o pem_xaux.o pem_oth.o pem_pk8.o pem_pkey.o
31
32SRC= $(LIBSRC)
33
34EXHEADER= pem.h pem2.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: $(EXHEADER)
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
85pem_all.o: ../../e_os.h ../../include/openssl/aes.h
86pem_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
87pem_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
88pem_all.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
89pem_all.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
90pem_all.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
91pem_all.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
92pem_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h
93pem_all.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
94pem_all.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
95pem_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
96pem_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
97pem_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
98pem_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
99pem_all.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
100pem_all.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
101pem_all.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
102pem_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
103pem_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
104pem_all.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
105pem_all.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
106pem_all.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_all.c
107pem_err.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
108pem_err.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
109pem_err.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
110pem_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
111pem_err.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
112pem_err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
113pem_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
114pem_err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
115pem_err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
116pem_err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
117pem_err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
118pem_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
119pem_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
120pem_err.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
121pem_err.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
122pem_err.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
123pem_err.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
124pem_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
125pem_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
126pem_err.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
127pem_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
128pem_err.o: pem_err.c
129pem_info.o: ../../e_os.h ../../include/openssl/aes.h
130pem_info.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
131pem_info.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
132pem_info.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
133pem_info.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
134pem_info.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
135pem_info.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
136pem_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h
137pem_info.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
138pem_info.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
139pem_info.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
140pem_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
141pem_info.o: ../../include/openssl/opensslconf.h
142pem_info.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
143pem_info.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
144pem_info.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
145pem_info.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
146pem_info.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
147pem_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
148pem_info.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
149pem_info.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
150pem_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
151pem_info.o: ../cryptlib.h pem_info.c
152pem_lib.o: ../../e_os.h ../../include/openssl/aes.h
153pem_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
154pem_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
155pem_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
156pem_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
157pem_lib.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
158pem_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
159pem_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
160pem_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
161pem_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
162pem_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
163pem_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
164pem_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
165pem_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
166pem_lib.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h
167pem_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
168pem_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
169pem_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
170pem_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
171pem_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
172pem_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
173pem_lib.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
174pem_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_lib.c
175pem_oth.o: ../../e_os.h ../../include/openssl/aes.h
176pem_oth.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
177pem_oth.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
178pem_oth.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
179pem_oth.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
180pem_oth.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
181pem_oth.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
182pem_oth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
183pem_oth.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
184pem_oth.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
185pem_oth.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
186pem_oth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
187pem_oth.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
188pem_oth.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
189pem_oth.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
190pem_oth.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
191pem_oth.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
192pem_oth.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
193pem_oth.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
194pem_oth.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
195pem_oth.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
196pem_oth.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
197pem_oth.o: ../cryptlib.h pem_oth.c
198pem_pk8.o: ../../e_os.h ../../include/openssl/aes.h
199pem_pk8.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
200pem_pk8.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
201pem_pk8.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
202pem_pk8.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
203pem_pk8.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
204pem_pk8.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
205pem_pk8.o: ../../include/openssl/err.h ../../include/openssl/evp.h
206pem_pk8.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
207pem_pk8.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
208pem_pk8.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
209pem_pk8.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
210pem_pk8.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
211pem_pk8.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
212pem_pk8.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h
213pem_pk8.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
214pem_pk8.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
215pem_pk8.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
216pem_pk8.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
217pem_pk8.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
218pem_pk8.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
219pem_pk8.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
220pem_pk8.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_pk8.c
221pem_pkey.o: ../../e_os.h ../../include/openssl/aes.h
222pem_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
223pem_pkey.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
224pem_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
225pem_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
226pem_pkey.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
227pem_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
228pem_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
229pem_pkey.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
230pem_pkey.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
231pem_pkey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
232pem_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
233pem_pkey.o: ../../include/openssl/opensslconf.h
234pem_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
235pem_pkey.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
236pem_pkey.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
237pem_pkey.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
238pem_pkey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
239pem_pkey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
240pem_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
241pem_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
242pem_pkey.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
243pem_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
244pem_pkey.o: ../cryptlib.h pem_pkey.c
245pem_seal.o: ../../e_os.h ../../include/openssl/aes.h
246pem_seal.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
247pem_seal.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
248pem_seal.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
249pem_seal.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
250pem_seal.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
251pem_seal.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
252pem_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h
253pem_seal.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
254pem_seal.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
255pem_seal.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
256pem_seal.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
257pem_seal.o: ../../include/openssl/opensslconf.h
258pem_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
259pem_seal.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
260pem_seal.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
261pem_seal.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
262pem_seal.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
263pem_seal.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
264pem_seal.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
265pem_seal.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
266pem_seal.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
267pem_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_seal.c
268pem_sign.o: ../../e_os.h ../../include/openssl/aes.h
269pem_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
270pem_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
271pem_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
272pem_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
273pem_sign.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
274pem_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
275pem_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h
276pem_sign.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
277pem_sign.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
278pem_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
279pem_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
280pem_sign.o: ../../include/openssl/opensslconf.h
281pem_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
282pem_sign.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
283pem_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
284pem_sign.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
285pem_sign.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
286pem_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
287pem_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
288pem_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
289pem_sign.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
290pem_sign.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_sign.c
291pem_x509.o: ../../e_os.h ../../include/openssl/aes.h
292pem_x509.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
293pem_x509.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
294pem_x509.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
295pem_x509.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
296pem_x509.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
297pem_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
298pem_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h
299pem_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
300pem_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
301pem_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
302pem_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
303pem_x509.o: ../../include/openssl/opensslconf.h
304pem_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
305pem_x509.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
306pem_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
307pem_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
308pem_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
309pem_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
310pem_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
311pem_x509.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
312pem_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
313pem_x509.o: ../cryptlib.h pem_x509.c
314pem_xaux.o: ../../e_os.h ../../include/openssl/aes.h
315pem_xaux.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
316pem_xaux.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
317pem_xaux.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
318pem_xaux.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
319pem_xaux.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h
320pem_xaux.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
321pem_xaux.o: ../../include/openssl/err.h ../../include/openssl/evp.h
322pem_xaux.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
323pem_xaux.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
324pem_xaux.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
325pem_xaux.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
326pem_xaux.o: ../../include/openssl/opensslconf.h
327pem_xaux.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
328pem_xaux.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
329pem_xaux.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
330pem_xaux.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
331pem_xaux.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
332pem_xaux.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
333pem_xaux.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
334pem_xaux.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
335pem_xaux.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
336pem_xaux.o: ../cryptlib.h pem_xaux.c
diff --git a/src/lib/libcrypto/pem/pem.h b/src/lib/libcrypto/pem/pem.h
index 670afa670b..d330cbf9a3 100644
--- a/src/lib/libcrypto/pem/pem.h
+++ b/src/lib/libcrypto/pem/pem.h
@@ -59,7 +59,6 @@
59#ifndef HEADER_PEM_H 59#ifndef HEADER_PEM_H
60#define HEADER_PEM_H 60#define HEADER_PEM_H
61 61
62#include <openssl/e_os2.h>
63#ifndef OPENSSL_NO_BIO 62#ifndef OPENSSL_NO_BIO
64#include <openssl/bio.h> 63#include <openssl/bio.h>
65#endif 64#endif
@@ -69,6 +68,7 @@
69#include <openssl/evp.h> 68#include <openssl/evp.h>
70#include <openssl/x509.h> 69#include <openssl/x509.h>
71#include <openssl/pem2.h> 70#include <openssl/pem2.h>
71#include <openssl/e_os2.h>
72 72
73#ifdef __cplusplus 73#ifdef __cplusplus
74extern "C" { 74extern "C" {
@@ -91,9 +91,6 @@ extern "C" {
91#define PEM_OBJ_DHPARAMS 17 91#define PEM_OBJ_DHPARAMS 17
92#define PEM_OBJ_DSAPARAMS 18 92#define PEM_OBJ_DSAPARAMS 18
93#define PEM_OBJ_PRIV_RSA_PUBLIC 19 93#define PEM_OBJ_PRIV_RSA_PUBLIC 19
94#define PEM_OBJ_PRIV_ECDSA 20
95#define PEM_OBJ_PUB_ECDSA 21
96#define PEM_OBJ_ECPARAMETERS 22
97 94
98#define PEM_ERROR 30 95#define PEM_ERROR 30
99#define PEM_DEK_DES_CBC 40 96#define PEM_DEK_DES_CBC 40
@@ -113,7 +110,6 @@ extern "C" {
113 110
114#define PEM_STRING_X509_OLD "X509 CERTIFICATE" 111#define PEM_STRING_X509_OLD "X509 CERTIFICATE"
115#define PEM_STRING_X509 "CERTIFICATE" 112#define PEM_STRING_X509 "CERTIFICATE"
116#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR"
117#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" 113#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
118#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" 114#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
119#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST" 115#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
@@ -130,10 +126,6 @@ extern "C" {
130#define PEM_STRING_DHPARAMS "DH PARAMETERS" 126#define PEM_STRING_DHPARAMS "DH PARAMETERS"
131#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" 127#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
132#define PEM_STRING_DSAPARAMS "DSA PARAMETERS" 128#define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
133#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY"
134#define PEM_STRING_ECPARAMETERS "EC PARAMETERS"
135#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY"
136#define PEM_STRING_CMS "CMS"
137 129
138 /* Note that this structure is initialised by PEM_SealInit and cleaned up 130 /* Note that this structure is initialised by PEM_SealInit and cleaned up
139 by PEM_SealFinal (at least for now) */ 131 by PEM_SealFinal (at least for now) */
@@ -221,50 +213,24 @@ typedef struct pem_ctx_st
221#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ 213#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \
222type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\ 214type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\
223{ \ 215{ \
224 return (type*)PEM_ASN1_read(CHECKED_D2I_OF(type, d2i_##asn1), \ 216return((type *)PEM_ASN1_read((char *(*)())d2i_##asn1, str,fp,(char **)x,\
225 str, fp, \ 217 cb,u)); \
226 CHECKED_PPTR_OF(type, x), \ 218} \
227 cb, u); \
228}
229 219
230#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ 220#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \
231int PEM_write_##name(FILE *fp, type *x) \ 221int PEM_write_##name(FILE *fp, type *x) \
232{ \ 222{ \
233 return PEM_ASN1_write(CHECKED_I2D_OF(type, i2d_##asn1), \ 223return(PEM_ASN1_write((int (*)())i2d_##asn1,str,fp, (char *)x, \
234 str, fp, \ 224 NULL,NULL,0,NULL,NULL)); \
235 CHECKED_PTR_OF(type, x), \ 225}
236 NULL, NULL, 0, NULL, NULL); \
237}
238
239#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \
240int PEM_write_##name(FILE *fp, const type *x) \
241{ \
242 return PEM_ASN1_write(CHECKED_I2D_OF(const type, i2d_##asn1), \
243 str, fp, \
244 CHECKED_PTR_OF(const type, x), \
245 NULL, NULL, 0, NULL, NULL); \
246}
247 226
248#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ 227#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \
249int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ 228int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
250 unsigned char *kstr, int klen, pem_password_cb *cb, \ 229 unsigned char *kstr, int klen, pem_password_cb *cb, \
251 void *u) \ 230 void *u) \
252 { \ 231 { \
253 return PEM_ASN1_write(CHECKED_I2D_OF(type, i2d_##asn1), \ 232 return(PEM_ASN1_write((int (*)())i2d_##asn1,str,fp, \
254 str, fp, \ 233 (char *)x,enc,kstr,klen,cb,u)); \
255 CHECKED_PTR_OF(type, x), \
256 enc, kstr, klen, cb, u); \
257 }
258
259#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \
260int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
261 unsigned char *kstr, int klen, pem_password_cb *cb, \
262 void *u) \
263 { \
264 return PEM_ASN1_write(CHECKED_I2D_OF(const type, i2d_##asn1), \
265 str, fp, \
266 CHECKED_PTR_OF(const type, x), \
267 enc, kstr, klen, cb, u); \
268 } 234 }
269 235
270#endif 236#endif
@@ -272,66 +238,33 @@ int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
272#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ 238#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
273type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\ 239type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\
274{ \ 240{ \
275 return (type*)PEM_ASN1_read_bio(CHECKED_D2I_OF(type, d2i_##asn1), \ 241return((type *)PEM_ASN1_read_bio((char *(*)())d2i_##asn1, str,bp,\
276 str, bp, \ 242 (char **)x,cb,u)); \
277 CHECKED_PPTR_OF(type, x), \
278 cb, u); \
279} 243}
280 244
281#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ 245#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
282int PEM_write_bio_##name(BIO *bp, type *x) \ 246int PEM_write_bio_##name(BIO *bp, type *x) \
283{ \ 247{ \
284 return PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d_##asn1), \ 248return(PEM_ASN1_write_bio((int (*)())i2d_##asn1,str,bp, (char *)x, \
285 str, bp, \ 249 NULL,NULL,0,NULL,NULL)); \
286 CHECKED_PTR_OF(type, x), \
287 NULL, NULL, 0, NULL, NULL); \
288}
289
290#define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
291int PEM_write_bio_##name(BIO *bp, const type *x) \
292{ \
293 return PEM_ASN1_write_bio(CHECKED_I2D_OF(const type, i2d_##asn1), \
294 str, bp, \
295 CHECKED_PTR_OF(const type, x), \
296 NULL, NULL, 0, NULL, NULL); \
297} 250}
298 251
299#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ 252#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
300int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ 253int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
301 unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ 254 unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
302 { \ 255 { \
303 return PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d_##asn1), \ 256 return(PEM_ASN1_write_bio((int (*)())i2d_##asn1,str,bp, \
304 str, bp, \ 257 (char *)x,enc,kstr,klen,cb,u)); \
305 CHECKED_PTR_OF(type, x), \
306 enc, kstr, klen, cb, u); \
307 }
308
309#define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
310int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
311 unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
312 { \
313 return PEM_ASN1_write_bio(CHECKED_I2D_OF(const type, i2d_##asn1), \
314 str, bp, \
315 CHECKED_PTR_OF(const type, x), \
316 enc, kstr, klen, cb, u); \
317 } 258 }
318 259
319#define IMPLEMENT_PEM_write(name, type, str, asn1) \ 260#define IMPLEMENT_PEM_write(name, type, str, asn1) \
320 IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ 261 IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
321 IMPLEMENT_PEM_write_fp(name, type, str, asn1) 262 IMPLEMENT_PEM_write_fp(name, type, str, asn1)
322 263
323#define IMPLEMENT_PEM_write_const(name, type, str, asn1) \
324 IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \
325 IMPLEMENT_PEM_write_fp_const(name, type, str, asn1)
326
327#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \ 264#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \
328 IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ 265 IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
329 IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) 266 IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
330 267
331#define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \
332 IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \
333 IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1)
334
335#define IMPLEMENT_PEM_read(name, type, str, asn1) \ 268#define IMPLEMENT_PEM_read(name, type, str, asn1) \
336 IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ 269 IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
337 IMPLEMENT_PEM_read_fp(name, type, str, asn1) 270 IMPLEMENT_PEM_read_fp(name, type, str, asn1)
@@ -340,10 +273,6 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
340 IMPLEMENT_PEM_read(name, type, str, asn1) \ 273 IMPLEMENT_PEM_read(name, type, str, asn1) \
341 IMPLEMENT_PEM_write(name, type, str, asn1) 274 IMPLEMENT_PEM_write(name, type, str, asn1)
342 275
343#define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \
344 IMPLEMENT_PEM_read(name, type, str, asn1) \
345 IMPLEMENT_PEM_write_const(name, type, str, asn1)
346
347#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ 276#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \
348 IMPLEMENT_PEM_read(name, type, str, asn1) \ 277 IMPLEMENT_PEM_read(name, type, str, asn1) \
349 IMPLEMENT_PEM_write_cb(name, type, str, asn1) 278 IMPLEMENT_PEM_write_cb(name, type, str, asn1)
@@ -364,9 +293,6 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
364#define DECLARE_PEM_write_fp(name, type) \ 293#define DECLARE_PEM_write_fp(name, type) \
365 int PEM_write_##name(FILE *fp, type *x); 294 int PEM_write_##name(FILE *fp, type *x);
366 295
367#define DECLARE_PEM_write_fp_const(name, type) \
368 int PEM_write_##name(FILE *fp, const type *x);
369
370#define DECLARE_PEM_write_cb_fp(name, type) \ 296#define DECLARE_PEM_write_cb_fp(name, type) \
371 int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ 297 int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
372 unsigned char *kstr, int klen, pem_password_cb *cb, void *u); 298 unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
@@ -380,9 +306,6 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
380#define DECLARE_PEM_write_bio(name, type) \ 306#define DECLARE_PEM_write_bio(name, type) \
381 int PEM_write_bio_##name(BIO *bp, type *x); 307 int PEM_write_bio_##name(BIO *bp, type *x);
382 308
383#define DECLARE_PEM_write_bio_const(name, type) \
384 int PEM_write_bio_##name(BIO *bp, const type *x);
385
386#define DECLARE_PEM_write_cb_bio(name, type) \ 309#define DECLARE_PEM_write_cb_bio(name, type) \
387 int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ 310 int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
388 unsigned char *kstr, int klen, pem_password_cb *cb, void *u); 311 unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
@@ -399,10 +322,6 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
399 DECLARE_PEM_write_bio(name, type) \ 322 DECLARE_PEM_write_bio(name, type) \
400 DECLARE_PEM_write_fp(name, type) 323 DECLARE_PEM_write_fp(name, type)
401 324
402#define DECLARE_PEM_write_const(name, type) \
403 DECLARE_PEM_write_bio_const(name, type) \
404 DECLARE_PEM_write_fp_const(name, type)
405
406#define DECLARE_PEM_write_cb(name, type) \ 325#define DECLARE_PEM_write_cb(name, type) \
407 DECLARE_PEM_write_cb_bio(name, type) \ 326 DECLARE_PEM_write_cb_bio(name, type) \
408 DECLARE_PEM_write_cb_fp(name, type) 327 DECLARE_PEM_write_cb_fp(name, type)
@@ -415,10 +334,6 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
415 DECLARE_PEM_read(name, type) \ 334 DECLARE_PEM_read(name, type) \
416 DECLARE_PEM_write(name, type) 335 DECLARE_PEM_write(name, type)
417 336
418#define DECLARE_PEM_rw_const(name, type) \
419 DECLARE_PEM_read(name, type) \
420 DECLARE_PEM_write_const(name, type)
421
422#define DECLARE_PEM_rw_cb(name, type) \ 337#define DECLARE_PEM_rw_cb(name, type) \
423 DECLARE_PEM_read(name, type) \ 338 DECLARE_PEM_read(name, type) \
424 DECLARE_PEM_write_cb(name, type) 339 DECLARE_PEM_write_cb(name, type)
@@ -488,6 +403,9 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
488 (char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,fp,\ 403 (char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,fp,\
489 (char **)x,cb,u) 404 (char **)x,cb,u)
490 405
406#define PEM_write_bio_SSL_SESSION(bp,x) \
407 PEM_ASN1_write_bio((int (*)())i2d_SSL_SESSION, \
408 PEM_STRING_SSL_SESSION,bp, (char *)x, NULL,NULL,0,NULL,NULL)
491#define PEM_write_bio_X509(bp,x) \ 409#define PEM_write_bio_X509(bp,x) \
492 PEM_ASN1_write_bio((int (*)())i2d_X509,PEM_STRING_X509,bp, \ 410 PEM_ASN1_write_bio((int (*)())i2d_X509,PEM_STRING_X509,bp, \
493 (char *)x, NULL,NULL,0,NULL,NULL) 411 (char *)x, NULL,NULL,0,NULL,NULL)
@@ -526,6 +444,8 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
526 PEM_STRING_X509,bp, \ 444 PEM_STRING_X509,bp, \
527 (char *)x, NULL,NULL,0,NULL,NULL) 445 (char *)x, NULL,NULL,0,NULL,NULL)
528 446
447#define PEM_read_bio_SSL_SESSION(bp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read_bio( \
448 (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,(char **)x,cb,u)
529#define PEM_read_bio_X509(bp,x,cb,u) (X509 *)PEM_ASN1_read_bio( \ 449#define PEM_read_bio_X509(bp,x,cb,u) (X509 *)PEM_ASN1_read_bio( \
530 (char *(*)())d2i_X509,PEM_STRING_X509,bp,(char **)x,cb,u) 450 (char *(*)())d2i_X509,PEM_STRING_X509,bp,(char **)x,cb,u)
531#define PEM_read_bio_X509_REQ(bp,x,cb,u) (X509_REQ *)PEM_ASN1_read_bio( \ 451#define PEM_read_bio_X509_REQ(bp,x,cb,u) (X509_REQ *)PEM_ASN1_read_bio( \
@@ -574,25 +494,11 @@ int PEM_write_bio(BIO *bp,const char *name,char *hdr,unsigned char *data,
574 long len); 494 long len);
575int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, 495int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp,
576 pem_password_cb *cb, void *u); 496 pem_password_cb *cb, void *u);
577void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, 497char * PEM_ASN1_read_bio(char *(*d2i)(),const char *name,BIO *bp,char **x,
578 void **x, pem_password_cb *cb, void *u); 498 pem_password_cb *cb, void *u);
579 499int PEM_ASN1_write_bio(int (*i2d)(),const char *name,BIO *bp,char *x,
580#define PEM_ASN1_read_bio_of(type,d2i,name,bp,x,cb,u) \
581 ((type*)PEM_ASN1_read_bio(CHECKED_D2I_OF(type, d2i), \
582 name, bp, \
583 CHECKED_PPTR_OF(type, x), \
584 cb, u))
585
586int PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp,char *x,
587 const EVP_CIPHER *enc,unsigned char *kstr,int klen, 500 const EVP_CIPHER *enc,unsigned char *kstr,int klen,
588 pem_password_cb *cb, void *u); 501 pem_password_cb *cb, void *u);
589
590#define PEM_ASN1_write_bio_of(type,i2d,name,bp,x,enc,kstr,klen,cb,u) \
591 (PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d), \
592 name, bp, \
593 CHECKED_PTR_OF(type, x), \
594 enc, kstr, klen, cb, u))
595
596STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); 502STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u);
597int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc, 503int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc,
598 unsigned char *kstr, int klen, pem_password_cb *cd, void *u); 504 unsigned char *kstr, int klen, pem_password_cb *cd, void *u);
@@ -602,11 +508,11 @@ int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc,
602int PEM_read(FILE *fp, char **name, char **header, 508int PEM_read(FILE *fp, char **name, char **header,
603 unsigned char **data,long *len); 509 unsigned char **data,long *len);
604int PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len); 510int PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len);
605void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, 511char * PEM_ASN1_read(char *(*d2i)(),const char *name,FILE *fp,char **x,
606 pem_password_cb *cb, void *u); 512 pem_password_cb *cb, void *u);
607int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, 513int PEM_ASN1_write(int (*i2d)(),const char *name,FILE *fp,char *x,
608 char *x,const EVP_CIPHER *enc,unsigned char *kstr, 514 const EVP_CIPHER *enc,unsigned char *kstr,int klen,
609 int klen,pem_password_cb *callback, void *u); 515 pem_password_cb *callback, void *u);
610STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, 516STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
611 pem_password_cb *cb, void *u); 517 pem_password_cb *cb, void *u);
612#endif 518#endif
@@ -636,8 +542,6 @@ DECLARE_PEM_rw(X509, X509)
636 542
637DECLARE_PEM_rw(X509_AUX, X509) 543DECLARE_PEM_rw(X509_AUX, X509)
638 544
639DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR)
640
641DECLARE_PEM_rw(X509_REQ, X509_REQ) 545DECLARE_PEM_rw(X509_REQ, X509_REQ)
642DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) 546DECLARE_PEM_write(X509_REQ_NEW, X509_REQ)
643 547
@@ -655,7 +559,7 @@ DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
655 559
656DECLARE_PEM_rw_cb(RSAPrivateKey, RSA) 560DECLARE_PEM_rw_cb(RSAPrivateKey, RSA)
657 561
658DECLARE_PEM_rw_const(RSAPublicKey, RSA) 562DECLARE_PEM_rw(RSAPublicKey, RSA)
659DECLARE_PEM_rw(RSA_PUBKEY, RSA) 563DECLARE_PEM_rw(RSA_PUBKEY, RSA)
660 564
661#endif 565#endif
@@ -666,19 +570,13 @@ DECLARE_PEM_rw_cb(DSAPrivateKey, DSA)
666 570
667DECLARE_PEM_rw(DSA_PUBKEY, DSA) 571DECLARE_PEM_rw(DSA_PUBKEY, DSA)
668 572
669DECLARE_PEM_rw_const(DSAparams, DSA) 573DECLARE_PEM_rw(DSAparams, DSA)
670
671#endif
672 574
673#ifndef OPENSSL_NO_EC
674DECLARE_PEM_rw_const(ECPKParameters, EC_GROUP)
675DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY)
676DECLARE_PEM_rw(EC_PUBKEY, EC_KEY)
677#endif 575#endif
678 576
679#ifndef OPENSSL_NO_DH 577#ifndef OPENSSL_NO_DH
680 578
681DECLARE_PEM_rw_const(DHparams, DH) 579DECLARE_PEM_rw(DHparams, DH)
682 580
683#endif 581#endif
684 582
@@ -728,27 +626,24 @@ void ERR_load_PEM_strings(void);
728/* Function codes. */ 626/* Function codes. */
729#define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120 627#define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120
730#define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121 628#define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121
731#define PEM_F_DO_PK8PKEY 126 629#define PEM_F_DEF_CALLBACK 100
732#define PEM_F_DO_PK8PKEY_FP 125
733#define PEM_F_LOAD_IV 101 630#define PEM_F_LOAD_IV 101
734#define PEM_F_PEM_ASN1_READ 102 631#define PEM_F_PEM_ASN1_READ 102
735#define PEM_F_PEM_ASN1_READ_BIO 103 632#define PEM_F_PEM_ASN1_READ_BIO 103
736#define PEM_F_PEM_ASN1_WRITE 104 633#define PEM_F_PEM_ASN1_WRITE 104
737#define PEM_F_PEM_ASN1_WRITE_BIO 105 634#define PEM_F_PEM_ASN1_WRITE_BIO 105
738#define PEM_F_PEM_DEF_CALLBACK 100
739#define PEM_F_PEM_DO_HEADER 106 635#define PEM_F_PEM_DO_HEADER 106
636#define PEM_F_PEM_F_DO_PK8KEY_FP 122
740#define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118 637#define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118
741#define PEM_F_PEM_GET_EVP_CIPHER_INFO 107 638#define PEM_F_PEM_GET_EVP_CIPHER_INFO 107
742#define PEM_F_PEM_PK8PKEY 119
743#define PEM_F_PEM_READ 108 639#define PEM_F_PEM_READ 108
744#define PEM_F_PEM_READ_BIO 109 640#define PEM_F_PEM_READ_BIO 109
745#define PEM_F_PEM_READ_BIO_PRIVATEKEY 123
746#define PEM_F_PEM_READ_PRIVATEKEY 124
747#define PEM_F_PEM_SEALFINAL 110 641#define PEM_F_PEM_SEALFINAL 110
748#define PEM_F_PEM_SEALINIT 111 642#define PEM_F_PEM_SEALINIT 111
749#define PEM_F_PEM_SIGNFINAL 112 643#define PEM_F_PEM_SIGNFINAL 112
750#define PEM_F_PEM_WRITE 113 644#define PEM_F_PEM_WRITE 113
751#define PEM_F_PEM_WRITE_BIO 114 645#define PEM_F_PEM_WRITE_BIO 114
646#define PEM_F_PEM_WRITE_BIO_PKCS8PRIVATEKEY 119
752#define PEM_F_PEM_X509_INFO_READ 115 647#define PEM_F_PEM_X509_INFO_READ 115
753#define PEM_F_PEM_X509_INFO_READ_BIO 116 648#define PEM_F_PEM_X509_INFO_READ_BIO 116
754#define PEM_F_PEM_X509_INFO_WRITE_BIO 117 649#define PEM_F_PEM_X509_INFO_WRITE_BIO 117
diff --git a/src/lib/libcrypto/pem/pem_all.c b/src/lib/libcrypto/pem/pem_all.c
index 66cbc7eb82..07963314c9 100644
--- a/src/lib/libcrypto/pem/pem_all.c
+++ b/src/lib/libcrypto/pem/pem_all.c
@@ -55,59 +55,6 @@
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58/* ====================================================================
59 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 *
65 * 1. Redistributions of source code must retain the above copyright
66 * notice, this list of conditions and the following disclaimer.
67 *
68 * 2. Redistributions in binary form must reproduce the above copyright
69 * notice, this list of conditions and the following disclaimer in
70 * the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3. All advertising materials mentioning features or use of this
74 * software must display the following acknowledgment:
75 * "This product includes software developed by the OpenSSL Project
76 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77 *
78 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79 * endorse or promote products derived from this software without
80 * prior written permission. For written permission, please contact
81 * openssl-core@openssl.org.
82 *
83 * 5. Products derived from this software may not be called "OpenSSL"
84 * nor may "OpenSSL" appear in their names without prior written
85 * permission of the OpenSSL Project.
86 *
87 * 6. Redistributions of any form whatsoever must retain the following
88 * acknowledgment:
89 * "This product includes software developed by the OpenSSL Project
90 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91 *
92 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
96 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103 * OF THE POSSIBILITY OF SUCH DAMAGE.
104 * ====================================================================
105 *
106 * This product includes cryptographic software written by Eric Young
107 * (eay@cryptsoft.com). This product includes software written by Tim
108 * Hudson (tjh@cryptsoft.com).
109 *
110 */
111 58
112#include <stdio.h> 59#include <stdio.h>
113#undef SSLEAY_MACROS 60#undef SSLEAY_MACROS
@@ -117,15 +64,7 @@
117#include <openssl/x509.h> 64#include <openssl/x509.h>
118#include <openssl/pkcs7.h> 65#include <openssl/pkcs7.h>
119#include <openssl/pem.h> 66#include <openssl/pem.h>
120#ifndef OPENSSL_NO_RSA 67#include <openssl/fips.h>
121#include <openssl/rsa.h>
122#endif
123#ifndef OPENSSL_NO_DSA
124#include <openssl/dsa.h>
125#endif
126#ifndef OPENSSL_NO_DH
127#include <openssl/dh.h>
128#endif
129 68
130#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
131static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa); 70static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa);
@@ -134,10 +73,6 @@ static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa);
134static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa); 73static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa);
135#endif 74#endif
136 75
137#ifndef OPENSSL_NO_EC
138static EC_KEY *pkey_get_eckey(EVP_PKEY *key, EC_KEY **eckey);
139#endif
140
141IMPLEMENT_PEM_rw(X509_REQ, X509_REQ, PEM_STRING_X509_REQ, X509_REQ) 76IMPLEMENT_PEM_rw(X509_REQ, X509_REQ, PEM_STRING_X509_REQ, X509_REQ)
142 77
143IMPLEMENT_PEM_write(X509_REQ_NEW, X509_REQ, PEM_STRING_X509_REQ_OLD, X509_REQ) 78IMPLEMENT_PEM_write(X509_REQ_NEW, X509_REQ, PEM_STRING_X509_REQ_OLD, X509_REQ)
@@ -194,8 +129,50 @@ RSA *PEM_read_RSAPrivateKey(FILE *fp, RSA **rsa, pem_password_cb *cb,
194 129
195#endif 130#endif
196 131
197IMPLEMENT_PEM_write_cb_const(RSAPrivateKey, RSA, PEM_STRING_RSA, RSAPrivateKey) 132#ifdef OPENSSL_FIPS
198IMPLEMENT_PEM_rw_const(RSAPublicKey, RSA, PEM_STRING_RSA_PUBLIC, RSAPublicKey) 133
134int PEM_write_bio_RSAPrivateKey(BIO *bp, RSA *x, const EVP_CIPHER *enc,
135 unsigned char *kstr, int klen,
136 pem_password_cb *cb, void *u)
137{
138 EVP_PKEY *k;
139 int ret;
140 k = EVP_PKEY_new();
141 if (!k)
142 return 0;
143 EVP_PKEY_set1_RSA(k, x);
144
145 ret = PEM_write_bio_PrivateKey(bp, k, enc, kstr, klen, cb, u);
146 EVP_PKEY_free(k);
147 return ret;
148}
149
150#ifndef OPENSSL_NO_FP_API
151int PEM_write_RSAPrivateKey(FILE *fp, RSA *x, const EVP_CIPHER *enc,
152 unsigned char *kstr, int klen,
153 pem_password_cb *cb, void *u)
154{
155 EVP_PKEY *k;
156 int ret;
157 k = EVP_PKEY_new();
158 if (!k)
159 return 0;
160
161 EVP_PKEY_set1_RSA(k, x);
162
163 ret = PEM_write_PrivateKey(fp, k, enc, kstr, klen, cb, u);
164 EVP_PKEY_free(k);
165 return ret;
166}
167#endif
168
169#else
170
171IMPLEMENT_PEM_write_cb(RSAPrivateKey, RSA, PEM_STRING_RSA, RSAPrivateKey)
172
173#endif
174
175IMPLEMENT_PEM_rw(RSAPublicKey, RSA, PEM_STRING_RSA_PUBLIC, RSAPublicKey)
199IMPLEMENT_PEM_rw(RSA_PUBKEY, RSA, PEM_STRING_PUBLIC, RSA_PUBKEY) 176IMPLEMENT_PEM_rw(RSA_PUBKEY, RSA, PEM_STRING_PUBLIC, RSA_PUBKEY)
200 177
201#endif 178#endif
@@ -224,73 +201,69 @@ DSA *PEM_read_bio_DSAPrivateKey(BIO *bp, DSA **dsa, pem_password_cb *cb,
224 return pkey_get_dsa(pktmp, dsa); 201 return pkey_get_dsa(pktmp, dsa);
225} 202}
226 203
227IMPLEMENT_PEM_write_cb_const(DSAPrivateKey, DSA, PEM_STRING_DSA, DSAPrivateKey)
228IMPLEMENT_PEM_rw(DSA_PUBKEY, DSA, PEM_STRING_PUBLIC, DSA_PUBKEY)
229 204
230#ifndef OPENSSL_NO_FP_API 205#ifdef OPENSSL_FIPS
231 206
232DSA *PEM_read_DSAPrivateKey(FILE *fp, DSA **dsa, pem_password_cb *cb, 207int PEM_write_bio_DSAPrivateKey(BIO *bp, DSA *x, const EVP_CIPHER *enc,
233 void *u) 208 unsigned char *kstr, int klen,
209 pem_password_cb *cb, void *u)
234{ 210{
235 EVP_PKEY *pktmp; 211 EVP_PKEY *k;
236 pktmp = PEM_read_PrivateKey(fp, NULL, cb, u); 212 int ret;
237 return pkey_get_dsa(pktmp, dsa); 213 k = EVP_PKEY_new();
214 if (!k)
215 return 0;
216 EVP_PKEY_set1_DSA(k, x);
217
218 ret = PEM_write_bio_PrivateKey(bp, k, enc, kstr, klen, cb, u);
219 EVP_PKEY_free(k);
220 return ret;
238} 221}
239 222
240#endif 223#ifndef OPENSSL_NO_FP_API
241 224int PEM_write_DSAPrivateKey(FILE *fp, DSA *x, const EVP_CIPHER *enc,
242IMPLEMENT_PEM_rw_const(DSAparams, DSA, PEM_STRING_DSAPARAMS, DSAparams) 225 unsigned char *kstr, int klen,
243 226 pem_password_cb *cb, void *u)
244#endif
245
246
247#ifndef OPENSSL_NO_EC
248static EC_KEY *pkey_get_eckey(EVP_PKEY *key, EC_KEY **eckey)
249{ 227{
250 EC_KEY *dtmp; 228 EVP_PKEY *k;
251 if(!key) return NULL; 229 int ret;
252 dtmp = EVP_PKEY_get1_EC_KEY(key); 230 k = EVP_PKEY_new();
253 EVP_PKEY_free(key); 231 if (!k)
254 if(!dtmp) return NULL; 232 return 0;
255 if(eckey) 233 EVP_PKEY_set1_DSA(k, x);
256 { 234 ret = PEM_write_PrivateKey(fp, k, enc, kstr, klen, cb, u);
257 EC_KEY_free(*eckey); 235 EVP_PKEY_free(k);
258 *eckey = dtmp; 236 return ret;
259 }
260 return dtmp;
261} 237}
238#endif
262 239
263EC_KEY *PEM_read_bio_ECPrivateKey(BIO *bp, EC_KEY **key, pem_password_cb *cb, 240#else
264 void *u)
265{
266 EVP_PKEY *pktmp;
267 pktmp = PEM_read_bio_PrivateKey(bp, NULL, cb, u);
268 return pkey_get_eckey(pktmp, key);
269}
270 241
271IMPLEMENT_PEM_rw_const(ECPKParameters, EC_GROUP, PEM_STRING_ECPARAMETERS, ECPKParameters) 242IMPLEMENT_PEM_write_cb(DSAPrivateKey, DSA, PEM_STRING_DSA, DSAPrivateKey)
272 243
273IMPLEMENT_PEM_write_cb(ECPrivateKey, EC_KEY, PEM_STRING_ECPRIVATEKEY, ECPrivateKey) 244#endif
274 245
275IMPLEMENT_PEM_rw(EC_PUBKEY, EC_KEY, PEM_STRING_PUBLIC, EC_PUBKEY) 246IMPLEMENT_PEM_rw(DSA_PUBKEY, DSA, PEM_STRING_PUBLIC, DSA_PUBKEY)
276 247
277#ifndef OPENSSL_NO_FP_API 248#ifndef OPENSSL_NO_FP_API
278 249
279EC_KEY *PEM_read_ECPrivateKey(FILE *fp, EC_KEY **eckey, pem_password_cb *cb, 250DSA *PEM_read_DSAPrivateKey(FILE *fp, DSA **dsa, pem_password_cb *cb,
280 void *u) 251 void *u)
281{ 252{
282 EVP_PKEY *pktmp; 253 EVP_PKEY *pktmp;
283 pktmp = PEM_read_PrivateKey(fp, NULL, cb, u); 254 pktmp = PEM_read_PrivateKey(fp, NULL, cb, u);
284 return pkey_get_eckey(pktmp, eckey); 255 return pkey_get_dsa(pktmp, dsa);
285} 256}
286 257
287#endif 258#endif
288 259
260IMPLEMENT_PEM_rw(DSAparams, DSA, PEM_STRING_DSAPARAMS, DSAparams)
261
289#endif 262#endif
290 263
291#ifndef OPENSSL_NO_DH 264#ifndef OPENSSL_NO_DH
292 265
293IMPLEMENT_PEM_rw_const(DHparams, DH, PEM_STRING_DHPARAMS, DHparams) 266IMPLEMENT_PEM_rw(DHparams, DH, PEM_STRING_DHPARAMS, DHparams)
294 267
295#endif 268#endif
296 269
@@ -301,8 +274,42 @@ IMPLEMENT_PEM_rw_const(DHparams, DH, PEM_STRING_DHPARAMS, DHparams)
301 * (When reading, parameter PEM_STRING_EVP_PKEY is a wildcard for anything 274 * (When reading, parameter PEM_STRING_EVP_PKEY is a wildcard for anything
302 * appropriate.) 275 * appropriate.)
303 */ 276 */
304IMPLEMENT_PEM_write_cb(PrivateKey, EVP_PKEY, ((x->type == EVP_PKEY_DSA)?PEM_STRING_DSA:\ 277
305 (x->type == EVP_PKEY_RSA)?PEM_STRING_RSA:PEM_STRING_ECPRIVATEKEY), PrivateKey) 278#ifdef OPENSSL_FIPS
279
280int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
281 unsigned char *kstr, int klen,
282 pem_password_cb *cb, void *u)
283 {
284 if (FIPS_mode())
285 return PEM_write_bio_PKCS8PrivateKey(bp, x, enc,
286 (char *)kstr, klen, cb, u);
287 else
288 return PEM_ASN1_write_bio((int (*)())i2d_PrivateKey,
289 (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),
290 bp,(char *)x,enc,kstr,klen,cb,u);
291 }
292
293#ifndef OPENSSL_NO_FP_API
294int PEM_write_PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
295 unsigned char *kstr, int klen,
296 pem_password_cb *cb, void *u)
297 {
298 if (FIPS_mode())
299 return PEM_write_PKCS8PrivateKey(fp, x, enc,
300 (char *)kstr, klen, cb, u);
301 else
302 return PEM_ASN1_write((int (*)())i2d_PrivateKey,
303 (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),
304 fp,(char *)x,enc,kstr,klen,cb,u);
305 }
306#endif
307
308#else
309
310IMPLEMENT_PEM_write_cb(PrivateKey, EVP_PKEY, ((x->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA), PrivateKey)
311
312#endif
306 313
307IMPLEMENT_PEM_rw(PUBKEY, EVP_PKEY, PEM_STRING_PUBLIC, PUBKEY) 314IMPLEMENT_PEM_rw(PUBKEY, EVP_PKEY, PEM_STRING_PUBLIC, PUBKEY)
308 315
diff --git a/src/lib/libcrypto/pem/pem_err.c b/src/lib/libcrypto/pem/pem_err.c
index 3133563d77..8527028ebc 100644
--- a/src/lib/libcrypto/pem/pem_err.c
+++ b/src/lib/libcrypto/pem/pem_err.c
@@ -72,27 +72,24 @@ static ERR_STRING_DATA PEM_str_functs[]=
72 { 72 {
73{ERR_FUNC(PEM_F_D2I_PKCS8PRIVATEKEY_BIO), "d2i_PKCS8PrivateKey_bio"}, 73{ERR_FUNC(PEM_F_D2I_PKCS8PRIVATEKEY_BIO), "d2i_PKCS8PrivateKey_bio"},
74{ERR_FUNC(PEM_F_D2I_PKCS8PRIVATEKEY_FP), "d2i_PKCS8PrivateKey_fp"}, 74{ERR_FUNC(PEM_F_D2I_PKCS8PRIVATEKEY_FP), "d2i_PKCS8PrivateKey_fp"},
75{ERR_FUNC(PEM_F_DO_PK8PKEY), "DO_PK8PKEY"}, 75{ERR_FUNC(PEM_F_DEF_CALLBACK), "DEF_CALLBACK"},
76{ERR_FUNC(PEM_F_DO_PK8PKEY_FP), "DO_PK8PKEY_FP"},
77{ERR_FUNC(PEM_F_LOAD_IV), "LOAD_IV"}, 76{ERR_FUNC(PEM_F_LOAD_IV), "LOAD_IV"},
78{ERR_FUNC(PEM_F_PEM_ASN1_READ), "PEM_ASN1_read"}, 77{ERR_FUNC(PEM_F_PEM_ASN1_READ), "PEM_ASN1_read"},
79{ERR_FUNC(PEM_F_PEM_ASN1_READ_BIO), "PEM_ASN1_read_bio"}, 78{ERR_FUNC(PEM_F_PEM_ASN1_READ_BIO), "PEM_ASN1_read_bio"},
80{ERR_FUNC(PEM_F_PEM_ASN1_WRITE), "PEM_ASN1_write"}, 79{ERR_FUNC(PEM_F_PEM_ASN1_WRITE), "PEM_ASN1_write"},
81{ERR_FUNC(PEM_F_PEM_ASN1_WRITE_BIO), "PEM_ASN1_write_bio"}, 80{ERR_FUNC(PEM_F_PEM_ASN1_WRITE_BIO), "PEM_ASN1_write_bio"},
82{ERR_FUNC(PEM_F_PEM_DEF_CALLBACK), "PEM_def_callback"},
83{ERR_FUNC(PEM_F_PEM_DO_HEADER), "PEM_do_header"}, 81{ERR_FUNC(PEM_F_PEM_DO_HEADER), "PEM_do_header"},
82{ERR_FUNC(PEM_F_PEM_F_DO_PK8KEY_FP), "PEM_F_DO_PK8KEY_FP"},
84{ERR_FUNC(PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY), "PEM_F_PEM_WRITE_PKCS8PRIVATEKEY"}, 83{ERR_FUNC(PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY), "PEM_F_PEM_WRITE_PKCS8PRIVATEKEY"},
85{ERR_FUNC(PEM_F_PEM_GET_EVP_CIPHER_INFO), "PEM_get_EVP_CIPHER_INFO"}, 84{ERR_FUNC(PEM_F_PEM_GET_EVP_CIPHER_INFO), "PEM_get_EVP_CIPHER_INFO"},
86{ERR_FUNC(PEM_F_PEM_PK8PKEY), "PEM_PK8PKEY"},
87{ERR_FUNC(PEM_F_PEM_READ), "PEM_read"}, 85{ERR_FUNC(PEM_F_PEM_READ), "PEM_read"},
88{ERR_FUNC(PEM_F_PEM_READ_BIO), "PEM_read_bio"}, 86{ERR_FUNC(PEM_F_PEM_READ_BIO), "PEM_read_bio"},
89{ERR_FUNC(PEM_F_PEM_READ_BIO_PRIVATEKEY), "PEM_READ_BIO_PRIVATEKEY"},
90{ERR_FUNC(PEM_F_PEM_READ_PRIVATEKEY), "PEM_READ_PRIVATEKEY"},
91{ERR_FUNC(PEM_F_PEM_SEALFINAL), "PEM_SealFinal"}, 87{ERR_FUNC(PEM_F_PEM_SEALFINAL), "PEM_SealFinal"},
92{ERR_FUNC(PEM_F_PEM_SEALINIT), "PEM_SealInit"}, 88{ERR_FUNC(PEM_F_PEM_SEALINIT), "PEM_SealInit"},
93{ERR_FUNC(PEM_F_PEM_SIGNFINAL), "PEM_SignFinal"}, 89{ERR_FUNC(PEM_F_PEM_SIGNFINAL), "PEM_SignFinal"},
94{ERR_FUNC(PEM_F_PEM_WRITE), "PEM_write"}, 90{ERR_FUNC(PEM_F_PEM_WRITE), "PEM_write"},
95{ERR_FUNC(PEM_F_PEM_WRITE_BIO), "PEM_write_bio"}, 91{ERR_FUNC(PEM_F_PEM_WRITE_BIO), "PEM_write_bio"},
92{ERR_FUNC(PEM_F_PEM_WRITE_BIO_PKCS8PRIVATEKEY), "PEM_write_bio_PKCS8PrivateKey"},
96{ERR_FUNC(PEM_F_PEM_X509_INFO_READ), "PEM_X509_INFO_read"}, 93{ERR_FUNC(PEM_F_PEM_X509_INFO_READ), "PEM_X509_INFO_read"},
97{ERR_FUNC(PEM_F_PEM_X509_INFO_READ_BIO), "PEM_X509_INFO_read_bio"}, 94{ERR_FUNC(PEM_F_PEM_X509_INFO_READ_BIO), "PEM_X509_INFO_read_bio"},
98{ERR_FUNC(PEM_F_PEM_X509_INFO_WRITE_BIO), "PEM_X509_INFO_write_bio"}, 95{ERR_FUNC(PEM_F_PEM_X509_INFO_WRITE_BIO), "PEM_X509_INFO_write_bio"},
@@ -124,12 +121,15 @@ static ERR_STRING_DATA PEM_str_reasons[]=
124 121
125void ERR_load_PEM_strings(void) 122void ERR_load_PEM_strings(void)
126 { 123 {
127#ifndef OPENSSL_NO_ERR 124 static int init=1;
128 125
129 if (ERR_func_error_string(PEM_str_functs[0].error) == NULL) 126 if (init)
130 { 127 {
128 init=0;
129#ifndef OPENSSL_NO_ERR
131 ERR_load_strings(0,PEM_str_functs); 130 ERR_load_strings(0,PEM_str_functs);
132 ERR_load_strings(0,PEM_str_reasons); 131 ERR_load_strings(0,PEM_str_reasons);
133 }
134#endif 132#endif
133
134 }
135 } 135 }
diff --git a/src/lib/libcrypto/pem/pem_info.c b/src/lib/libcrypto/pem/pem_info.c
index 3a273f6f70..9e4af29c95 100644
--- a/src/lib/libcrypto/pem/pem_info.c
+++ b/src/lib/libcrypto/pem/pem_info.c
@@ -63,12 +63,6 @@
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65#include <openssl/pem.h> 65#include <openssl/pem.h>
66#ifndef OPENSSL_NO_RSA
67#include <openssl/rsa.h>
68#endif
69#ifndef OPENSSL_NO_DSA
70#include <openssl/dsa.h>
71#endif
72 66
73#ifndef OPENSSL_NO_FP_API 67#ifndef OPENSSL_NO_FP_API
74STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u) 68STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u)
@@ -91,15 +85,13 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_p
91STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u) 85STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u)
92 { 86 {
93 X509_INFO *xi=NULL; 87 X509_INFO *xi=NULL;
94 char *name=NULL,*header=NULL; 88 char *name=NULL,*header=NULL,**pp;
95 void *pp; 89 unsigned char *data=NULL,*p;
96 unsigned char *data=NULL;
97 const unsigned char *p;
98 long len,error=0; 90 long len,error=0;
99 int ok=0; 91 int ok=0;
100 STACK_OF(X509_INFO) *ret=NULL; 92 STACK_OF(X509_INFO) *ret=NULL;
101 unsigned int i,raw; 93 unsigned int i,raw;
102 d2i_of_void *d2i; 94 char *(*d2i)();
103 95
104 if (sk == NULL) 96 if (sk == NULL)
105 { 97 {
@@ -131,42 +123,42 @@ start:
131 if ( (strcmp(name,PEM_STRING_X509) == 0) || 123 if ( (strcmp(name,PEM_STRING_X509) == 0) ||
132 (strcmp(name,PEM_STRING_X509_OLD) == 0)) 124 (strcmp(name,PEM_STRING_X509_OLD) == 0))
133 { 125 {
134 d2i=(D2I_OF(void))d2i_X509; 126 d2i=(char *(*)())d2i_X509;
135 if (xi->x509 != NULL) 127 if (xi->x509 != NULL)
136 { 128 {
137 if (!sk_X509_INFO_push(ret,xi)) goto err; 129 if (!sk_X509_INFO_push(ret,xi)) goto err;
138 if ((xi=X509_INFO_new()) == NULL) goto err; 130 if ((xi=X509_INFO_new()) == NULL) goto err;
139 goto start; 131 goto start;
140 } 132 }
141 pp=&(xi->x509); 133 pp=(char **)&(xi->x509);
142 } 134 }
143 else if ((strcmp(name,PEM_STRING_X509_TRUSTED) == 0)) 135 else if ((strcmp(name,PEM_STRING_X509_TRUSTED) == 0))
144 { 136 {
145 d2i=(D2I_OF(void))d2i_X509_AUX; 137 d2i=(char *(*)())d2i_X509_AUX;
146 if (xi->x509 != NULL) 138 if (xi->x509 != NULL)
147 { 139 {
148 if (!sk_X509_INFO_push(ret,xi)) goto err; 140 if (!sk_X509_INFO_push(ret,xi)) goto err;
149 if ((xi=X509_INFO_new()) == NULL) goto err; 141 if ((xi=X509_INFO_new()) == NULL) goto err;
150 goto start; 142 goto start;
151 } 143 }
152 pp=&(xi->x509); 144 pp=(char **)&(xi->x509);
153 } 145 }
154 else if (strcmp(name,PEM_STRING_X509_CRL) == 0) 146 else if (strcmp(name,PEM_STRING_X509_CRL) == 0)
155 { 147 {
156 d2i=(D2I_OF(void))d2i_X509_CRL; 148 d2i=(char *(*)())d2i_X509_CRL;
157 if (xi->crl != NULL) 149 if (xi->crl != NULL)
158 { 150 {
159 if (!sk_X509_INFO_push(ret,xi)) goto err; 151 if (!sk_X509_INFO_push(ret,xi)) goto err;
160 if ((xi=X509_INFO_new()) == NULL) goto err; 152 if ((xi=X509_INFO_new()) == NULL) goto err;
161 goto start; 153 goto start;
162 } 154 }
163 pp=&(xi->crl); 155 pp=(char **)&(xi->crl);
164 } 156 }
165 else 157 else
166#ifndef OPENSSL_NO_RSA 158#ifndef OPENSSL_NO_RSA
167 if (strcmp(name,PEM_STRING_RSA) == 0) 159 if (strcmp(name,PEM_STRING_RSA) == 0)
168 { 160 {
169 d2i=(D2I_OF(void))d2i_RSAPrivateKey; 161 d2i=(char *(*)())d2i_RSAPrivateKey;
170 if (xi->x_pkey != NULL) 162 if (xi->x_pkey != NULL)
171 { 163 {
172 if (!sk_X509_INFO_push(ret,xi)) goto err; 164 if (!sk_X509_INFO_push(ret,xi)) goto err;
@@ -181,7 +173,7 @@ start:
181 if ((xi->x_pkey->dec_pkey=EVP_PKEY_new()) == NULL) 173 if ((xi->x_pkey->dec_pkey=EVP_PKEY_new()) == NULL)
182 goto err; 174 goto err;
183 xi->x_pkey->dec_pkey->type=EVP_PKEY_RSA; 175 xi->x_pkey->dec_pkey->type=EVP_PKEY_RSA;
184 pp=&(xi->x_pkey->dec_pkey->pkey.rsa); 176 pp=(char **)&(xi->x_pkey->dec_pkey->pkey.rsa);
185 if ((int)strlen(header) > 10) /* assume encrypted */ 177 if ((int)strlen(header) > 10) /* assume encrypted */
186 raw=1; 178 raw=1;
187 } 179 }
@@ -190,7 +182,7 @@ start:
190#ifndef OPENSSL_NO_DSA 182#ifndef OPENSSL_NO_DSA
191 if (strcmp(name,PEM_STRING_DSA) == 0) 183 if (strcmp(name,PEM_STRING_DSA) == 0)
192 { 184 {
193 d2i=(D2I_OF(void))d2i_DSAPrivateKey; 185 d2i=(char *(*)())d2i_DSAPrivateKey;
194 if (xi->x_pkey != NULL) 186 if (xi->x_pkey != NULL)
195 { 187 {
196 if (!sk_X509_INFO_push(ret,xi)) goto err; 188 if (!sk_X509_INFO_push(ret,xi)) goto err;
@@ -205,36 +197,12 @@ start:
205 if ((xi->x_pkey->dec_pkey=EVP_PKEY_new()) == NULL) 197 if ((xi->x_pkey->dec_pkey=EVP_PKEY_new()) == NULL)
206 goto err; 198 goto err;
207 xi->x_pkey->dec_pkey->type=EVP_PKEY_DSA; 199 xi->x_pkey->dec_pkey->type=EVP_PKEY_DSA;
208 pp=&xi->x_pkey->dec_pkey->pkey.dsa; 200 pp=(char **)&(xi->x_pkey->dec_pkey->pkey.dsa);
209 if ((int)strlen(header) > 10) /* assume encrypted */ 201 if ((int)strlen(header) > 10) /* assume encrypted */
210 raw=1; 202 raw=1;
211 } 203 }
212 else 204 else
213#endif 205#endif
214#ifndef OPENSSL_NO_EC
215 if (strcmp(name,PEM_STRING_ECPRIVATEKEY) == 0)
216 {
217 d2i=(D2I_OF(void))d2i_ECPrivateKey;
218 if (xi->x_pkey != NULL)
219 {
220 if (!sk_X509_INFO_push(ret,xi)) goto err;
221 if ((xi=X509_INFO_new()) == NULL) goto err;
222 goto start;
223 }
224
225 xi->enc_data=NULL;
226 xi->enc_len=0;
227
228 xi->x_pkey=X509_PKEY_new();
229 if ((xi->x_pkey->dec_pkey=EVP_PKEY_new()) == NULL)
230 goto err;
231 xi->x_pkey->dec_pkey->type=EVP_PKEY_EC;
232 pp=&(xi->x_pkey->dec_pkey->pkey.ec);
233 if ((int)strlen(header) > 10) /* assume encrypted */
234 raw=1;
235 }
236 else
237#endif
238 { 206 {
239 d2i=NULL; 207 d2i=NULL;
240 pp=NULL; 208 pp=NULL;
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c
index 9bae4c8850..82815067b3 100644
--- a/src/lib/libcrypto/pem/pem_lib.c
+++ b/src/lib/libcrypto/pem/pem_lib.c
@@ -69,7 +69,7 @@
69#include <openssl/des.h> 69#include <openssl/des.h>
70#endif 70#endif
71 71
72const char PEM_version[]="PEM" OPENSSL_VERSION_PTEXT; 72const char *PEM_version="PEM" OPENSSL_VERSION_PTEXT;
73 73
74#define MIN_LENGTH 4 74#define MIN_LENGTH 4
75 75
@@ -81,7 +81,7 @@ int PEM_def_callback(char *buf, int num, int w, void *key)
81#ifdef OPENSSL_NO_FP_API 81#ifdef OPENSSL_NO_FP_API
82 /* We should not ever call the default callback routine from 82 /* We should not ever call the default callback routine from
83 * windows. */ 83 * windows. */
84 PEMerr(PEM_F_PEM_DEF_CALLBACK,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); 84 PEMerr(PEM_F_DEF_CALLBACK,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
85 return(-1); 85 return(-1);
86#else 86#else
87 int i,j; 87 int i,j;
@@ -102,7 +102,7 @@ int PEM_def_callback(char *buf, int num, int w, void *key)
102 i=EVP_read_pw_string(buf,num,prompt,w); 102 i=EVP_read_pw_string(buf,num,prompt,w);
103 if (i != 0) 103 if (i != 0)
104 { 104 {
105 PEMerr(PEM_F_PEM_DEF_CALLBACK,PEM_R_PROBLEMS_GETTING_PASSWORD); 105 PEMerr(PEM_F_DEF_CALLBACK,PEM_R_PROBLEMS_GETTING_PASSWORD);
106 memset(buf,0,(unsigned int)num); 106 memset(buf,0,(unsigned int)num);
107 return(-1); 107 return(-1);
108 } 108 }
@@ -158,11 +158,11 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str)
158 } 158 }
159 159
160#ifndef OPENSSL_NO_FP_API 160#ifndef OPENSSL_NO_FP_API
161void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, 161char *PEM_ASN1_read(char *(*d2i)(), const char *name, FILE *fp, char **x,
162 pem_password_cb *cb, void *u) 162 pem_password_cb *cb, void *u)
163 { 163 {
164 BIO *b; 164 BIO *b;
165 void *ret; 165 char *ret;
166 166
167 if ((b=BIO_new(BIO_s_file())) == NULL) 167 if ((b=BIO_new(BIO_s_file())) == NULL)
168 { 168 {
@@ -195,8 +195,6 @@ static int check_pem(const char *nm, const char *name)
195 if(!strcmp(nm,PEM_STRING_DSA) && 195 if(!strcmp(nm,PEM_STRING_DSA) &&
196 !strcmp(name,PEM_STRING_EVP_PKEY)) return 1; 196 !strcmp(name,PEM_STRING_EVP_PKEY)) return 1;
197 197
198 if(!strcmp(nm,PEM_STRING_ECPRIVATEKEY) &&
199 !strcmp(name,PEM_STRING_EVP_PKEY)) return 1;
200 /* Permit older strings */ 198 /* Permit older strings */
201 199
202 if(!strcmp(nm,PEM_STRING_X509_OLD) && 200 if(!strcmp(nm,PEM_STRING_X509_OLD) &&
@@ -260,9 +258,9 @@ err:
260 } 258 }
261 259
262#ifndef OPENSSL_NO_FP_API 260#ifndef OPENSSL_NO_FP_API
263int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp, 261int PEM_ASN1_write(int (*i2d)(), const char *name, FILE *fp, char *x,
264 char *x, const EVP_CIPHER *enc, unsigned char *kstr, 262 const EVP_CIPHER *enc, unsigned char *kstr, int klen,
265 int klen, pem_password_cb *callback, void *u) 263 pem_password_cb *callback, void *u)
266 { 264 {
267 BIO *b; 265 BIO *b;
268 int ret; 266 int ret;
@@ -279,9 +277,9 @@ int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,
279 } 277 }
280#endif 278#endif
281 279
282int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, 280int PEM_ASN1_write_bio(int (*i2d)(), const char *name, BIO *bp, char *x,
283 char *x, const EVP_CIPHER *enc, unsigned char *kstr, 281 const EVP_CIPHER *enc, unsigned char *kstr, int klen,
284 int klen, pem_password_cb *callback, void *u) 282 pem_password_cb *callback, void *u)
285 { 283 {
286 EVP_CIPHER_CTX ctx; 284 EVP_CIPHER_CTX ctx;
287 int dsize=0,i,j,ret=0; 285 int dsize=0,i,j,ret=0;
@@ -338,7 +336,7 @@ int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp,
338 kstr=(unsigned char *)buf; 336 kstr=(unsigned char *)buf;
339 } 337 }
340 RAND_add(data,i,0);/* put in the RSA key. */ 338 RAND_add(data,i,0);/* put in the RSA key. */
341 OPENSSL_assert(enc->iv_len <= (int)sizeof(iv)); 339 OPENSSL_assert(enc->iv_len <= sizeof iv);
342 if (RAND_pseudo_bytes(iv,enc->iv_len) < 0) /* Generate a salt */ 340 if (RAND_pseudo_bytes(iv,enc->iv_len) < 0) /* Generate a salt */
343 goto err; 341 goto err;
344 /* The 'iv' is used as the iv and as a salt. It is 342 /* The 'iv' is used as the iv and as a salt. It is
@@ -579,7 +577,6 @@ int PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data,
579 } 577 }
580 EVP_EncodeFinal(&ctx,buf,&outl); 578 EVP_EncodeFinal(&ctx,buf,&outl);
581 if ((outl > 0) && (BIO_write(bp,(char *)buf,outl) != outl)) goto err; 579 if ((outl > 0) && (BIO_write(bp,(char *)buf,outl) != outl)) goto err;
582 OPENSSL_cleanse(buf, PEM_BUFSIZE*8);
583 OPENSSL_free(buf); 580 OPENSSL_free(buf);
584 buf = NULL; 581 buf = NULL;
585 if ( (BIO_write(bp,"-----END ",9) != 9) || 582 if ( (BIO_write(bp,"-----END ",9) != 9) ||
@@ -588,10 +585,8 @@ int PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data,
588 goto err; 585 goto err;
589 return(i+outl); 586 return(i+outl);
590err: 587err:
591 if (buf) { 588 if (buf)
592 OPENSSL_cleanse(buf, PEM_BUFSIZE*8);
593 OPENSSL_free(buf); 589 OPENSSL_free(buf);
594 }
595 PEMerr(PEM_F_PEM_WRITE_BIO,reason); 590 PEMerr(PEM_F_PEM_WRITE_BIO,reason);
596 return(0); 591 return(0);
597 } 592 }
diff --git a/src/lib/libcrypto/pem/pem_oth.c b/src/lib/libcrypto/pem/pem_oth.c
index b33868d25a..8d9064ea7c 100644
--- a/src/lib/libcrypto/pem/pem_oth.c
+++ b/src/lib/libcrypto/pem/pem_oth.c
@@ -67,11 +67,10 @@
67 67
68/* Handle 'other' PEMs: not private keys */ 68/* Handle 'other' PEMs: not private keys */
69 69
70void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x, 70char *PEM_ASN1_read_bio(char *(*d2i)(), const char *name, BIO *bp, char **x,
71 pem_password_cb *cb, void *u) 71 pem_password_cb *cb, void *u)
72 { 72 {
73 const unsigned char *p=NULL; 73 unsigned char *p=NULL,*data=NULL;
74 unsigned char *data=NULL;
75 long len; 74 long len;
76 char *ret=NULL; 75 char *ret=NULL;
77 76
diff --git a/src/lib/libcrypto/pem/pem_pk8.c b/src/lib/libcrypto/pem/pem_pk8.c
index 6deab8c338..db38a2a79d 100644
--- a/src/lib/libcrypto/pem/pem_pk8.c
+++ b/src/lib/libcrypto/pem/pem_pk8.c
@@ -118,7 +118,7 @@ static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid, const EVP_CIPHER
118 char buf[PEM_BUFSIZE]; 118 char buf[PEM_BUFSIZE];
119 int ret; 119 int ret;
120 if(!(p8inf = EVP_PKEY2PKCS8(x))) { 120 if(!(p8inf = EVP_PKEY2PKCS8(x))) {
121 PEMerr(PEM_F_DO_PK8PKEY, 121 PEMerr(PEM_F_PEM_WRITE_BIO_PKCS8PRIVATEKEY,
122 PEM_R_ERROR_CONVERTING_PRIVATE_KEY); 122 PEM_R_ERROR_CONVERTING_PRIVATE_KEY);
123 return 0; 123 return 0;
124 } 124 }
@@ -127,7 +127,8 @@ static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid, const EVP_CIPHER
127 if(!cb) klen = PEM_def_callback(buf, PEM_BUFSIZE, 1, u); 127 if(!cb) klen = PEM_def_callback(buf, PEM_BUFSIZE, 1, u);
128 else klen = cb(buf, PEM_BUFSIZE, 1, u); 128 else klen = cb(buf, PEM_BUFSIZE, 1, u);
129 if(klen <= 0) { 129 if(klen <= 0) {
130 PEMerr(PEM_F_DO_PK8PKEY,PEM_R_READ_KEY); 130 PEMerr(PEM_F_PEM_WRITE_BIO_PKCS8PRIVATEKEY,
131 PEM_R_READ_KEY);
131 PKCS8_PRIV_KEY_INFO_free(p8inf); 132 PKCS8_PRIV_KEY_INFO_free(p8inf);
132 return 0; 133 return 0;
133 } 134 }
@@ -214,7 +215,7 @@ static int do_pk8pkey_fp(FILE *fp, EVP_PKEY *x, int isder, int nid, const EVP_CI
214 BIO *bp; 215 BIO *bp;
215 int ret; 216 int ret;
216 if(!(bp = BIO_new_fp(fp, BIO_NOCLOSE))) { 217 if(!(bp = BIO_new_fp(fp, BIO_NOCLOSE))) {
217 PEMerr(PEM_F_DO_PK8PKEY_FP,ERR_R_BUF_LIB); 218 PEMerr(PEM_F_PEM_F_DO_PK8KEY_FP,ERR_R_BUF_LIB);
218 return(0); 219 return(0);
219 } 220 }
220 ret = do_pk8pkey(bp, x, isder, nid, enc, kstr, klen, cb, u); 221 ret = do_pk8pkey(bp, x, isder, nid, enc, kstr, klen, cb, u);
diff --git a/src/lib/libcrypto/pem/pem_pkey.c b/src/lib/libcrypto/pem/pem_pkey.c
index 4da4c31ce5..9ecdbd5419 100644
--- a/src/lib/libcrypto/pem/pem_pkey.c
+++ b/src/lib/libcrypto/pem/pem_pkey.c
@@ -70,8 +70,7 @@
70EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u) 70EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u)
71 { 71 {
72 char *nm=NULL; 72 char *nm=NULL;
73 const unsigned char *p=NULL; 73 unsigned char *p=NULL,*data=NULL;
74 unsigned char *data=NULL;
75 long len; 74 long len;
76 EVP_PKEY *ret=NULL; 75 EVP_PKEY *ret=NULL;
77 76
@@ -83,8 +82,6 @@ EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, vo
83 ret=d2i_PrivateKey(EVP_PKEY_RSA,x,&p,len); 82 ret=d2i_PrivateKey(EVP_PKEY_RSA,x,&p,len);
84 else if (strcmp(nm,PEM_STRING_DSA) == 0) 83 else if (strcmp(nm,PEM_STRING_DSA) == 0)
85 ret=d2i_PrivateKey(EVP_PKEY_DSA,x,&p,len); 84 ret=d2i_PrivateKey(EVP_PKEY_DSA,x,&p,len);
86 else if (strcmp(nm,PEM_STRING_ECPRIVATEKEY) == 0)
87 ret=d2i_PrivateKey(EVP_PKEY_EC,x,&p,len);
88 else if (strcmp(nm,PEM_STRING_PKCS8INF) == 0) { 85 else if (strcmp(nm,PEM_STRING_PKCS8INF) == 0) {
89 PKCS8_PRIV_KEY_INFO *p8inf; 86 PKCS8_PRIV_KEY_INFO *p8inf;
90 p8inf=d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, len); 87 p8inf=d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, len);
@@ -105,7 +102,7 @@ EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, vo
105 if (cb) klen=cb(psbuf,PEM_BUFSIZE,0,u); 102 if (cb) klen=cb(psbuf,PEM_BUFSIZE,0,u);
106 else klen=PEM_def_callback(psbuf,PEM_BUFSIZE,0,u); 103 else klen=PEM_def_callback(psbuf,PEM_BUFSIZE,0,u);
107 if (klen <= 0) { 104 if (klen <= 0) {
108 PEMerr(PEM_F_PEM_READ_BIO_PRIVATEKEY, 105 PEMerr(PEM_F_PEM_ASN1_READ_BIO,
109 PEM_R_BAD_PASSWORD_READ); 106 PEM_R_BAD_PASSWORD_READ);
110 X509_SIG_free(p8); 107 X509_SIG_free(p8);
111 goto err; 108 goto err;
@@ -122,10 +119,9 @@ EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, vo
122 } 119 }
123p8err: 120p8err:
124 if (ret == NULL) 121 if (ret == NULL)
125 PEMerr(PEM_F_PEM_READ_BIO_PRIVATEKEY,ERR_R_ASN1_LIB); 122 PEMerr(PEM_F_PEM_ASN1_READ_BIO,ERR_R_ASN1_LIB);
126err: 123err:
127 OPENSSL_free(nm); 124 OPENSSL_free(nm);
128 OPENSSL_cleanse(data, len);
129 OPENSSL_free(data); 125 OPENSSL_free(data);
130 return(ret); 126 return(ret);
131 } 127 }
@@ -138,7 +134,7 @@ EVP_PKEY *PEM_read_PrivateKey(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void
138 134
139 if ((b=BIO_new(BIO_s_file())) == NULL) 135 if ((b=BIO_new(BIO_s_file())) == NULL)
140 { 136 {
141 PEMerr(PEM_F_PEM_READ_PRIVATEKEY,ERR_R_BUF_LIB); 137 PEMerr(PEM_F_PEM_ASN1_READ,ERR_R_BUF_LIB);
142 return(0); 138 return(0);
143 } 139 }
144 BIO_set_fp(b,fp,BIO_NOCLOSE); 140 BIO_set_fp(b,fp,BIO_NOCLOSE);
diff --git a/src/lib/libcrypto/pem/pem_seal.c b/src/lib/libcrypto/pem/pem_seal.c
index 4e554e5481..56e08abd70 100644
--- a/src/lib/libcrypto/pem/pem_seal.c
+++ b/src/lib/libcrypto/pem/pem_seal.c
@@ -56,7 +56,6 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <openssl/opensslconf.h> /* for OPENSSL_NO_RSA */
60#ifndef OPENSSL_NO_RSA 59#ifndef OPENSSL_NO_RSA
61#include <stdio.h> 60#include <stdio.h>
62#include "cryptlib.h" 61#include "cryptlib.h"
@@ -65,7 +64,6 @@
65#include <openssl/objects.h> 64#include <openssl/objects.h>
66#include <openssl/x509.h> 65#include <openssl/x509.h>
67#include <openssl/pem.h> 66#include <openssl/pem.h>
68#include <openssl/rsa.h>
69 67
70int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, 68int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type,
71 unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk, 69 unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk,
diff --git a/src/lib/libcrypto/pem/pem_xaux.c b/src/lib/libcrypto/pem/pem_xaux.c
index 63ce660cf1..2f579b5421 100644
--- a/src/lib/libcrypto/pem/pem_xaux.c
+++ b/src/lib/libcrypto/pem/pem_xaux.c
@@ -66,4 +66,3 @@
66#include <openssl/pem.h> 66#include <openssl/pem.h>
67 67
68IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX) 68IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX)
69IMPLEMENT_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR, PEM_STRING_X509_PAIR, X509_CERT_PAIR)