diff options
Diffstat (limited to 'src/lib/libcrypto/pkcs12')
-rw-r--r-- | src/lib/libcrypto/pkcs12/Makefile | 286 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_key.c | 38 |
2 files changed, 302 insertions, 22 deletions
diff --git a/src/lib/libcrypto/pkcs12/Makefile b/src/lib/libcrypto/pkcs12/Makefile new file mode 100644 index 0000000000..3a7498fe7a --- /dev/null +++ b/src/lib/libcrypto/pkcs12/Makefile | |||
@@ -0,0 +1,286 @@ | |||
1 | # | ||
2 | # OpenSSL/crypto/pkcs12/Makefile | ||
3 | # | ||
4 | |||
5 | DIR= pkcs12 | ||
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= p12_add.c p12_asn.c p12_attr.c p12_crpt.c p12_crt.c p12_decr.c \ | ||
21 | p12_init.c p12_key.c p12_kiss.c p12_mutl.c\ | ||
22 | p12_utl.c p12_npas.c pk12err.c p12_p8d.c p12_p8e.c | ||
23 | LIBOBJ= p12_add.o p12_asn.o p12_attr.o p12_crpt.o p12_crt.o p12_decr.o \ | ||
24 | p12_init.o p12_key.o p12_kiss.o p12_mutl.o\ | ||
25 | p12_utl.o p12_npas.o pk12err.o p12_p8d.o p12_p8e.o | ||
26 | |||
27 | SRC= $(LIBSRC) | ||
28 | |||
29 | EXHEADER= pkcs12.h | ||
30 | HEADER= $(EXHEADER) | ||
31 | |||
32 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
33 | |||
34 | top: | ||
35 | (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all) | ||
36 | |||
37 | test: | ||
38 | |||
39 | all: lib | ||
40 | |||
41 | lib: $(LIBOBJ) | ||
42 | $(AR) $(LIB) $(LIBOBJ) | ||
43 | $(RANLIB) $(LIB) || echo Never mind. | ||
44 | @touch lib | ||
45 | |||
46 | files: | ||
47 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | ||
48 | |||
49 | links: | ||
50 | @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER) | ||
51 | @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) | ||
52 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) | ||
53 | |||
54 | install: | ||
55 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... | ||
56 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ | ||
57 | do \ | ||
58 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | ||
59 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | ||
60 | done; | ||
61 | |||
62 | tags: | ||
63 | ctags $(SRC) | ||
64 | |||
65 | tests: | ||
66 | |||
67 | lint: | ||
68 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
69 | |||
70 | depend: | ||
71 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... | ||
72 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) | ||
73 | |||
74 | dclean: | ||
75 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
76 | mv -f Makefile.new $(MAKEFILE) | ||
77 | |||
78 | clean: | ||
79 | rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff | ||
80 | |||
81 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
82 | |||
83 | p12_add.o: ../../e_os.h ../../include/openssl/asn1.h | ||
84 | p12_add.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
85 | p12_add.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
86 | p12_add.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
87 | p12_add.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
88 | p12_add.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
89 | p12_add.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
90 | p12_add.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
91 | p12_add.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h | ||
92 | p12_add.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
93 | p12_add.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
94 | p12_add.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
95 | p12_add.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_add.c | ||
96 | p12_asn.o: ../../e_os.h ../../include/openssl/asn1.h | ||
97 | p12_asn.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
98 | p12_asn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
99 | p12_asn.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
100 | p12_asn.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
101 | p12_asn.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
102 | p12_asn.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
103 | p12_asn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
104 | p12_asn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
105 | p12_asn.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
106 | p12_asn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
107 | p12_asn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
108 | p12_asn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
109 | p12_asn.o: ../cryptlib.h p12_asn.c | ||
110 | p12_attr.o: ../../e_os.h ../../include/openssl/asn1.h | ||
111 | p12_attr.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
112 | p12_attr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
113 | p12_attr.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
114 | p12_attr.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
115 | p12_attr.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
116 | p12_attr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
117 | p12_attr.o: ../../include/openssl/opensslconf.h | ||
118 | p12_attr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
119 | p12_attr.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
120 | p12_attr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
121 | p12_attr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
122 | p12_attr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
123 | p12_attr.o: ../cryptlib.h p12_attr.c | ||
124 | p12_crpt.o: ../../e_os.h ../../include/openssl/asn1.h | ||
125 | p12_crpt.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
126 | p12_crpt.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
127 | p12_crpt.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
128 | p12_crpt.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
129 | p12_crpt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
130 | p12_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
131 | p12_crpt.o: ../../include/openssl/opensslconf.h | ||
132 | p12_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
133 | p12_crpt.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
134 | p12_crpt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
135 | p12_crpt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
136 | p12_crpt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
137 | p12_crpt.o: ../cryptlib.h p12_crpt.c | ||
138 | p12_crt.o: ../../e_os.h ../../include/openssl/asn1.h | ||
139 | p12_crt.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
140 | p12_crt.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
141 | p12_crt.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
142 | p12_crt.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
143 | p12_crt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
144 | p12_crt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
145 | p12_crt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
146 | p12_crt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h | ||
147 | p12_crt.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
148 | p12_crt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
149 | p12_crt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
150 | p12_crt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_crt.c | ||
151 | p12_decr.o: ../../e_os.h ../../include/openssl/asn1.h | ||
152 | p12_decr.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
153 | p12_decr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
154 | p12_decr.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
155 | p12_decr.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
156 | p12_decr.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
157 | p12_decr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
158 | p12_decr.o: ../../include/openssl/opensslconf.h | ||
159 | p12_decr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
160 | p12_decr.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
161 | p12_decr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
162 | p12_decr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
163 | p12_decr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
164 | p12_decr.o: ../cryptlib.h p12_decr.c | ||
165 | p12_init.o: ../../e_os.h ../../include/openssl/asn1.h | ||
166 | p12_init.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
167 | p12_init.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
168 | p12_init.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
169 | p12_init.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
170 | p12_init.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
171 | p12_init.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
172 | p12_init.o: ../../include/openssl/opensslconf.h | ||
173 | p12_init.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
174 | p12_init.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
175 | p12_init.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
176 | p12_init.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
177 | p12_init.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
178 | p12_init.o: ../cryptlib.h p12_init.c | ||
179 | p12_key.o: ../../e_os.h ../../include/openssl/asn1.h | ||
180 | p12_key.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
181 | p12_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
182 | p12_key.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
183 | p12_key.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
184 | p12_key.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
185 | p12_key.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
186 | p12_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
187 | p12_key.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
188 | p12_key.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
189 | p12_key.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
190 | p12_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
191 | p12_key.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
192 | p12_key.o: ../cryptlib.h p12_key.c | ||
193 | p12_kiss.o: ../../e_os.h ../../include/openssl/asn1.h | ||
194 | p12_kiss.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
195 | p12_kiss.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
196 | p12_kiss.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
197 | p12_kiss.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
198 | p12_kiss.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
199 | p12_kiss.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
200 | p12_kiss.o: ../../include/openssl/opensslconf.h | ||
201 | p12_kiss.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
202 | p12_kiss.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
203 | p12_kiss.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
204 | p12_kiss.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
205 | p12_kiss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
206 | p12_kiss.o: ../cryptlib.h p12_kiss.c | ||
207 | p12_mutl.o: ../../e_os.h ../../include/openssl/asn1.h | ||
208 | p12_mutl.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
209 | p12_mutl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
210 | p12_mutl.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
211 | p12_mutl.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
212 | p12_mutl.o: ../../include/openssl/evp.h ../../include/openssl/hmac.h | ||
213 | p12_mutl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
214 | p12_mutl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
215 | p12_mutl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
216 | p12_mutl.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
217 | p12_mutl.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h | ||
218 | p12_mutl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
219 | p12_mutl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
220 | p12_mutl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_mutl.c | ||
221 | p12_npas.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
222 | p12_npas.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
223 | p12_npas.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
224 | p12_npas.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
225 | p12_npas.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
226 | p12_npas.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
227 | p12_npas.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
228 | p12_npas.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
229 | p12_npas.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h | ||
230 | p12_npas.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
231 | p12_npas.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
232 | p12_npas.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
233 | p12_npas.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
234 | p12_npas.o: p12_npas.c | ||
235 | p12_p8d.o: ../../e_os.h ../../include/openssl/asn1.h | ||
236 | p12_p8d.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
237 | p12_p8d.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
238 | p12_p8d.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
239 | p12_p8d.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
240 | p12_p8d.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
241 | p12_p8d.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
242 | p12_p8d.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
243 | p12_p8d.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h | ||
244 | p12_p8d.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
245 | p12_p8d.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
246 | p12_p8d.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
247 | p12_p8d.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_p8d.c | ||
248 | p12_p8e.o: ../../e_os.h ../../include/openssl/asn1.h | ||
249 | p12_p8e.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
250 | p12_p8e.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
251 | p12_p8e.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
252 | p12_p8e.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
253 | p12_p8e.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
254 | p12_p8e.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
255 | p12_p8e.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
256 | p12_p8e.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h | ||
257 | p12_p8e.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
258 | p12_p8e.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
259 | p12_p8e.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
260 | p12_p8e.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_p8e.c | ||
261 | p12_utl.o: ../../e_os.h ../../include/openssl/asn1.h | ||
262 | p12_utl.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | ||
263 | p12_utl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
264 | p12_utl.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
265 | p12_utl.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
266 | p12_utl.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
267 | p12_utl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
268 | p12_utl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
269 | p12_utl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h | ||
270 | p12_utl.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
271 | p12_utl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
272 | p12_utl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
273 | p12_utl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_utl.c | ||
274 | pk12err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
275 | pk12err.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
276 | pk12err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
277 | pk12err.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
278 | pk12err.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
279 | pk12err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
280 | pk12err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
281 | pk12err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
282 | pk12err.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
283 | pk12err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
284 | pk12err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
285 | pk12err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
286 | pk12err.o: pk12err.c | ||
diff --git a/src/lib/libcrypto/pkcs12/p12_key.c b/src/lib/libcrypto/pkcs12/p12_key.c index 424203f648..a29794bbbc 100644 --- a/src/lib/libcrypto/pkcs12/p12_key.c +++ b/src/lib/libcrypto/pkcs12/p12_key.c | |||
@@ -107,7 +107,6 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, | |||
107 | unsigned char *B, *D, *I, *p, *Ai; | 107 | unsigned char *B, *D, *I, *p, *Ai; |
108 | int Slen, Plen, Ilen, Ijlen; | 108 | int Slen, Plen, Ilen, Ijlen; |
109 | int i, j, u, v; | 109 | int i, j, u, v; |
110 | int ret = 0; | ||
111 | BIGNUM *Ij, *Bpl1; /* These hold Ij and B + 1 */ | 110 | BIGNUM *Ij, *Bpl1; /* These hold Ij and B + 1 */ |
112 | EVP_MD_CTX ctx; | 111 | EVP_MD_CTX ctx; |
113 | #ifdef DEBUG_KEYGEN | 112 | #ifdef DEBUG_KEYGEN |
@@ -145,8 +144,10 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, | |||
145 | I = OPENSSL_malloc (Ilen); | 144 | I = OPENSSL_malloc (Ilen); |
146 | Ij = BN_new(); | 145 | Ij = BN_new(); |
147 | Bpl1 = BN_new(); | 146 | Bpl1 = BN_new(); |
148 | if (!D || !Ai || !B || !I || !Ij || !Bpl1) | 147 | if (!D || !Ai || !B || !I || !Ij || !Bpl1) { |
149 | goto err; | 148 | PKCS12err(PKCS12_F_PKCS12_KEY_GEN_UNI,ERR_R_MALLOC_FAILURE); |
149 | return 0; | ||
150 | } | ||
150 | for (i = 0; i < v; i++) D[i] = id; | 151 | for (i = 0; i < v; i++) D[i] = id; |
151 | p = I; | 152 | p = I; |
152 | for (i = 0; i < Slen; i++) *p++ = salt[i % saltlen]; | 153 | for (i = 0; i < Slen; i++) *p++ = salt[i % saltlen]; |
@@ -163,22 +164,28 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, | |||
163 | } | 164 | } |
164 | memcpy (out, Ai, min (n, u)); | 165 | memcpy (out, Ai, min (n, u)); |
165 | if (u >= n) { | 166 | if (u >= n) { |
167 | OPENSSL_free (Ai); | ||
168 | OPENSSL_free (B); | ||
169 | OPENSSL_free (D); | ||
170 | OPENSSL_free (I); | ||
171 | BN_free (Ij); | ||
172 | BN_free (Bpl1); | ||
173 | EVP_MD_CTX_cleanup(&ctx); | ||
166 | #ifdef DEBUG_KEYGEN | 174 | #ifdef DEBUG_KEYGEN |
167 | fprintf(stderr, "Output KEY (length %d)\n", tmpn); | 175 | fprintf(stderr, "Output KEY (length %d)\n", tmpn); |
168 | h__dump(tmpout, tmpn); | 176 | h__dump(tmpout, tmpn); |
169 | #endif | 177 | #endif |
170 | ret = 1; | 178 | return 1; |
171 | goto end; | ||
172 | } | 179 | } |
173 | n -= u; | 180 | n -= u; |
174 | out += u; | 181 | out += u; |
175 | for (j = 0; j < v; j++) B[j] = Ai[j % u]; | 182 | for (j = 0; j < v; j++) B[j] = Ai[j % u]; |
176 | /* Work out B + 1 first then can use B as tmp space */ | 183 | /* Work out B + 1 first then can use B as tmp space */ |
177 | if (!BN_bin2bn (B, v, Bpl1)) goto err; | 184 | BN_bin2bn (B, v, Bpl1); |
178 | if (!BN_add_word (Bpl1, 1)) goto err; | 185 | BN_add_word (Bpl1, 1); |
179 | for (j = 0; j < Ilen ; j+=v) { | 186 | for (j = 0; j < Ilen ; j+=v) { |
180 | if (!BN_bin2bn (I + j, v, Ij)) goto err; | 187 | BN_bin2bn (I + j, v, Ij); |
181 | if (!BN_add (Ij, Ij, Bpl1)) goto err; | 188 | BN_add (Ij, Ij, Bpl1); |
182 | BN_bn2bin (Ij, B); | 189 | BN_bn2bin (Ij, B); |
183 | Ijlen = BN_num_bytes (Ij); | 190 | Ijlen = BN_num_bytes (Ij); |
184 | /* If more than 2^(v*8) - 1 cut off MSB */ | 191 | /* If more than 2^(v*8) - 1 cut off MSB */ |
@@ -194,19 +201,6 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, | |||
194 | } else BN_bn2bin (Ij, I + j); | 201 | } else BN_bn2bin (Ij, I + j); |
195 | } | 202 | } |
196 | } | 203 | } |
197 | |||
198 | err: | ||
199 | PKCS12err(PKCS12_F_PKCS12_KEY_GEN_UNI,ERR_R_MALLOC_FAILURE); | ||
200 | |||
201 | end: | ||
202 | OPENSSL_free (Ai); | ||
203 | OPENSSL_free (B); | ||
204 | OPENSSL_free (D); | ||
205 | OPENSSL_free (I); | ||
206 | BN_free (Ij); | ||
207 | BN_free (Bpl1); | ||
208 | EVP_MD_CTX_cleanup(&ctx); | ||
209 | return ret; | ||
210 | } | 204 | } |
211 | #ifdef DEBUG_KEYGEN | 205 | #ifdef DEBUG_KEYGEN |
212 | void h__dump (unsigned char *p, int len) | 206 | void h__dump (unsigned char *p, int len) |