diff options
Diffstat (limited to 'src/lib/libcrypto/pem')
-rw-r--r-- | src/lib/libcrypto/pem/Makefile | 241 | ||||
-rw-r--r-- | src/lib/libcrypto/pem/Makefile.ssl | 336 | ||||
-rw-r--r-- | src/lib/libcrypto/pem/pem.h | 173 | ||||
-rw-r--r-- | src/lib/libcrypto/pem/pem_all.c | 233 | ||||
-rw-r--r-- | src/lib/libcrypto/pem/pem_err.c | 18 | ||||
-rw-r--r-- | src/lib/libcrypto/pem/pem_info.c | 58 | ||||
-rw-r--r-- | src/lib/libcrypto/pem/pem_lib.c | 33 | ||||
-rw-r--r-- | src/lib/libcrypto/pem/pem_oth.c | 7 | ||||
-rw-r--r-- | src/lib/libcrypto/pem/pem_pk8.c | 7 | ||||
-rw-r--r-- | src/lib/libcrypto/pem/pem_pkey.c | 12 | ||||
-rw-r--r-- | src/lib/libcrypto/pem/pem_seal.c | 2 | ||||
-rw-r--r-- | src/lib/libcrypto/pem/pem_xaux.c | 1 |
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 | |||
5 | DIR= pem | ||
6 | TOP= ../.. | ||
7 | CC= cc | ||
8 | INCLUDES= -I.. -I$(TOP) -I../../include | ||
9 | CFLAG=-g | ||
10 | MAKEFILE= Makefile | ||
11 | AR= ar r | ||
12 | |||
13 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
14 | |||
15 | GENERAL=Makefile | ||
16 | TEST= | ||
17 | APPS= | ||
18 | |||
19 | LIB=$(TOP)/libcrypto.a | ||
20 | LIBSRC= 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 | |||
23 | LIBOBJ= 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 | |||
26 | SRC= $(LIBSRC) | ||
27 | |||
28 | EXHEADER= pem.h pem2.h | ||
29 | HEADER= $(EXHEADER) | ||
30 | |||
31 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
32 | |||
33 | top: | ||
34 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) | ||
35 | |||
36 | all: lib | ||
37 | |||
38 | lib: $(LIBOBJ) | ||
39 | $(AR) $(LIB) $(LIBOBJ) | ||
40 | $(RANLIB) $(LIB) || echo Never mind. | ||
41 | @touch lib | ||
42 | |||
43 | files: | ||
44 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | ||
45 | |||
46 | links: $(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 | |||
51 | install: | ||
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 | |||
59 | tags: | ||
60 | ctags $(SRC) | ||
61 | |||
62 | tests: | ||
63 | |||
64 | lint: | ||
65 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
66 | |||
67 | depend: | ||
68 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... | ||
69 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC) | ||
70 | |||
71 | dclean: | ||
72 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
73 | mv -f Makefile.new $(MAKEFILE) | ||
74 | |||
75 | clean: | ||
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 | |||
80 | pem_all.o: ../../e_os.h ../../include/openssl/asn1.h | ||
81 | pem_all.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
82 | pem_all.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h | ||
83 | pem_all.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
84 | pem_all.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
85 | pem_all.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
86 | pem_all.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
87 | pem_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
88 | pem_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
89 | pem_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h | ||
90 | pem_all.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h | ||
91 | pem_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
92 | pem_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
93 | pem_all.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
94 | pem_all.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_all.c | ||
95 | pem_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
96 | pem_err.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
97 | pem_err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
98 | pem_err.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
99 | pem_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
100 | pem_err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
101 | pem_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
102 | pem_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
103 | pem_err.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
104 | pem_err.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
105 | pem_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
106 | pem_err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
107 | pem_err.o: ../../include/openssl/x509_vfy.h pem_err.c | ||
108 | pem_info.o: ../../e_os.h ../../include/openssl/asn1.h | ||
109 | pem_info.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
110 | pem_info.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h | ||
111 | pem_info.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
112 | pem_info.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
113 | pem_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
114 | pem_info.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
115 | pem_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
116 | pem_info.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
117 | pem_info.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
118 | pem_info.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h | ||
119 | pem_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
120 | pem_info.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
121 | pem_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
122 | pem_info.o: ../cryptlib.h pem_info.c | ||
123 | pem_lib.o: ../../e_os.h ../../include/openssl/asn1.h | ||
124 | pem_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
125 | pem_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
126 | pem_lib.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h | ||
127 | pem_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
128 | pem_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
129 | pem_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
130 | pem_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
131 | pem_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
132 | pem_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h | ||
133 | pem_lib.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h | ||
134 | pem_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
135 | pem_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
136 | pem_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
137 | pem_lib.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
138 | pem_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
139 | pem_lib.o: ../cryptlib.h pem_lib.c | ||
140 | pem_oth.o: ../../e_os.h ../../include/openssl/asn1.h | ||
141 | pem_oth.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
142 | pem_oth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
143 | pem_oth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
144 | pem_oth.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
145 | pem_oth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
146 | pem_oth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
147 | pem_oth.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
148 | pem_oth.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h | ||
149 | pem_oth.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h | ||
150 | pem_oth.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h | ||
151 | pem_oth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
152 | pem_oth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
153 | pem_oth.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_oth.c | ||
154 | pem_pk8.o: ../../e_os.h ../../include/openssl/asn1.h | ||
155 | pem_pk8.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
156 | pem_pk8.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
157 | pem_pk8.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
158 | pem_pk8.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
159 | pem_pk8.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
160 | pem_pk8.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
161 | pem_pk8.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
162 | pem_pk8.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h | ||
163 | pem_pk8.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h | ||
164 | pem_pk8.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
165 | pem_pk8.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
166 | pem_pk8.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
167 | pem_pk8.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
168 | pem_pk8.o: ../cryptlib.h pem_pk8.c | ||
169 | pem_pkey.o: ../../e_os.h ../../include/openssl/asn1.h | ||
170 | pem_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
171 | pem_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
172 | pem_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
173 | pem_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
174 | pem_pkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
175 | pem_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
176 | pem_pkey.o: ../../include/openssl/opensslconf.h | ||
177 | pem_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
178 | pem_pkey.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
179 | pem_pkey.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
180 | pem_pkey.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h | ||
181 | pem_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
182 | pem_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
183 | pem_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_pkey.c | ||
184 | pem_seal.o: ../../e_os.h ../../include/openssl/asn1.h | ||
185 | pem_seal.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
186 | pem_seal.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
187 | pem_seal.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
188 | pem_seal.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
189 | pem_seal.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
190 | pem_seal.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
191 | pem_seal.o: ../../include/openssl/opensslconf.h | ||
192 | pem_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
193 | pem_seal.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
194 | pem_seal.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
195 | pem_seal.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
196 | pem_seal.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
197 | pem_seal.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
198 | pem_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_seal.c | ||
199 | pem_sign.o: ../../e_os.h ../../include/openssl/asn1.h | ||
200 | pem_sign.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
201 | pem_sign.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
202 | pem_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
203 | pem_sign.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
204 | pem_sign.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
205 | pem_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
206 | pem_sign.o: ../../include/openssl/opensslconf.h | ||
207 | pem_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
208 | pem_sign.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
209 | pem_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
210 | pem_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
211 | pem_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
212 | pem_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
213 | pem_sign.o: ../cryptlib.h pem_sign.c | ||
214 | pem_x509.o: ../../e_os.h ../../include/openssl/asn1.h | ||
215 | pem_x509.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
216 | pem_x509.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
217 | pem_x509.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
218 | pem_x509.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
219 | pem_x509.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
220 | pem_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
221 | pem_x509.o: ../../include/openssl/opensslconf.h | ||
222 | pem_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
223 | pem_x509.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
224 | pem_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
225 | pem_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
226 | pem_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
227 | pem_x509.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_x509.c | ||
228 | pem_xaux.o: ../../e_os.h ../../include/openssl/asn1.h | ||
229 | pem_xaux.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
230 | pem_xaux.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
231 | pem_xaux.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
232 | pem_xaux.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
233 | pem_xaux.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
234 | pem_xaux.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
235 | pem_xaux.o: ../../include/openssl/opensslconf.h | ||
236 | pem_xaux.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
237 | pem_xaux.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
238 | pem_xaux.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
239 | pem_xaux.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
240 | pem_xaux.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
241 | pem_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 | |||
5 | DIR= pem | ||
6 | TOP= ../.. | ||
7 | CC= cc | ||
8 | INCLUDES= -I.. -I$(TOP) -I../../include | ||
9 | CFLAG=-g | ||
10 | INSTALL_PREFIX= | ||
11 | OPENSSLDIR= /usr/local/ssl | ||
12 | INSTALLTOP=/usr/local/ssl | ||
13 | MAKE= make -f Makefile.ssl | ||
14 | MAKEDEPPROG= makedepend | ||
15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
16 | MAKEFILE= Makefile.ssl | ||
17 | AR= ar r | ||
18 | |||
19 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
20 | |||
21 | GENERAL=Makefile | ||
22 | TEST= | ||
23 | APPS= | ||
24 | |||
25 | LIB=$(TOP)/libcrypto.a | ||
26 | LIBSRC= 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 | |||
29 | LIBOBJ= 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 | |||
32 | SRC= $(LIBSRC) | ||
33 | |||
34 | EXHEADER= pem.h pem2.h | ||
35 | HEADER= $(EXHEADER) | ||
36 | |||
37 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
38 | |||
39 | top: | ||
40 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) | ||
41 | |||
42 | all: lib | ||
43 | |||
44 | lib: $(LIBOBJ) | ||
45 | $(AR) $(LIB) $(LIBOBJ) | ||
46 | $(RANLIB) $(LIB) || echo Never mind. | ||
47 | @touch lib | ||
48 | |||
49 | files: | ||
50 | $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO | ||
51 | |||
52 | links: $(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 | |||
58 | install: | ||
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 | |||
65 | tags: | ||
66 | ctags $(SRC) | ||
67 | |||
68 | tests: | ||
69 | |||
70 | lint: | ||
71 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
72 | |||
73 | depend: | ||
74 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC) | ||
75 | |||
76 | dclean: | ||
77 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
78 | mv -f Makefile.new $(MAKEFILE) | ||
79 | |||
80 | clean: | ||
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 | |||
85 | pem_all.o: ../../e_os.h ../../include/openssl/aes.h | ||
86 | pem_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
87 | pem_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
88 | pem_all.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
89 | pem_all.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
90 | pem_all.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
91 | pem_all.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
92 | pem_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
93 | pem_all.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
94 | pem_all.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
95 | pem_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
96 | pem_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
97 | pem_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
98 | pem_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h | ||
99 | pem_all.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h | ||
100 | pem_all.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
101 | pem_all.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
102 | pem_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
103 | pem_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
104 | pem_all.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
105 | pem_all.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
106 | pem_all.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_all.c | ||
107 | pem_err.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h | ||
108 | pem_err.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
109 | pem_err.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
110 | pem_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
111 | pem_err.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | ||
112 | pem_err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
113 | pem_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
114 | pem_err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
115 | pem_err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
116 | pem_err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
117 | pem_err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
118 | pem_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
119 | pem_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
120 | pem_err.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
121 | pem_err.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
122 | pem_err.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
123 | pem_err.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
124 | pem_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
125 | pem_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
126 | pem_err.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
127 | pem_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
128 | pem_err.o: pem_err.c | ||
129 | pem_info.o: ../../e_os.h ../../include/openssl/aes.h | ||
130 | pem_info.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
131 | pem_info.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
132 | pem_info.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
133 | pem_info.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
134 | pem_info.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
135 | pem_info.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
136 | pem_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
137 | pem_info.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
138 | pem_info.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
139 | pem_info.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
140 | pem_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
141 | pem_info.o: ../../include/openssl/opensslconf.h | ||
142 | pem_info.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
143 | pem_info.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
144 | pem_info.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
145 | pem_info.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
146 | pem_info.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
147 | pem_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
148 | pem_info.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
149 | pem_info.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
150 | pem_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
151 | pem_info.o: ../cryptlib.h pem_info.c | ||
152 | pem_lib.o: ../../e_os.h ../../include/openssl/aes.h | ||
153 | pem_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
154 | pem_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
155 | pem_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
156 | pem_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
157 | pem_lib.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
158 | pem_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
159 | pem_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
160 | pem_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
161 | pem_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
162 | pem_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
163 | pem_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
164 | pem_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
165 | pem_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h | ||
166 | pem_lib.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h | ||
167 | pem_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
168 | pem_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
169 | pem_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
170 | pem_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
171 | pem_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
172 | pem_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
173 | pem_lib.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
174 | pem_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_lib.c | ||
175 | pem_oth.o: ../../e_os.h ../../include/openssl/aes.h | ||
176 | pem_oth.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
177 | pem_oth.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
178 | pem_oth.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
179 | pem_oth.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
180 | pem_oth.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
181 | pem_oth.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
182 | pem_oth.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
183 | pem_oth.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
184 | pem_oth.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
185 | pem_oth.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
186 | pem_oth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
187 | pem_oth.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
188 | pem_oth.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h | ||
189 | pem_oth.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h | ||
190 | pem_oth.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h | ||
191 | pem_oth.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
192 | pem_oth.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
193 | pem_oth.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
194 | pem_oth.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
195 | pem_oth.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
196 | pem_oth.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
197 | pem_oth.o: ../cryptlib.h pem_oth.c | ||
198 | pem_pk8.o: ../../e_os.h ../../include/openssl/aes.h | ||
199 | pem_pk8.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
200 | pem_pk8.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
201 | pem_pk8.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
202 | pem_pk8.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
203 | pem_pk8.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
204 | pem_pk8.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
205 | pem_pk8.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
206 | pem_pk8.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
207 | pem_pk8.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
208 | pem_pk8.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
209 | pem_pk8.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
210 | pem_pk8.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
211 | pem_pk8.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h | ||
212 | pem_pk8.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h | ||
213 | pem_pk8.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
214 | pem_pk8.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
215 | pem_pk8.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
216 | pem_pk8.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
217 | pem_pk8.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
218 | pem_pk8.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
219 | pem_pk8.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
220 | pem_pk8.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_pk8.c | ||
221 | pem_pkey.o: ../../e_os.h ../../include/openssl/aes.h | ||
222 | pem_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
223 | pem_pkey.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
224 | pem_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
225 | pem_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
226 | pem_pkey.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
227 | pem_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
228 | pem_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
229 | pem_pkey.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
230 | pem_pkey.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
231 | pem_pkey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
232 | pem_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
233 | pem_pkey.o: ../../include/openssl/opensslconf.h | ||
234 | pem_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
235 | pem_pkey.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
236 | pem_pkey.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
237 | pem_pkey.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h | ||
238 | pem_pkey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
239 | pem_pkey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
240 | pem_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
241 | pem_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
242 | pem_pkey.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
243 | pem_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
244 | pem_pkey.o: ../cryptlib.h pem_pkey.c | ||
245 | pem_seal.o: ../../e_os.h ../../include/openssl/aes.h | ||
246 | pem_seal.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
247 | pem_seal.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
248 | pem_seal.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
249 | pem_seal.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
250 | pem_seal.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
251 | pem_seal.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
252 | pem_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
253 | pem_seal.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
254 | pem_seal.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
255 | pem_seal.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
256 | pem_seal.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
257 | pem_seal.o: ../../include/openssl/opensslconf.h | ||
258 | pem_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
259 | pem_seal.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
260 | pem_seal.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
261 | pem_seal.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
262 | pem_seal.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
263 | pem_seal.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
264 | pem_seal.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
265 | pem_seal.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
266 | pem_seal.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
267 | pem_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_seal.c | ||
268 | pem_sign.o: ../../e_os.h ../../include/openssl/aes.h | ||
269 | pem_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
270 | pem_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
271 | pem_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
272 | pem_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
273 | pem_sign.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
274 | pem_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
275 | pem_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
276 | pem_sign.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
277 | pem_sign.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
278 | pem_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
279 | pem_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
280 | pem_sign.o: ../../include/openssl/opensslconf.h | ||
281 | pem_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
282 | pem_sign.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
283 | pem_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
284 | pem_sign.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
285 | pem_sign.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
286 | pem_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
287 | pem_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
288 | pem_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | ||
289 | pem_sign.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | ||
290 | pem_sign.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_sign.c | ||
291 | pem_x509.o: ../../e_os.h ../../include/openssl/aes.h | ||
292 | pem_x509.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
293 | pem_x509.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
294 | pem_x509.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
295 | pem_x509.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
296 | pem_x509.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
297 | pem_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
298 | pem_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
299 | pem_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
300 | pem_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
301 | pem_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
302 | pem_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
303 | pem_x509.o: ../../include/openssl/opensslconf.h | ||
304 | pem_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
305 | pem_x509.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
306 | pem_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
307 | pem_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
308 | pem_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
309 | pem_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
310 | pem_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
311 | pem_x509.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
312 | pem_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
313 | pem_x509.o: ../cryptlib.h pem_x509.c | ||
314 | pem_xaux.o: ../../e_os.h ../../include/openssl/aes.h | ||
315 | pem_xaux.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
316 | pem_xaux.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
317 | pem_xaux.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
318 | pem_xaux.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
319 | pem_xaux.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
320 | pem_xaux.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
321 | pem_xaux.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
322 | pem_xaux.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
323 | pem_xaux.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
324 | pem_xaux.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
325 | pem_xaux.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
326 | pem_xaux.o: ../../include/openssl/opensslconf.h | ||
327 | pem_xaux.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
328 | pem_xaux.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
329 | pem_xaux.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
330 | pem_xaux.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
331 | pem_xaux.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
332 | pem_xaux.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
333 | pem_xaux.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
334 | pem_xaux.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
335 | pem_xaux.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
336 | pem_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 |
74 | extern "C" { | 74 | extern "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) \ |
222 | type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\ | 214 | type *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), \ | 216 | return((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) \ |
231 | int PEM_write_##name(FILE *fp, type *x) \ | 221 | int PEM_write_##name(FILE *fp, type *x) \ |
232 | { \ | 222 | { \ |
233 | return PEM_ASN1_write(CHECKED_I2D_OF(type, i2d_##asn1), \ | 223 | return(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) \ | ||
240 | int 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) \ |
249 | int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ | 228 | int 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) \ | ||
260 | int 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) \ |
273 | type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\ | 239 | type *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), \ | 241 | return((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) \ |
282 | int PEM_write_bio_##name(BIO *bp, type *x) \ | 246 | int PEM_write_bio_##name(BIO *bp, type *x) \ |
283 | { \ | 247 | { \ |
284 | return PEM_ASN1_write_bio(CHECKED_I2D_OF(type, i2d_##asn1), \ | 248 | return(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) \ | ||
291 | int 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) \ |
300 | int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ | 253 | int 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) \ | ||
310 | int 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); |
575 | int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, | 495 | int 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); |
577 | void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, | 497 | char * 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 | 499 | int 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 | |||
586 | int 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 | |||
596 | STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); | 502 | STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); |
597 | int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc, | 503 | int 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, | |||
602 | int PEM_read(FILE *fp, char **name, char **header, | 508 | int PEM_read(FILE *fp, char **name, char **header, |
603 | unsigned char **data,long *len); | 509 | unsigned char **data,long *len); |
604 | int PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len); | 510 | int PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len); |
605 | void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, | 511 | char * 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); |
607 | int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, | 513 | int 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); |
610 | STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, | 516 | STACK_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 | ||
637 | DECLARE_PEM_rw(X509_AUX, X509) | 543 | DECLARE_PEM_rw(X509_AUX, X509) |
638 | 544 | ||
639 | DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR) | ||
640 | |||
641 | DECLARE_PEM_rw(X509_REQ, X509_REQ) | 545 | DECLARE_PEM_rw(X509_REQ, X509_REQ) |
642 | DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) | 546 | DECLARE_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 | ||
656 | DECLARE_PEM_rw_cb(RSAPrivateKey, RSA) | 560 | DECLARE_PEM_rw_cb(RSAPrivateKey, RSA) |
657 | 561 | ||
658 | DECLARE_PEM_rw_const(RSAPublicKey, RSA) | 562 | DECLARE_PEM_rw(RSAPublicKey, RSA) |
659 | DECLARE_PEM_rw(RSA_PUBKEY, RSA) | 563 | DECLARE_PEM_rw(RSA_PUBKEY, RSA) |
660 | 564 | ||
661 | #endif | 565 | #endif |
@@ -666,19 +570,13 @@ DECLARE_PEM_rw_cb(DSAPrivateKey, DSA) | |||
666 | 570 | ||
667 | DECLARE_PEM_rw(DSA_PUBKEY, DSA) | 571 | DECLARE_PEM_rw(DSA_PUBKEY, DSA) |
668 | 572 | ||
669 | DECLARE_PEM_rw_const(DSAparams, DSA) | 573 | DECLARE_PEM_rw(DSAparams, DSA) |
670 | |||
671 | #endif | ||
672 | 574 | ||
673 | #ifndef OPENSSL_NO_EC | ||
674 | DECLARE_PEM_rw_const(ECPKParameters, EC_GROUP) | ||
675 | DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY) | ||
676 | DECLARE_PEM_rw(EC_PUBKEY, EC_KEY) | ||
677 | #endif | 575 | #endif |
678 | 576 | ||
679 | #ifndef OPENSSL_NO_DH | 577 | #ifndef OPENSSL_NO_DH |
680 | 578 | ||
681 | DECLARE_PEM_rw_const(DHparams, DH) | 579 | DECLARE_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 |
131 | static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa); | 70 | static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa); |
@@ -134,10 +73,6 @@ static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa); | |||
134 | static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa); | 73 | static DSA *pkey_get_dsa(EVP_PKEY *key, DSA **dsa); |
135 | #endif | 74 | #endif |
136 | 75 | ||
137 | #ifndef OPENSSL_NO_EC | ||
138 | static EC_KEY *pkey_get_eckey(EVP_PKEY *key, EC_KEY **eckey); | ||
139 | #endif | ||
140 | |||
141 | IMPLEMENT_PEM_rw(X509_REQ, X509_REQ, PEM_STRING_X509_REQ, X509_REQ) | 76 | IMPLEMENT_PEM_rw(X509_REQ, X509_REQ, PEM_STRING_X509_REQ, X509_REQ) |
142 | 77 | ||
143 | IMPLEMENT_PEM_write(X509_REQ_NEW, X509_REQ, PEM_STRING_X509_REQ_OLD, X509_REQ) | 78 | IMPLEMENT_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 | ||
197 | IMPLEMENT_PEM_write_cb_const(RSAPrivateKey, RSA, PEM_STRING_RSA, RSAPrivateKey) | 132 | #ifdef OPENSSL_FIPS |
198 | IMPLEMENT_PEM_rw_const(RSAPublicKey, RSA, PEM_STRING_RSA_PUBLIC, RSAPublicKey) | 133 | |
134 | int 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 | ||
151 | int 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 | |||
171 | IMPLEMENT_PEM_write_cb(RSAPrivateKey, RSA, PEM_STRING_RSA, RSAPrivateKey) | ||
172 | |||
173 | #endif | ||
174 | |||
175 | IMPLEMENT_PEM_rw(RSAPublicKey, RSA, PEM_STRING_RSA_PUBLIC, RSAPublicKey) | ||
199 | IMPLEMENT_PEM_rw(RSA_PUBKEY, RSA, PEM_STRING_PUBLIC, RSA_PUBKEY) | 176 | IMPLEMENT_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 | ||
227 | IMPLEMENT_PEM_write_cb_const(DSAPrivateKey, DSA, PEM_STRING_DSA, DSAPrivateKey) | ||
228 | IMPLEMENT_PEM_rw(DSA_PUBKEY, DSA, PEM_STRING_PUBLIC, DSA_PUBKEY) | ||
229 | 204 | ||
230 | #ifndef OPENSSL_NO_FP_API | 205 | #ifdef OPENSSL_FIPS |
231 | 206 | ||
232 | DSA *PEM_read_DSAPrivateKey(FILE *fp, DSA **dsa, pem_password_cb *cb, | 207 | int 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 | 224 | int PEM_write_DSAPrivateKey(FILE *fp, DSA *x, const EVP_CIPHER *enc, | |
242 | IMPLEMENT_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 | ||
248 | static 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 | ||
263 | EC_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 | ||
271 | IMPLEMENT_PEM_rw_const(ECPKParameters, EC_GROUP, PEM_STRING_ECPARAMETERS, ECPKParameters) | 242 | IMPLEMENT_PEM_write_cb(DSAPrivateKey, DSA, PEM_STRING_DSA, DSAPrivateKey) |
272 | 243 | ||
273 | IMPLEMENT_PEM_write_cb(ECPrivateKey, EC_KEY, PEM_STRING_ECPRIVATEKEY, ECPrivateKey) | 244 | #endif |
274 | 245 | ||
275 | IMPLEMENT_PEM_rw(EC_PUBKEY, EC_KEY, PEM_STRING_PUBLIC, EC_PUBKEY) | 246 | IMPLEMENT_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 | ||
279 | EC_KEY *PEM_read_ECPrivateKey(FILE *fp, EC_KEY **eckey, pem_password_cb *cb, | 250 | DSA *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 | ||
260 | IMPLEMENT_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 | ||
293 | IMPLEMENT_PEM_rw_const(DHparams, DH, PEM_STRING_DHPARAMS, DHparams) | 266 | IMPLEMENT_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 | */ |
304 | IMPLEMENT_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 | |||
280 | int 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 | ||
294 | int 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 | |||
310 | IMPLEMENT_PEM_write_cb(PrivateKey, EVP_PKEY, ((x->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA), PrivateKey) | ||
311 | |||
312 | #endif | ||
306 | 313 | ||
307 | IMPLEMENT_PEM_rw(PUBKEY, EVP_PKEY, PEM_STRING_PUBLIC, PUBKEY) | 314 | IMPLEMENT_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 | ||
125 | void ERR_load_PEM_strings(void) | 122 | void 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 |
74 | STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u) | 68 | STACK_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 | |||
91 | STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u) | 85 | STACK_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 | ||
72 | const char PEM_version[]="PEM" OPENSSL_VERSION_PTEXT; | 72 | const 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 |
161 | void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, | 161 | char *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 |
263 | int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp, | 261 | int 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 | ||
282 | int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, | 280 | int 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); |
590 | err: | 587 | err: |
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 | ||
70 | void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x, | 70 | char *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 @@ | |||
70 | EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u) | 70 | EVP_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 | } |
123 | p8err: | 120 | p8err: |
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); |
126 | err: | 123 | err: |
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 | ||
70 | int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, | 68 | int 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 | ||
68 | IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX) | 68 | IMPLEMENT_PEM_rw(X509_AUX, X509, PEM_STRING_X509_TRUSTED, X509_AUX) |
69 | IMPLEMENT_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR, PEM_STRING_X509_PAIR, X509_CERT_PAIR) | ||