diff options
Diffstat (limited to 'src/lib/libcrypto/pkcs12')
-rw-r--r-- | src/lib/libcrypto/pkcs12/Makefile.ssl | 477 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_add.c | 87 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_asn.c | 125 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_attr.c | 155 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_crpt.c | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_crt.c | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_decr.c | 69 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_init.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_key.c | 16 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_kiss.c | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_mutl.c | 15 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_npas.c | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_p8d.c | 68 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_p8e.c | 97 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_utl.c | 40 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/pk12err.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/pkcs12/pkcs12.h | 125 |
17 files changed, 699 insertions, 623 deletions
diff --git a/src/lib/libcrypto/pkcs12/Makefile.ssl b/src/lib/libcrypto/pkcs12/Makefile.ssl index d745c53621..d62f7eb7dd 100644 --- a/src/lib/libcrypto/pkcs12/Makefile.ssl +++ b/src/lib/libcrypto/pkcs12/Makefile.ssl | |||
@@ -5,13 +5,14 @@ | |||
5 | DIR= pkcs12 | 5 | DIR= pkcs12 |
6 | TOP= ../.. | 6 | TOP= ../.. |
7 | CC= cc | 7 | CC= cc |
8 | INCLUDES= -I.. -I../../include | 8 | INCLUDES= -I.. -I$(TOP) -I../../include |
9 | CFLAG=-g | 9 | CFLAG=-g |
10 | INSTALL_PREFIX= | 10 | INSTALL_PREFIX= |
11 | OPENSSLDIR= /usr/local/ssl | 11 | OPENSSLDIR= /usr/local/ssl |
12 | INSTALLTOP=/usr/local/ssl | 12 | INSTALLTOP=/usr/local/ssl |
13 | MAKE= make -f Makefile.ssl | 13 | MAKE= make -f Makefile.ssl |
14 | MAKEDEPEND= $(TOP)/util/domd $(TOP) | 14 | MAKEDEPPROG= makedepend |
15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
15 | MAKEFILE= Makefile.ssl | 16 | MAKEFILE= Makefile.ssl |
16 | AR= ar r | 17 | AR= ar r |
17 | 18 | ||
@@ -22,12 +23,12 @@ TEST= | |||
22 | APPS= | 23 | APPS= |
23 | 24 | ||
24 | LIB=$(TOP)/libcrypto.a | 25 | LIB=$(TOP)/libcrypto.a |
25 | LIBSRC= p12_add.c p12_attr.c p12_bags.c p12_crpt.c p12_crt.c p12_decr.c \ | 26 | LIBSRC= p12_add.c p12_asn.c p12_attr.c p12_crpt.c p12_crt.c p12_decr.c \ |
26 | p12_init.c p12_key.c p12_kiss.c p12_lib.c p12_mac.c p12_mutl.c\ | 27 | p12_init.c p12_key.c p12_kiss.c p12_mutl.c\ |
27 | p12_sbag.c p12_utl.c p12_npas.c pk12err.c | 28 | p12_utl.c p12_npas.c pk12err.c p12_p8d.c p12_p8e.c |
28 | LIBOBJ= p12_add.o p12_attr.o p12_bags.o p12_crpt.o p12_crt.o p12_decr.o \ | 29 | LIBOBJ= p12_add.o p12_asn.o p12_attr.o p12_crpt.o p12_crt.o p12_decr.o \ |
29 | p12_init.o p12_key.o p12_kiss.o p12_lib.o p12_mac.o p12_mutl.o\ | 30 | p12_init.o p12_key.o p12_kiss.o p12_mutl.o\ |
30 | p12_sbag.o p12_utl.o p12_npas.o pk12err.o | 31 | p12_utl.o p12_npas.o pk12err.o p12_p8d.o p12_p8e.o |
31 | 32 | ||
32 | SRC= $(LIBSRC) | 33 | SRC= $(LIBSRC) |
33 | 34 | ||
@@ -45,8 +46,7 @@ all: lib | |||
45 | 46 | ||
46 | lib: $(LIBOBJ) | 47 | lib: $(LIBOBJ) |
47 | $(AR) $(LIB) $(LIBOBJ) | 48 | $(AR) $(LIB) $(LIBOBJ) |
48 | @echo You may get an error following this line. Please ignore. | 49 | $(RANLIB) $(LIB) || echo Never mind. |
49 | - $(RANLIB) $(LIB) | ||
50 | @touch lib | 50 | @touch lib |
51 | 51 | ||
52 | files: | 52 | files: |
@@ -85,316 +85,213 @@ clean: | |||
85 | 85 | ||
86 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 86 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
87 | 87 | ||
88 | p12_add.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 88 | p12_add.o: ../../e_os.h ../../include/openssl/asn1.h |
89 | p12_add.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 89 | p12_add.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
90 | p12_add.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 90 | p12_add.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
91 | p12_add.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
92 | p12_add.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 91 | p12_add.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
93 | p12_add.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 92 | p12_add.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
94 | p12_add.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 93 | p12_add.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
95 | p12_add.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
96 | p12_add.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
97 | p12_add.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
98 | p12_add.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 94 | p12_add.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
99 | p12_add.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 95 | p12_add.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
100 | p12_add.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | 96 | p12_add.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h |
101 | p12_add.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 97 | p12_add.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
102 | p12_add.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 98 | p12_add.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
103 | p12_add.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 99 | p12_add.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
104 | p12_add.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 100 | p12_add.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
105 | p12_add.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 101 | p12_add.o: ../cryptlib.h p12_add.c |
106 | p12_add.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 102 | p12_asn.o: ../../e_os.h ../../include/openssl/asn1.h |
107 | p12_attr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 103 | p12_asn.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
108 | p12_attr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 104 | p12_asn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
109 | p12_attr.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 105 | p12_asn.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
110 | p12_attr.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 106 | p12_asn.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
107 | p12_asn.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
108 | p12_asn.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
109 | p12_asn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
110 | p12_asn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
111 | p12_asn.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | ||
112 | p12_asn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
113 | p12_asn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
114 | p12_asn.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
115 | p12_asn.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_asn.c | ||
116 | p12_attr.o: ../../e_os.h ../../include/openssl/asn1.h | ||
117 | p12_attr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
118 | p12_attr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
111 | p12_attr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 119 | p12_attr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
112 | p12_attr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 120 | p12_attr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
113 | p12_attr.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 121 | p12_attr.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
114 | p12_attr.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
115 | p12_attr.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
116 | p12_attr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
117 | p12_attr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 122 | p12_attr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
118 | p12_attr.o: ../../include/openssl/opensslconf.h | 123 | p12_attr.o: ../../include/openssl/opensslconf.h |
119 | p12_attr.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h | 124 | p12_attr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
120 | p12_attr.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 125 | p12_attr.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h |
121 | p12_attr.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 126 | p12_attr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
122 | p12_attr.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 127 | p12_attr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
123 | p12_attr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 128 | p12_attr.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
124 | p12_attr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 129 | p12_attr.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_attr.c |
125 | p12_attr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 130 | p12_crpt.o: ../../e_os.h ../../include/openssl/asn1.h |
126 | p12_attr.o: ../cryptlib.h | 131 | p12_crpt.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
127 | p12_bags.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 132 | p12_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
128 | p12_bags.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
129 | p12_bags.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
130 | p12_bags.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
131 | p12_bags.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
132 | p12_bags.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
133 | p12_bags.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
134 | p12_bags.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
135 | p12_bags.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
136 | p12_bags.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
137 | p12_bags.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
138 | p12_bags.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
139 | p12_bags.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h | ||
140 | p12_bags.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
141 | p12_bags.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
142 | p12_bags.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
143 | p12_bags.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
144 | p12_bags.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
145 | p12_bags.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
146 | p12_bags.o: ../cryptlib.h | ||
147 | p12_crpt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
148 | p12_crpt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
149 | p12_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
150 | p12_crpt.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
151 | p12_crpt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 133 | p12_crpt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
152 | p12_crpt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 134 | p12_crpt.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
153 | p12_crpt.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 135 | p12_crpt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
154 | p12_crpt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
155 | p12_crpt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
156 | p12_crpt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
157 | p12_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 136 | p12_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
158 | p12_crpt.o: ../../include/openssl/opensslconf.h | 137 | p12_crpt.o: ../../include/openssl/opensslconf.h |
159 | p12_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h | 138 | p12_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
160 | p12_crpt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 139 | p12_crpt.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h |
161 | p12_crpt.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 140 | p12_crpt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
162 | p12_crpt.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 141 | p12_crpt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
163 | p12_crpt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 142 | p12_crpt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
164 | p12_crpt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 143 | p12_crpt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_crpt.c |
165 | p12_crpt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 144 | p12_crt.o: ../../e_os.h ../../include/openssl/asn1.h |
166 | p12_crpt.o: ../cryptlib.h | 145 | p12_crt.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
167 | p12_crt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 146 | p12_crt.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
168 | p12_crt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
169 | p12_crt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
170 | p12_crt.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
171 | p12_crt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 147 | p12_crt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
172 | p12_crt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 148 | p12_crt.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
173 | p12_crt.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 149 | p12_crt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
174 | p12_crt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
175 | p12_crt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
176 | p12_crt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
177 | p12_crt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 150 | p12_crt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
178 | p12_crt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 151 | p12_crt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
179 | p12_crt.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | 152 | p12_crt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h |
180 | p12_crt.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 153 | p12_crt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
181 | p12_crt.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 154 | p12_crt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
182 | p12_crt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 155 | p12_crt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
183 | p12_crt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 156 | p12_crt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
184 | p12_crt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 157 | p12_crt.o: ../cryptlib.h p12_crt.c |
185 | p12_crt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 158 | p12_decr.o: ../../e_os.h ../../include/openssl/asn1.h |
186 | p12_decr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 159 | p12_decr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
187 | p12_decr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 160 | p12_decr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
188 | p12_decr.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
189 | p12_decr.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
190 | p12_decr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 161 | p12_decr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
191 | p12_decr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 162 | p12_decr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
192 | p12_decr.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 163 | p12_decr.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
193 | p12_decr.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
194 | p12_decr.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
195 | p12_decr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
196 | p12_decr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 164 | p12_decr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
197 | p12_decr.o: ../../include/openssl/opensslconf.h | 165 | p12_decr.o: ../../include/openssl/opensslconf.h |
198 | p12_decr.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h | 166 | p12_decr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
199 | p12_decr.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 167 | p12_decr.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h |
200 | p12_decr.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 168 | p12_decr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
201 | p12_decr.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 169 | p12_decr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
202 | p12_decr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 170 | p12_decr.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
203 | p12_decr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 171 | p12_decr.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_decr.c |
204 | p12_decr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 172 | p12_init.o: ../../e_os.h ../../include/openssl/asn1.h |
205 | p12_decr.o: ../cryptlib.h | 173 | p12_init.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
206 | p12_init.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 174 | p12_init.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
207 | p12_init.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
208 | p12_init.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
209 | p12_init.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
210 | p12_init.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 175 | p12_init.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
211 | p12_init.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 176 | p12_init.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
212 | p12_init.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 177 | p12_init.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
213 | p12_init.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
214 | p12_init.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
215 | p12_init.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
216 | p12_init.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 178 | p12_init.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
217 | p12_init.o: ../../include/openssl/opensslconf.h | 179 | p12_init.o: ../../include/openssl/opensslconf.h |
218 | p12_init.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h | 180 | p12_init.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
219 | p12_init.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 181 | p12_init.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h |
220 | p12_init.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 182 | p12_init.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
221 | p12_init.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 183 | p12_init.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
222 | p12_init.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 184 | p12_init.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
223 | p12_init.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 185 | p12_init.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_init.c |
224 | p12_init.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 186 | p12_key.o: ../../e_os.h ../../include/openssl/asn1.h |
225 | p12_init.o: ../cryptlib.h | 187 | p12_key.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
226 | p12_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 188 | p12_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
227 | p12_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
228 | p12_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
229 | p12_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
230 | p12_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 189 | p12_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
231 | p12_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 190 | p12_key.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
232 | p12_key.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 191 | p12_key.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
233 | p12_key.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
234 | p12_key.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
235 | p12_key.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
236 | p12_key.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 192 | p12_key.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
237 | p12_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 193 | p12_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
238 | p12_key.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | 194 | p12_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h |
239 | p12_key.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 195 | p12_key.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
240 | p12_key.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 196 | p12_key.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
241 | p12_key.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 197 | p12_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
242 | p12_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 198 | p12_key.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
243 | p12_key.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 199 | p12_key.o: ../cryptlib.h p12_key.c |
244 | p12_key.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 200 | p12_kiss.o: ../../e_os.h ../../include/openssl/asn1.h |
245 | p12_kiss.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 201 | p12_kiss.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
246 | p12_kiss.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 202 | p12_kiss.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
247 | p12_kiss.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
248 | p12_kiss.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
249 | p12_kiss.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 203 | p12_kiss.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
250 | p12_kiss.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 204 | p12_kiss.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
251 | p12_kiss.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 205 | p12_kiss.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
252 | p12_kiss.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
253 | p12_kiss.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
254 | p12_kiss.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
255 | p12_kiss.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 206 | p12_kiss.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
256 | p12_kiss.o: ../../include/openssl/opensslconf.h | 207 | p12_kiss.o: ../../include/openssl/opensslconf.h |
257 | p12_kiss.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h | 208 | p12_kiss.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
258 | p12_kiss.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 209 | p12_kiss.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h |
259 | p12_kiss.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 210 | p12_kiss.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
260 | p12_kiss.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 211 | p12_kiss.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
261 | p12_kiss.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 212 | p12_kiss.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
262 | p12_kiss.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 213 | p12_kiss.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_kiss.c |
263 | p12_kiss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 214 | p12_mutl.o: ../../e_os.h ../../include/openssl/asn1.h |
264 | p12_kiss.o: ../cryptlib.h | 215 | p12_mutl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
265 | p12_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 216 | p12_mutl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
266 | p12_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
267 | p12_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
268 | p12_lib.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
269 | p12_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
270 | p12_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
271 | p12_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
272 | p12_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
273 | p12_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
274 | p12_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
275 | p12_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
276 | p12_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
277 | p12_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h | ||
278 | p12_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
279 | p12_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
280 | p12_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
281 | p12_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
282 | p12_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
283 | p12_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
284 | p12_lib.o: ../cryptlib.h | ||
285 | p12_mac.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
286 | p12_mac.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
287 | p12_mac.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
288 | p12_mac.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
289 | p12_mac.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
290 | p12_mac.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
291 | p12_mac.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
292 | p12_mac.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
293 | p12_mac.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
294 | p12_mac.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
295 | p12_mac.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
296 | p12_mac.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
297 | p12_mac.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h | ||
298 | p12_mac.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
299 | p12_mac.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
300 | p12_mac.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
301 | p12_mac.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
302 | p12_mac.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
303 | p12_mac.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
304 | p12_mac.o: ../cryptlib.h | ||
305 | p12_mutl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
306 | p12_mutl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
307 | p12_mutl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
308 | p12_mutl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
309 | p12_mutl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 217 | p12_mutl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
310 | p12_mutl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 218 | p12_mutl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
311 | p12_mutl.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 219 | p12_mutl.o: ../../include/openssl/evp.h ../../include/openssl/hmac.h |
312 | p12_mutl.o: ../../include/openssl/hmac.h ../../include/openssl/idea.h | 220 | p12_mutl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
313 | p12_mutl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
314 | p12_mutl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
315 | p12_mutl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
316 | p12_mutl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 221 | p12_mutl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
317 | p12_mutl.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h | 222 | p12_mutl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
318 | p12_mutl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | 223 | p12_mutl.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h |
319 | p12_mutl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 224 | p12_mutl.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h |
320 | p12_mutl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 225 | p12_mutl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
321 | p12_mutl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 226 | p12_mutl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
322 | p12_mutl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 227 | p12_mutl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
323 | p12_mutl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 228 | p12_mutl.o: ../cryptlib.h p12_mutl.c |
324 | p12_mutl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
325 | p12_npas.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 229 | p12_npas.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
326 | p12_npas.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 230 | p12_npas.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
327 | p12_npas.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 231 | p12_npas.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
328 | p12_npas.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 232 | p12_npas.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
329 | p12_npas.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 233 | p12_npas.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
330 | p12_npas.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 234 | p12_npas.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
331 | p12_npas.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
332 | p12_npas.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
333 | p12_npas.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
334 | p12_npas.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
335 | p12_npas.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 235 | p12_npas.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
336 | p12_npas.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h | 236 | p12_npas.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
337 | p12_npas.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h | 237 | p12_npas.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h |
338 | p12_npas.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 238 | p12_npas.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h |
339 | p12_npas.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 239 | p12_npas.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
340 | p12_npas.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 240 | p12_npas.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
341 | p12_npas.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 241 | p12_npas.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
342 | p12_npas.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 242 | p12_npas.o: ../../include/openssl/x509_vfy.h p12_npas.c |
343 | p12_npas.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 243 | p12_p8d.o: ../../e_os.h ../../include/openssl/asn1.h |
344 | p12_sbag.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 244 | p12_p8d.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
345 | p12_sbag.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | 245 | p12_p8d.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
346 | p12_sbag.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 246 | p12_p8d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
347 | p12_sbag.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 247 | p12_p8d.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
348 | p12_sbag.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 248 | p12_p8d.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
349 | p12_sbag.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 249 | p12_p8d.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
350 | p12_sbag.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 250 | p12_p8d.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
351 | p12_sbag.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | 251 | p12_p8d.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h |
352 | p12_sbag.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | 252 | p12_p8d.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
353 | p12_sbag.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | 253 | p12_p8d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
354 | p12_sbag.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | 254 | p12_p8d.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
355 | p12_sbag.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 255 | p12_p8d.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
356 | p12_sbag.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h | 256 | p12_p8d.o: ../cryptlib.h p12_p8d.c |
357 | p12_sbag.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 257 | p12_p8e.o: ../../e_os.h ../../include/openssl/asn1.h |
358 | p12_sbag.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 258 | p12_p8e.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
359 | p12_sbag.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 259 | p12_p8e.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
360 | p12_sbag.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 260 | p12_p8e.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
361 | p12_sbag.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 261 | p12_p8e.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
362 | p12_sbag.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 262 | p12_p8e.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
363 | p12_sbag.o: ../cryptlib.h | 263 | p12_p8e.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
364 | p12_utl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 264 | p12_p8e.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
365 | p12_utl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 265 | p12_p8e.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h |
366 | p12_utl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 266 | p12_p8e.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
367 | p12_utl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 267 | p12_p8e.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
268 | p12_p8e.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
269 | p12_p8e.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
270 | p12_p8e.o: ../cryptlib.h p12_p8e.c | ||
271 | p12_utl.o: ../../e_os.h ../../include/openssl/asn1.h | ||
272 | p12_utl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
273 | p12_utl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
368 | p12_utl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 274 | p12_utl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
369 | p12_utl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 275 | p12_utl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
370 | p12_utl.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 276 | p12_utl.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
371 | p12_utl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
372 | p12_utl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
373 | p12_utl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
374 | p12_utl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 277 | p12_utl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
375 | p12_utl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 278 | p12_utl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
376 | p12_utl.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h | 279 | p12_utl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h |
377 | p12_utl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 280 | p12_utl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
378 | p12_utl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 281 | p12_utl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
379 | p12_utl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 282 | p12_utl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
380 | p12_utl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 283 | p12_utl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
381 | p12_utl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 284 | p12_utl.o: ../cryptlib.h p12_utl.c |
382 | p12_utl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
383 | pk12err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 285 | pk12err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
384 | pk12err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 286 | pk12err.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
385 | pk12err.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 287 | pk12err.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
386 | pk12err.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 288 | pk12err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
387 | pk12err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 289 | pk12err.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
388 | pk12err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 290 | pk12err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
389 | pk12err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
390 | pk12err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
391 | pk12err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
392 | pk12err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
393 | pk12err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 291 | pk12err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
394 | pk12err.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h | 292 | pk12err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
395 | pk12err.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 293 | pk12err.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h |
396 | pk12err.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 294 | pk12err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
397 | pk12err.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 295 | pk12err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
398 | pk12err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 296 | pk12err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
399 | pk12err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 297 | pk12err.o: ../../include/openssl/x509_vfy.h pk12err.c |
400 | pk12err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
diff --git a/src/lib/libcrypto/pkcs12/p12_add.c b/src/lib/libcrypto/pkcs12/p12_add.c index b563656895..1909f28506 100644 --- a/src/lib/libcrypto/pkcs12/p12_add.c +++ b/src/lib/libcrypto/pkcs12/p12_add.c | |||
@@ -62,21 +62,21 @@ | |||
62 | 62 | ||
63 | /* Pack an object into an OCTET STRING and turn into a safebag */ | 63 | /* Pack an object into an OCTET STRING and turn into a safebag */ |
64 | 64 | ||
65 | PKCS12_SAFEBAG *PKCS12_pack_safebag (char *obj, int (*i2d)(), int nid1, | 65 | PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, int nid1, |
66 | int nid2) | 66 | int nid2) |
67 | { | 67 | { |
68 | PKCS12_BAGS *bag; | 68 | PKCS12_BAGS *bag; |
69 | PKCS12_SAFEBAG *safebag; | 69 | PKCS12_SAFEBAG *safebag; |
70 | if (!(bag = PKCS12_BAGS_new ())) { | 70 | if (!(bag = PKCS12_BAGS_new())) { |
71 | PKCS12err(PKCS12_F_PKCS12_PACK_SAFEBAG, ERR_R_MALLOC_FAILURE); | 71 | PKCS12err(PKCS12_F_PKCS12_PACK_SAFEBAG, ERR_R_MALLOC_FAILURE); |
72 | return NULL; | 72 | return NULL; |
73 | } | 73 | } |
74 | bag->type = OBJ_nid2obj(nid1); | 74 | bag->type = OBJ_nid2obj(nid1); |
75 | if (!ASN1_pack_string(obj, i2d, &bag->value.octet)) { | 75 | if (!ASN1_item_pack(obj, it, &bag->value.octet)) { |
76 | PKCS12err(PKCS12_F_PKCS12_PACK_SAFEBAG, ERR_R_MALLOC_FAILURE); | 76 | PKCS12err(PKCS12_F_PKCS12_PACK_SAFEBAG, ERR_R_MALLOC_FAILURE); |
77 | return NULL; | 77 | return NULL; |
78 | } | 78 | } |
79 | if (!(safebag = PKCS12_SAFEBAG_new ())) { | 79 | if (!(safebag = PKCS12_SAFEBAG_new())) { |
80 | PKCS12err(PKCS12_F_PKCS12_PACK_SAFEBAG, ERR_R_MALLOC_FAILURE); | 80 | PKCS12err(PKCS12_F_PKCS12_PACK_SAFEBAG, ERR_R_MALLOC_FAILURE); |
81 | return NULL; | 81 | return NULL; |
82 | } | 82 | } |
@@ -87,7 +87,7 @@ PKCS12_SAFEBAG *PKCS12_pack_safebag (char *obj, int (*i2d)(), int nid1, | |||
87 | 87 | ||
88 | /* Turn PKCS8 object into a keybag */ | 88 | /* Turn PKCS8 object into a keybag */ |
89 | 89 | ||
90 | PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG (PKCS8_PRIV_KEY_INFO *p8) | 90 | PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8) |
91 | { | 91 | { |
92 | PKCS12_SAFEBAG *bag; | 92 | PKCS12_SAFEBAG *bag; |
93 | if (!(bag = PKCS12_SAFEBAG_new())) { | 93 | if (!(bag = PKCS12_SAFEBAG_new())) { |
@@ -101,14 +101,14 @@ PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG (PKCS8_PRIV_KEY_INFO *p8) | |||
101 | 101 | ||
102 | /* Turn PKCS8 object into a shrouded keybag */ | 102 | /* Turn PKCS8 object into a shrouded keybag */ |
103 | 103 | ||
104 | PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG (int pbe_nid, const char *pass, | 104 | PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass, |
105 | int passlen, unsigned char *salt, int saltlen, int iter, | 105 | int passlen, unsigned char *salt, int saltlen, int iter, |
106 | PKCS8_PRIV_KEY_INFO *p8) | 106 | PKCS8_PRIV_KEY_INFO *p8) |
107 | { | 107 | { |
108 | PKCS12_SAFEBAG *bag; | 108 | PKCS12_SAFEBAG *bag; |
109 | 109 | ||
110 | /* Set up the safe bag */ | 110 | /* Set up the safe bag */ |
111 | if (!(bag = PKCS12_SAFEBAG_new ())) { | 111 | if (!(bag = PKCS12_SAFEBAG_new())) { |
112 | PKCS12err(PKCS12_F_PKCS12_MAKE_SHKEYBAG, ERR_R_MALLOC_FAILURE); | 112 | PKCS12err(PKCS12_F_PKCS12_MAKE_SHKEYBAG, ERR_R_MALLOC_FAILURE); |
113 | return NULL; | 113 | return NULL; |
114 | } | 114 | } |
@@ -125,7 +125,7 @@ PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG (int pbe_nid, const char *pass, | |||
125 | } | 125 | } |
126 | 126 | ||
127 | /* Turn a stack of SAFEBAGS into a PKCS#7 data Contentinfo */ | 127 | /* Turn a stack of SAFEBAGS into a PKCS#7 data Contentinfo */ |
128 | PKCS7 *PKCS12_pack_p7data (STACK_OF(PKCS12_SAFEBAG) *sk) | 128 | PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk) |
129 | { | 129 | { |
130 | PKCS7 *p7; | 130 | PKCS7 *p7; |
131 | if (!(p7 = PKCS7_new())) { | 131 | if (!(p7 = PKCS7_new())) { |
@@ -138,18 +138,23 @@ PKCS7 *PKCS12_pack_p7data (STACK_OF(PKCS12_SAFEBAG) *sk) | |||
138 | return NULL; | 138 | return NULL; |
139 | } | 139 | } |
140 | 140 | ||
141 | if (!ASN1_seq_pack_PKCS12_SAFEBAG(sk, i2d_PKCS12_SAFEBAG, | 141 | if (!ASN1_item_pack(sk, ASN1_ITEM_rptr(PKCS12_SAFEBAGS), &p7->d.data)) { |
142 | &p7->d.data->data, | ||
143 | &p7->d.data->length)) { | ||
144 | PKCS12err(PKCS12_F_PKCS12_PACK_P7DATA, PKCS12_R_CANT_PACK_STRUCTURE); | 142 | PKCS12err(PKCS12_F_PKCS12_PACK_P7DATA, PKCS12_R_CANT_PACK_STRUCTURE); |
145 | return NULL; | 143 | return NULL; |
146 | } | 144 | } |
147 | return p7; | 145 | return p7; |
148 | } | 146 | } |
149 | 147 | ||
148 | /* Unpack SAFEBAGS from PKCS#7 data ContentInfo */ | ||
149 | STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7) | ||
150 | { | ||
151 | if(!PKCS7_type_is_data(p7)) return NULL; | ||
152 | return ASN1_item_unpack(p7->d.data, ASN1_ITEM_rptr(PKCS12_SAFEBAGS)); | ||
153 | } | ||
154 | |||
150 | /* Turn a stack of SAFEBAGS into a PKCS#7 encrypted data ContentInfo */ | 155 | /* Turn a stack of SAFEBAGS into a PKCS#7 encrypted data ContentInfo */ |
151 | 156 | ||
152 | PKCS7 *PKCS12_pack_p7encdata (int pbe_nid, const char *pass, int passlen, | 157 | PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, |
153 | unsigned char *salt, int saltlen, int iter, | 158 | unsigned char *salt, int saltlen, int iter, |
154 | STACK_OF(PKCS12_SAFEBAG) *bags) | 159 | STACK_OF(PKCS12_SAFEBAG) *bags) |
155 | { | 160 | { |
@@ -164,7 +169,7 @@ PKCS7 *PKCS12_pack_p7encdata (int pbe_nid, const char *pass, int passlen, | |||
164 | PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE); | 169 | PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE); |
165 | return NULL; | 170 | return NULL; |
166 | } | 171 | } |
167 | if (!(pbe = PKCS5_pbe_set (pbe_nid, iter, salt, saltlen))) { | 172 | if (!(pbe = PKCS5_pbe_set(pbe_nid, iter, salt, saltlen))) { |
168 | PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, ERR_R_MALLOC_FAILURE); | 173 | PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, ERR_R_MALLOC_FAILURE); |
169 | return NULL; | 174 | return NULL; |
170 | } | 175 | } |
@@ -172,8 +177,8 @@ PKCS7 *PKCS12_pack_p7encdata (int pbe_nid, const char *pass, int passlen, | |||
172 | p7->d.encrypted->enc_data->algorithm = pbe; | 177 | p7->d.encrypted->enc_data->algorithm = pbe; |
173 | M_ASN1_OCTET_STRING_free(p7->d.encrypted->enc_data->enc_data); | 178 | M_ASN1_OCTET_STRING_free(p7->d.encrypted->enc_data->enc_data); |
174 | if (!(p7->d.encrypted->enc_data->enc_data = | 179 | if (!(p7->d.encrypted->enc_data->enc_data = |
175 | PKCS12_i2d_encrypt (pbe, i2d_PKCS12_SAFEBAG, pass, passlen, | 180 | PKCS12_item_i2d_encrypt(pbe, ASN1_ITEM_rptr(PKCS12_SAFEBAGS), pass, passlen, |
176 | (char *)bags, 1))) { | 181 | bags, 1))) { |
177 | PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, PKCS12_R_ENCRYPT_ERROR); | 182 | PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, PKCS12_R_ENCRYPT_ERROR); |
178 | return NULL; | 183 | return NULL; |
179 | } | 184 | } |
@@ -181,38 +186,30 @@ PKCS7 *PKCS12_pack_p7encdata (int pbe_nid, const char *pass, int passlen, | |||
181 | return p7; | 186 | return p7; |
182 | } | 187 | } |
183 | 188 | ||
184 | X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, | 189 | STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen) |
185 | const char *pass, int passlen, | ||
186 | unsigned char *salt, int saltlen, int iter, | ||
187 | PKCS8_PRIV_KEY_INFO *p8inf) | ||
188 | { | 190 | { |
189 | X509_SIG *p8; | 191 | if(!PKCS7_type_is_encrypted(p7)) return NULL; |
190 | X509_ALGOR *pbe; | 192 | return PKCS12_item_decrypt_d2i(p7->d.encrypted->enc_data->algorithm, |
191 | 193 | ASN1_ITEM_rptr(PKCS12_SAFEBAGS), | |
192 | if (!(p8 = X509_SIG_new())) { | 194 | pass, passlen, |
193 | PKCS12err(PKCS12_F_PKCS8_ENCRYPT, ERR_R_MALLOC_FAILURE); | 195 | p7->d.encrypted->enc_data->enc_data, 1); |
194 | goto err; | 196 | } |
195 | } | ||
196 | 197 | ||
197 | if(pbe_nid == -1) pbe = PKCS5_pbe2_set(cipher, iter, salt, saltlen); | 198 | PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, const char *pass, |
198 | else pbe = PKCS5_pbe_set(pbe_nid, iter, salt, saltlen); | 199 | int passlen) |
199 | if(!pbe) { | 200 | { |
200 | PKCS12err(PKCS12_F_PKCS8_ENCRYPT, ERR_R_ASN1_LIB); | 201 | return PKCS8_decrypt(bag->value.shkeybag, pass, passlen); |
201 | goto err; | 202 | } |
202 | } | ||
203 | X509_ALGOR_free(p8->algor); | ||
204 | p8->algor = pbe; | ||
205 | M_ASN1_OCTET_STRING_free(p8->digest); | ||
206 | if (!(p8->digest = | ||
207 | PKCS12_i2d_encrypt (pbe, i2d_PKCS8_PRIV_KEY_INFO, pass, passlen, | ||
208 | (char *)p8inf, 0))) { | ||
209 | PKCS12err(PKCS12_F_PKCS8_ENCRYPT, PKCS12_R_ENCRYPT_ERROR); | ||
210 | goto err; | ||
211 | } | ||
212 | 203 | ||
213 | return p8; | 204 | int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes) |
205 | { | ||
206 | if(ASN1_item_pack(safes, ASN1_ITEM_rptr(PKCS12_AUTHSAFES), | ||
207 | &p12->authsafes->d.data)) | ||
208 | return 1; | ||
209 | return 0; | ||
210 | } | ||
214 | 211 | ||
215 | err: | 212 | STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12) |
216 | X509_SIG_free(p8); | 213 | { |
217 | return NULL; | 214 | return ASN1_item_unpack(p12->authsafes->d.data, ASN1_ITEM_rptr(PKCS12_AUTHSAFES)); |
218 | } | 215 | } |
diff --git a/src/lib/libcrypto/pkcs12/p12_asn.c b/src/lib/libcrypto/pkcs12/p12_asn.c new file mode 100644 index 0000000000..c327bdba03 --- /dev/null +++ b/src/lib/libcrypto/pkcs12/p12_asn.c | |||
@@ -0,0 +1,125 @@ | |||
1 | /* p12_asn.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 1999. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 1999 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include "cryptlib.h" | ||
61 | #include <openssl/asn1t.h> | ||
62 | #include <openssl/pkcs12.h> | ||
63 | |||
64 | /* PKCS#12 ASN1 module */ | ||
65 | |||
66 | ASN1_SEQUENCE(PKCS12) = { | ||
67 | ASN1_SIMPLE(PKCS12, version, ASN1_INTEGER), | ||
68 | ASN1_SIMPLE(PKCS12, authsafes, PKCS7), | ||
69 | ASN1_OPT(PKCS12, mac, PKCS12_MAC_DATA) | ||
70 | } ASN1_SEQUENCE_END(PKCS12) | ||
71 | |||
72 | IMPLEMENT_ASN1_FUNCTIONS(PKCS12) | ||
73 | |||
74 | ASN1_SEQUENCE(PKCS12_MAC_DATA) = { | ||
75 | ASN1_SIMPLE(PKCS12_MAC_DATA, dinfo, X509_SIG), | ||
76 | ASN1_SIMPLE(PKCS12_MAC_DATA, salt, ASN1_OCTET_STRING), | ||
77 | ASN1_OPT(PKCS12_MAC_DATA, iter, ASN1_INTEGER) | ||
78 | } ASN1_SEQUENCE_END(PKCS12_MAC_DATA) | ||
79 | |||
80 | IMPLEMENT_ASN1_FUNCTIONS(PKCS12_MAC_DATA) | ||
81 | |||
82 | ASN1_ADB_TEMPLATE(bag_default) = ASN1_EXP(PKCS12_BAGS, value.other, ASN1_ANY, 0); | ||
83 | |||
84 | ASN1_ADB(PKCS12_BAGS) = { | ||
85 | ADB_ENTRY(NID_x509Certificate, ASN1_EXP(PKCS12_BAGS, value.x509cert, ASN1_OCTET_STRING, 0)), | ||
86 | ADB_ENTRY(NID_x509Certificate, ASN1_EXP(PKCS12_BAGS, value.x509crl, ASN1_OCTET_STRING, 0)), | ||
87 | ADB_ENTRY(NID_x509Certificate, ASN1_EXP(PKCS12_BAGS, value.sdsicert, ASN1_IA5STRING, 0)), | ||
88 | } ASN1_ADB_END(PKCS12_BAGS, 0, type, 0, &bag_default_tt, NULL); | ||
89 | |||
90 | ASN1_SEQUENCE(PKCS12_BAGS) = { | ||
91 | ASN1_SIMPLE(PKCS12_BAGS, type, ASN1_OBJECT), | ||
92 | ASN1_ADB_OBJECT(PKCS12_BAGS), | ||
93 | } ASN1_SEQUENCE_END(PKCS12_BAGS) | ||
94 | |||
95 | IMPLEMENT_ASN1_FUNCTIONS(PKCS12_BAGS) | ||
96 | |||
97 | ASN1_ADB_TEMPLATE(safebag_default) = ASN1_EXP(PKCS12_SAFEBAG, value.other, ASN1_ANY, 0); | ||
98 | |||
99 | ASN1_ADB(PKCS12_SAFEBAG) = { | ||
100 | ADB_ENTRY(NID_keyBag, ASN1_EXP(PKCS12_SAFEBAG, value.keybag, PKCS8_PRIV_KEY_INFO, 0)), | ||
101 | ADB_ENTRY(NID_pkcs8ShroudedKeyBag, ASN1_EXP(PKCS12_SAFEBAG, value.keybag, X509_SIG, 0)), | ||
102 | ADB_ENTRY(NID_safeContentsBag, ASN1_EXP_SET_OF(PKCS12_SAFEBAG, value.safes, PKCS12_SAFEBAG, 0)), | ||
103 | ADB_ENTRY(NID_certBag, ASN1_EXP(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0)), | ||
104 | ADB_ENTRY(NID_crlBag, ASN1_EXP(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0)), | ||
105 | ADB_ENTRY(NID_secretBag, ASN1_EXP(PKCS12_SAFEBAG, value.bag, PKCS12_BAGS, 0)) | ||
106 | } ASN1_ADB_END(PKCS12_SAFEBAG, 0, type, 0, &safebag_default_tt, NULL); | ||
107 | |||
108 | ASN1_SEQUENCE(PKCS12_SAFEBAG) = { | ||
109 | ASN1_SIMPLE(PKCS12_SAFEBAG, type, ASN1_OBJECT), | ||
110 | ASN1_ADB_OBJECT(PKCS12_SAFEBAG), | ||
111 | ASN1_SET_OF_OPT(PKCS12_SAFEBAG, attrib, X509_ATTRIBUTE) | ||
112 | } ASN1_SEQUENCE_END(PKCS12_SAFEBAG) | ||
113 | |||
114 | IMPLEMENT_ASN1_FUNCTIONS(PKCS12_SAFEBAG) | ||
115 | |||
116 | /* SEQUENCE OF SafeBag */ | ||
117 | ASN1_ITEM_TEMPLATE(PKCS12_SAFEBAGS) = | ||
118 | ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, PKCS12_SAFEBAGS, PKCS12_SAFEBAG) | ||
119 | ASN1_ITEM_TEMPLATE_END(PKCS12_SAFEBAGS) | ||
120 | |||
121 | /* Authsafes: SEQUENCE OF PKCS7 */ | ||
122 | ASN1_ITEM_TEMPLATE(PKCS12_AUTHSAFES) = | ||
123 | ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, PKCS12_AUTHSAFES, PKCS7) | ||
124 | ASN1_ITEM_TEMPLATE_END(PKCS12_AUTHSAFES) | ||
125 | |||
diff --git a/src/lib/libcrypto/pkcs12/p12_attr.c b/src/lib/libcrypto/pkcs12/p12_attr.c index a16a97d03d..026cf3826a 100644 --- a/src/lib/libcrypto/pkcs12/p12_attr.c +++ b/src/lib/libcrypto/pkcs12/p12_attr.c | |||
@@ -62,156 +62,63 @@ | |||
62 | 62 | ||
63 | /* Add a local keyid to a safebag */ | 63 | /* Add a local keyid to a safebag */ |
64 | 64 | ||
65 | int PKCS12_add_localkeyid (PKCS12_SAFEBAG *bag, unsigned char *name, | 65 | int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, |
66 | int namelen) | 66 | int namelen) |
67 | { | 67 | { |
68 | X509_ATTRIBUTE *attrib; | 68 | if (X509at_add1_attr_by_NID(&bag->attrib, NID_localKeyID, |
69 | ASN1_BMPSTRING *oct; | 69 | V_ASN1_OCTET_STRING, name, namelen)) |
70 | ASN1_TYPE *keyid; | 70 | return 1; |
71 | if (!(keyid = ASN1_TYPE_new ())) { | 71 | else |
72 | PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE); | ||
73 | return 0; | ||
74 | } | ||
75 | keyid->type = V_ASN1_OCTET_STRING; | ||
76 | if (!(oct = M_ASN1_OCTET_STRING_new())) { | ||
77 | PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE); | ||
78 | return 0; | ||
79 | } | ||
80 | if (!M_ASN1_OCTET_STRING_set(oct, name, namelen)) { | ||
81 | PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE); | ||
82 | return 0; | ||
83 | } | ||
84 | keyid->value.octet_string = oct; | ||
85 | if (!(attrib = X509_ATTRIBUTE_new ())) { | ||
86 | PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE); | ||
87 | return 0; | ||
88 | } | ||
89 | attrib->object = OBJ_nid2obj(NID_localKeyID); | ||
90 | if (!(attrib->value.set = sk_ASN1_TYPE_new_null())) { | ||
91 | PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE); | ||
92 | return 0; | ||
93 | } | ||
94 | sk_ASN1_TYPE_push (attrib->value.set,keyid); | ||
95 | attrib->set = 1; | ||
96 | if (!bag->attrib && !(bag->attrib = sk_X509_ATTRIBUTE_new_null ())) { | ||
97 | PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE); | ||
98 | return 0; | 72 | return 0; |
99 | } | ||
100 | sk_X509_ATTRIBUTE_push (bag->attrib, attrib); | ||
101 | return 1; | ||
102 | } | 73 | } |
103 | 74 | ||
104 | /* Add key usage to PKCS#8 structure */ | 75 | /* Add key usage to PKCS#8 structure */ |
105 | 76 | ||
106 | int PKCS8_add_keyusage (PKCS8_PRIV_KEY_INFO *p8, int usage) | 77 | int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage) |
107 | { | 78 | { |
108 | X509_ATTRIBUTE *attrib; | ||
109 | ASN1_BIT_STRING *bstr; | ||
110 | ASN1_TYPE *keyid; | ||
111 | unsigned char us_val; | 79 | unsigned char us_val; |
112 | us_val = (unsigned char) usage; | 80 | us_val = (unsigned char) usage; |
113 | if (!(keyid = ASN1_TYPE_new ())) { | 81 | if (X509at_add1_attr_by_NID(&p8->attributes, NID_key_usage, |
114 | PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE); | 82 | V_ASN1_BIT_STRING, &us_val, 1)) |
115 | return 0; | 83 | return 1; |
116 | } | 84 | else |
117 | keyid->type = V_ASN1_BIT_STRING; | ||
118 | if (!(bstr = M_ASN1_BIT_STRING_new())) { | ||
119 | PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE); | ||
120 | return 0; | ||
121 | } | ||
122 | if (!M_ASN1_BIT_STRING_set(bstr, &us_val, 1)) { | ||
123 | PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE); | ||
124 | return 0; | ||
125 | } | ||
126 | keyid->value.bit_string = bstr; | ||
127 | if (!(attrib = X509_ATTRIBUTE_new ())) { | ||
128 | PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE); | ||
129 | return 0; | ||
130 | } | ||
131 | attrib->object = OBJ_nid2obj(NID_key_usage); | ||
132 | if (!(attrib->value.set = sk_ASN1_TYPE_new_null())) { | ||
133 | PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE); | ||
134 | return 0; | 85 | return 0; |
135 | } | ||
136 | sk_ASN1_TYPE_push (attrib->value.set,keyid); | ||
137 | attrib->set = 1; | ||
138 | if (!p8->attributes | ||
139 | && !(p8->attributes = sk_X509_ATTRIBUTE_new_null ())) { | ||
140 | PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE); | ||
141 | return 0; | ||
142 | } | ||
143 | sk_X509_ATTRIBUTE_push (p8->attributes, attrib); | ||
144 | return 1; | ||
145 | } | 86 | } |
146 | 87 | ||
147 | /* Add a friendlyname to a safebag */ | 88 | /* Add a friendlyname to a safebag */ |
148 | 89 | ||
149 | int PKCS12_add_friendlyname_asc (PKCS12_SAFEBAG *bag, const char *name, | 90 | int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, |
150 | int namelen) | 91 | int namelen) |
151 | { | 92 | { |
152 | unsigned char *uniname; | 93 | if (X509at_add1_attr_by_NID(&bag->attrib, NID_friendlyName, |
153 | int ret, unilen; | 94 | MBSTRING_ASC, (unsigned char *)name, namelen)) |
154 | if (!asc2uni(name, namelen, &uniname, &unilen)) { | 95 | return 1; |
155 | PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC, | 96 | else |
156 | ERR_R_MALLOC_FAILURE); | ||
157 | return 0; | 97 | return 0; |
158 | } | ||
159 | ret = PKCS12_add_friendlyname_uni (bag, uniname, unilen); | ||
160 | OPENSSL_free(uniname); | ||
161 | return ret; | ||
162 | } | 98 | } |
163 | |||
164 | 99 | ||
165 | int PKCS12_add_friendlyname_uni (PKCS12_SAFEBAG *bag, | 100 | |
101 | int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, | ||
166 | const unsigned char *name, int namelen) | 102 | const unsigned char *name, int namelen) |
167 | { | 103 | { |
168 | X509_ATTRIBUTE *attrib; | 104 | if (X509at_add1_attr_by_NID(&bag->attrib, NID_friendlyName, |
169 | ASN1_BMPSTRING *bmp; | 105 | MBSTRING_BMP, name, namelen)) |
170 | ASN1_TYPE *fname; | 106 | return 1; |
171 | /* Zap ending double null if included */ | 107 | else |
172 | if(!name[namelen - 1] && !name[namelen - 2]) namelen -= 2; | ||
173 | if (!(fname = ASN1_TYPE_new ())) { | ||
174 | PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI, | ||
175 | ERR_R_MALLOC_FAILURE); | ||
176 | return 0; | ||
177 | } | ||
178 | fname->type = V_ASN1_BMPSTRING; | ||
179 | if (!(bmp = M_ASN1_BMPSTRING_new())) { | ||
180 | PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI, | ||
181 | ERR_R_MALLOC_FAILURE); | ||
182 | return 0; | ||
183 | } | ||
184 | if (!(bmp->data = OPENSSL_malloc (namelen))) { | ||
185 | PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI, | ||
186 | ERR_R_MALLOC_FAILURE); | ||
187 | return 0; | 108 | return 0; |
188 | } | 109 | } |
189 | memcpy (bmp->data, name, namelen); | 110 | |
190 | bmp->length = namelen; | 111 | int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, |
191 | fname->value.bmpstring = bmp; | 112 | int namelen) |
192 | if (!(attrib = X509_ATTRIBUTE_new ())) { | 113 | { |
193 | PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI, | 114 | if (X509at_add1_attr_by_NID(&bag->attrib, NID_ms_csp_name, |
194 | ERR_R_MALLOC_FAILURE); | 115 | MBSTRING_ASC, (unsigned char *)name, namelen)) |
195 | return 0; | 116 | return 1; |
196 | } | 117 | else |
197 | attrib->object = OBJ_nid2obj(NID_friendlyName); | ||
198 | if (!(attrib->value.set = sk_ASN1_TYPE_new_null())) { | ||
199 | PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME, | ||
200 | ERR_R_MALLOC_FAILURE); | ||
201 | return 0; | ||
202 | } | ||
203 | sk_ASN1_TYPE_push (attrib->value.set,fname); | ||
204 | attrib->set = 1; | ||
205 | if (!bag->attrib && !(bag->attrib = sk_X509_ATTRIBUTE_new_null ())) { | ||
206 | PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI, | ||
207 | ERR_R_MALLOC_FAILURE); | ||
208 | return 0; | 118 | return 0; |
209 | } | ||
210 | sk_X509_ATTRIBUTE_push (bag->attrib, attrib); | ||
211 | return PKCS12_OK; | ||
212 | } | 119 | } |
213 | 120 | ||
214 | ASN1_TYPE *PKCS12_get_attr_gen (STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid) | 121 | ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid) |
215 | { | 122 | { |
216 | X509_ATTRIBUTE *attrib; | 123 | X509_ATTRIBUTE *attrib; |
217 | int i; | 124 | int i; |
diff --git a/src/lib/libcrypto/pkcs12/p12_crpt.c b/src/lib/libcrypto/pkcs12/p12_crpt.c index 7b96584f07..97be6a5fb5 100644 --- a/src/lib/libcrypto/pkcs12/p12_crpt.c +++ b/src/lib/libcrypto/pkcs12/p12_crpt.c | |||
@@ -64,19 +64,19 @@ | |||
64 | 64 | ||
65 | void PKCS12_PBE_add(void) | 65 | void PKCS12_PBE_add(void) |
66 | { | 66 | { |
67 | #ifndef NO_RC4 | 67 | #ifndef OPENSSL_NO_RC4 |
68 | EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC4, EVP_rc4(), EVP_sha1(), | 68 | EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC4, EVP_rc4(), EVP_sha1(), |
69 | PKCS12_PBE_keyivgen); | 69 | PKCS12_PBE_keyivgen); |
70 | EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC4, EVP_rc4_40(), EVP_sha1(), | 70 | EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC4, EVP_rc4_40(), EVP_sha1(), |
71 | PKCS12_PBE_keyivgen); | 71 | PKCS12_PBE_keyivgen); |
72 | #endif | 72 | #endif |
73 | #ifndef NO_DES | 73 | #ifndef OPENSSL_NO_DES |
74 | EVP_PBE_alg_add(NID_pbe_WithSHA1And3_Key_TripleDES_CBC, | 74 | EVP_PBE_alg_add(NID_pbe_WithSHA1And3_Key_TripleDES_CBC, |
75 | EVP_des_ede3_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen); | 75 | EVP_des_ede3_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen); |
76 | EVP_PBE_alg_add(NID_pbe_WithSHA1And2_Key_TripleDES_CBC, | 76 | EVP_PBE_alg_add(NID_pbe_WithSHA1And2_Key_TripleDES_CBC, |
77 | EVP_des_ede_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen); | 77 | EVP_des_ede_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen); |
78 | #endif | 78 | #endif |
79 | #ifndef NO_RC2 | 79 | #ifndef OPENSSL_NO_RC2 |
80 | EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC2_CBC, EVP_rc2_cbc(), | 80 | EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC2_CBC, EVP_rc2_cbc(), |
81 | EVP_sha1(), PKCS12_PBE_keyivgen); | 81 | EVP_sha1(), PKCS12_PBE_keyivgen); |
82 | EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC2_CBC, EVP_rc2_40_cbc(), | 82 | EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC2_CBC, EVP_rc2_40_cbc(), |
@@ -85,7 +85,7 @@ EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC2_CBC, EVP_rc2_40_cbc(), | |||
85 | } | 85 | } |
86 | 86 | ||
87 | int PKCS12_PBE_keyivgen (EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | 87 | int PKCS12_PBE_keyivgen (EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
88 | ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md, int en_de) | 88 | ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, int en_de) |
89 | { | 89 | { |
90 | PBEPARAM *pbe; | 90 | PBEPARAM *pbe; |
91 | int saltlen, iter; | 91 | int saltlen, iter; |
@@ -117,7 +117,7 @@ int PKCS12_PBE_keyivgen (EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
117 | return 0; | 117 | return 0; |
118 | } | 118 | } |
119 | PBEPARAM_free(pbe); | 119 | PBEPARAM_free(pbe); |
120 | EVP_CipherInit(ctx, cipher, key, iv, en_de); | 120 | EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, en_de); |
121 | memset(key, 0, EVP_MAX_KEY_LENGTH); | 121 | memset(key, 0, EVP_MAX_KEY_LENGTH); |
122 | memset(iv, 0, EVP_MAX_IV_LENGTH); | 122 | memset(iv, 0, EVP_MAX_IV_LENGTH); |
123 | return 1; | 123 | return 1; |
diff --git a/src/lib/libcrypto/pkcs12/p12_crt.c b/src/lib/libcrypto/pkcs12/p12_crt.c index a8f7b48882..4c36c643ce 100644 --- a/src/lib/libcrypto/pkcs12/p12_crt.c +++ b/src/lib/libcrypto/pkcs12/p12_crt.c | |||
@@ -94,7 +94,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, | |||
94 | } | 94 | } |
95 | 95 | ||
96 | /* Add user certificate */ | 96 | /* Add user certificate */ |
97 | if(!(bag = M_PKCS12_x5092certbag(cert))) return NULL; | 97 | if(!(bag = PKCS12_x5092certbag(cert))) return NULL; |
98 | if(name && !PKCS12_add_friendlyname(bag, name, -1)) return NULL; | 98 | if(name && !PKCS12_add_friendlyname(bag, name, -1)) return NULL; |
99 | X509_digest(cert, EVP_sha1(), keyid, &keyidlen); | 99 | X509_digest(cert, EVP_sha1(), keyid, &keyidlen); |
100 | if(!PKCS12_add_localkeyid(bag, keyid, keyidlen)) return NULL; | 100 | if(!PKCS12_add_localkeyid(bag, keyid, keyidlen)) return NULL; |
@@ -108,7 +108,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, | |||
108 | if(ca) { | 108 | if(ca) { |
109 | for(i = 0; i < sk_X509_num(ca); i++) { | 109 | for(i = 0; i < sk_X509_num(ca); i++) { |
110 | tcert = sk_X509_value(ca, i); | 110 | tcert = sk_X509_value(ca, i); |
111 | if(!(bag = M_PKCS12_x5092certbag(tcert))) return NULL; | 111 | if(!(bag = PKCS12_x5092certbag(tcert))) return NULL; |
112 | if(!sk_PKCS12_SAFEBAG_push(bags, bag)) { | 112 | if(!sk_PKCS12_SAFEBAG_push(bags, bag)) { |
113 | PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE); | 113 | PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE); |
114 | return NULL; | 114 | return NULL; |
@@ -152,7 +152,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, | |||
152 | 152 | ||
153 | if(!(p12 = PKCS12_init (NID_pkcs7_data))) return NULL; | 153 | if(!(p12 = PKCS12_init (NID_pkcs7_data))) return NULL; |
154 | 154 | ||
155 | if(!M_PKCS12_pack_authsafes (p12, safes)) return NULL; | 155 | if(!PKCS12_pack_authsafes (p12, safes)) return NULL; |
156 | 156 | ||
157 | sk_PKCS7_pop_free(safes, PKCS7_free); | 157 | sk_PKCS7_pop_free(safes, PKCS7_free); |
158 | 158 | ||
diff --git a/src/lib/libcrypto/pkcs12/p12_decr.c b/src/lib/libcrypto/pkcs12/p12_decr.c index 8cd7e2f414..394af368f4 100644 --- a/src/lib/libcrypto/pkcs12/p12_decr.c +++ b/src/lib/libcrypto/pkcs12/p12_decr.c | |||
@@ -68,7 +68,7 @@ | |||
68 | * OPENSSL_malloc'ed buffer | 68 | * OPENSSL_malloc'ed buffer |
69 | */ | 69 | */ |
70 | 70 | ||
71 | unsigned char * PKCS12_pbe_crypt (X509_ALGOR *algor, const char *pass, | 71 | unsigned char * PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, |
72 | int passlen, unsigned char *in, int inlen, unsigned char **data, | 72 | int passlen, unsigned char *in, int inlen, unsigned char **data, |
73 | int *datalen, int en_de) | 73 | int *datalen, int en_de) |
74 | { | 74 | { |
@@ -76,47 +76,48 @@ unsigned char * PKCS12_pbe_crypt (X509_ALGOR *algor, const char *pass, | |||
76 | int outlen, i; | 76 | int outlen, i; |
77 | EVP_CIPHER_CTX ctx; | 77 | EVP_CIPHER_CTX ctx; |
78 | 78 | ||
79 | EVP_CIPHER_CTX_init(&ctx); | ||
79 | /* Decrypt data */ | 80 | /* Decrypt data */ |
80 | if (!EVP_PBE_CipherInit (algor->algorithm, pass, passlen, | 81 | if (!EVP_PBE_CipherInit(algor->algorithm, pass, passlen, |
81 | algor->parameter, &ctx, en_de)) { | 82 | algor->parameter, &ctx, en_de)) { |
82 | PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR); | 83 | PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR); |
83 | return NULL; | 84 | return NULL; |
84 | } | 85 | } |
85 | 86 | ||
86 | if(!(out = OPENSSL_malloc (inlen + EVP_CIPHER_CTX_block_size(&ctx)))) { | 87 | if(!(out = OPENSSL_malloc(inlen + EVP_CIPHER_CTX_block_size(&ctx)))) { |
87 | PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,ERR_R_MALLOC_FAILURE); | 88 | PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,ERR_R_MALLOC_FAILURE); |
88 | return NULL; | 89 | goto err; |
89 | } | 90 | } |
90 | 91 | ||
91 | EVP_CipherUpdate (&ctx, out, &i, in, inlen); | 92 | EVP_CipherUpdate(&ctx, out, &i, in, inlen); |
92 | outlen = i; | 93 | outlen = i; |
93 | if(!EVP_CipherFinal (&ctx, out + i, &i)) { | 94 | if(!EVP_CipherFinal_ex(&ctx, out + i, &i)) { |
94 | OPENSSL_free (out); | 95 | OPENSSL_free(out); |
96 | out = NULL; | ||
95 | PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,PKCS12_R_PKCS12_CIPHERFINAL_ERROR); | 97 | PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,PKCS12_R_PKCS12_CIPHERFINAL_ERROR); |
96 | return NULL; | 98 | goto err; |
97 | } | 99 | } |
98 | outlen += i; | 100 | outlen += i; |
99 | if (datalen) *datalen = outlen; | 101 | if (datalen) *datalen = outlen; |
100 | if (data) *data = out; | 102 | if (data) *data = out; |
103 | err: | ||
104 | EVP_CIPHER_CTX_cleanup(&ctx); | ||
101 | return out; | 105 | return out; |
102 | 106 | ||
103 | } | 107 | } |
104 | 108 | ||
105 | /* Decrypt an OCTET STRING and decode ASN1 structure | 109 | /* Decrypt an OCTET STRING and decode ASN1 structure |
106 | * if seq & 1 'obj' is a stack of structures to be encoded | 110 | * if zbuf set zero buffer after use. |
107 | * if seq & 2 zero buffer after use | ||
108 | * as a sequence. | ||
109 | */ | 111 | */ |
110 | 112 | ||
111 | char * PKCS12_decrypt_d2i (X509_ALGOR *algor, char * (*d2i)(), | 113 | void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it, |
112 | void (*free_func)(void *), const char *pass, int passlen, | 114 | const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf) |
113 | ASN1_OCTET_STRING *oct, int seq) | ||
114 | { | 115 | { |
115 | unsigned char *out, *p; | 116 | unsigned char *out, *p; |
116 | char *ret; | 117 | void *ret; |
117 | int outlen; | 118 | int outlen; |
118 | 119 | ||
119 | if (!PKCS12_pbe_crypt (algor, pass, passlen, oct->data, oct->length, | 120 | if (!PKCS12_pbe_crypt(algor, pass, passlen, oct->data, oct->length, |
120 | &out, &outlen, 0)) { | 121 | &out, &outlen, 0)) { |
121 | PKCS12err(PKCS12_F_PKCS12_DECRYPT_D2I,PKCS12_R_PKCS12_PBE_CRYPT_ERROR); | 122 | PKCS12err(PKCS12_F_PKCS12_DECRYPT_D2I,PKCS12_R_PKCS12_PBE_CRYPT_ERROR); |
122 | return NULL; | 123 | return NULL; |
@@ -134,53 +135,41 @@ char * PKCS12_decrypt_d2i (X509_ALGOR *algor, char * (*d2i)(), | |||
134 | fclose(op); | 135 | fclose(op); |
135 | } | 136 | } |
136 | #endif | 137 | #endif |
137 | if (seq & 1) ret = (char *) d2i_ASN1_SET(NULL, &p, outlen, d2i, | 138 | ret = ASN1_item_d2i(NULL, &p, outlen, it); |
138 | free_func, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL); | 139 | if (zbuf) memset(out, 0, outlen); |
139 | else ret = d2i(NULL, &p, outlen); | ||
140 | if (seq & 2) memset(out, 0, outlen); | ||
141 | if(!ret) PKCS12err(PKCS12_F_PKCS12_DECRYPT_D2I,PKCS12_R_DECODE_ERROR); | 140 | if(!ret) PKCS12err(PKCS12_F_PKCS12_DECRYPT_D2I,PKCS12_R_DECODE_ERROR); |
142 | OPENSSL_free (out); | 141 | OPENSSL_free(out); |
143 | return ret; | 142 | return ret; |
144 | } | 143 | } |
145 | 144 | ||
146 | /* Encode ASN1 structure and encrypt, return OCTET STRING | 145 | /* Encode ASN1 structure and encrypt, return OCTET STRING |
147 | * if 'seq' is non-zero 'obj' is a stack of structures to be encoded | 146 | * if zbuf set zero encoding. |
148 | * as a sequence | ||
149 | */ | 147 | */ |
150 | 148 | ||
151 | ASN1_OCTET_STRING *PKCS12_i2d_encrypt (X509_ALGOR *algor, int (*i2d)(), | 149 | ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *it, |
152 | const char *pass, int passlen, | 150 | const char *pass, int passlen, |
153 | char *obj, int seq) | 151 | void *obj, int zbuf) |
154 | { | 152 | { |
155 | ASN1_OCTET_STRING *oct; | 153 | ASN1_OCTET_STRING *oct; |
156 | unsigned char *in, *p; | 154 | unsigned char *in = NULL; |
157 | int inlen; | 155 | int inlen; |
158 | if (!(oct = M_ASN1_OCTET_STRING_new ())) { | 156 | if (!(oct = M_ASN1_OCTET_STRING_new ())) { |
159 | PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,ERR_R_MALLOC_FAILURE); | 157 | PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,ERR_R_MALLOC_FAILURE); |
160 | return NULL; | 158 | return NULL; |
161 | } | 159 | } |
162 | if (seq) inlen = i2d_ASN1_SET((STACK *)obj, NULL, i2d, V_ASN1_SEQUENCE, | 160 | inlen = ASN1_item_i2d(obj, &in, it); |
163 | V_ASN1_UNIVERSAL, IS_SEQUENCE); | 161 | if (!in) { |
164 | else inlen = i2d (obj, NULL); | ||
165 | if (!inlen) { | ||
166 | PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,PKCS12_R_ENCODE_ERROR); | 162 | PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,PKCS12_R_ENCODE_ERROR); |
167 | return NULL; | 163 | return NULL; |
168 | } | 164 | } |
169 | if (!(in = OPENSSL_malloc (inlen))) { | 165 | if (!PKCS12_pbe_crypt(algor, pass, passlen, in, inlen, &oct->data, |
170 | PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,ERR_R_MALLOC_FAILURE); | ||
171 | return NULL; | ||
172 | } | ||
173 | p = in; | ||
174 | if (seq) i2d_ASN1_SET((STACK *)obj, &p, i2d, V_ASN1_SEQUENCE, | ||
175 | V_ASN1_UNIVERSAL, IS_SEQUENCE); | ||
176 | else i2d (obj, &p); | ||
177 | if (!PKCS12_pbe_crypt (algor, pass, passlen, in, inlen, &oct->data, | ||
178 | &oct->length, 1)) { | 166 | &oct->length, 1)) { |
179 | PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,PKCS12_R_ENCRYPT_ERROR); | 167 | PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,PKCS12_R_ENCRYPT_ERROR); |
180 | OPENSSL_free(in); | 168 | OPENSSL_free(in); |
181 | return NULL; | 169 | return NULL; |
182 | } | 170 | } |
183 | OPENSSL_free (in); | 171 | if (zbuf) memset(in, 0, inlen); |
172 | OPENSSL_free(in); | ||
184 | return oct; | 173 | return oct; |
185 | } | 174 | } |
186 | 175 | ||
diff --git a/src/lib/libcrypto/pkcs12/p12_init.c b/src/lib/libcrypto/pkcs12/p12_init.c index d5d4884c82..eb837a78cf 100644 --- a/src/lib/libcrypto/pkcs12/p12_init.c +++ b/src/lib/libcrypto/pkcs12/p12_init.c | |||
@@ -69,15 +69,7 @@ PKCS12 *PKCS12_init (int mode) | |||
69 | PKCS12err(PKCS12_F_PKCS12_INIT,ERR_R_MALLOC_FAILURE); | 69 | PKCS12err(PKCS12_F_PKCS12_INIT,ERR_R_MALLOC_FAILURE); |
70 | return NULL; | 70 | return NULL; |
71 | } | 71 | } |
72 | if (!(pkcs12->version = M_ASN1_INTEGER_new ())) { | ||
73 | PKCS12err(PKCS12_F_PKCS12_INIT,ERR_R_MALLOC_FAILURE); | ||
74 | return NULL; | ||
75 | } | ||
76 | ASN1_INTEGER_set(pkcs12->version, 3); | 72 | ASN1_INTEGER_set(pkcs12->version, 3); |
77 | if (!(pkcs12->authsafes = PKCS7_new())) { | ||
78 | PKCS12err(PKCS12_F_PKCS12_INIT,ERR_R_MALLOC_FAILURE); | ||
79 | return NULL; | ||
80 | } | ||
81 | pkcs12->authsafes->type = OBJ_nid2obj(mode); | 73 | pkcs12->authsafes->type = OBJ_nid2obj(mode); |
82 | switch (mode) { | 74 | switch (mode) { |
83 | case NID_pkcs7_data: | 75 | case NID_pkcs7_data: |
diff --git a/src/lib/libcrypto/pkcs12/p12_key.c b/src/lib/libcrypto/pkcs12/p12_key.c index a4fd5b98ec..0d39ebde8c 100644 --- a/src/lib/libcrypto/pkcs12/p12_key.c +++ b/src/lib/libcrypto/pkcs12/p12_key.c | |||
@@ -118,6 +118,7 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, | |||
118 | } | 118 | } |
119 | #endif | 119 | #endif |
120 | 120 | ||
121 | EVP_MD_CTX_init(&ctx); | ||
121 | #ifdef DEBUG_KEYGEN | 122 | #ifdef DEBUG_KEYGEN |
122 | fprintf(stderr, "KEYGEN DEBUG\n"); | 123 | fprintf(stderr, "KEYGEN DEBUG\n"); |
123 | fprintf(stderr, "ID %d, ITER %d\n", id, iter); | 124 | fprintf(stderr, "ID %d, ITER %d\n", id, iter); |
@@ -147,14 +148,14 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, | |||
147 | for (i = 0; i < Slen; i++) *p++ = salt[i % saltlen]; | 148 | for (i = 0; i < Slen; i++) *p++ = salt[i % saltlen]; |
148 | for (i = 0; i < Plen; i++) *p++ = pass[i % passlen]; | 149 | for (i = 0; i < Plen; i++) *p++ = pass[i % passlen]; |
149 | for (;;) { | 150 | for (;;) { |
150 | EVP_DigestInit (&ctx, md_type); | 151 | EVP_DigestInit_ex(&ctx, md_type, NULL); |
151 | EVP_DigestUpdate (&ctx, D, v); | 152 | EVP_DigestUpdate(&ctx, D, v); |
152 | EVP_DigestUpdate (&ctx, I, Ilen); | 153 | EVP_DigestUpdate(&ctx, I, Ilen); |
153 | EVP_DigestFinal (&ctx, Ai, NULL); | 154 | EVP_DigestFinal_ex(&ctx, Ai, NULL); |
154 | for (j = 1; j < iter; j++) { | 155 | for (j = 1; j < iter; j++) { |
155 | EVP_DigestInit (&ctx, md_type); | 156 | EVP_DigestInit_ex(&ctx, md_type, NULL); |
156 | EVP_DigestUpdate (&ctx, Ai, u); | 157 | EVP_DigestUpdate(&ctx, Ai, u); |
157 | EVP_DigestFinal (&ctx, Ai, NULL); | 158 | EVP_DigestFinal_ex(&ctx, Ai, NULL); |
158 | } | 159 | } |
159 | memcpy (out, Ai, min (n, u)); | 160 | memcpy (out, Ai, min (n, u)); |
160 | if (u >= n) { | 161 | if (u >= n) { |
@@ -164,6 +165,7 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, | |||
164 | OPENSSL_free (I); | 165 | OPENSSL_free (I); |
165 | BN_free (Ij); | 166 | BN_free (Ij); |
166 | BN_free (Bpl1); | 167 | BN_free (Bpl1); |
168 | EVP_MD_CTX_cleanup(&ctx); | ||
167 | #ifdef DEBUG_KEYGEN | 169 | #ifdef DEBUG_KEYGEN |
168 | fprintf(stderr, "Output KEY (length %d)\n", tmpn); | 170 | fprintf(stderr, "Output KEY (length %d)\n", tmpn); |
169 | h__dump(tmpout, tmpn); | 171 | h__dump(tmpout, tmpn); |
diff --git a/src/lib/libcrypto/pkcs12/p12_kiss.c b/src/lib/libcrypto/pkcs12/p12_kiss.c index 5d67f19b45..885087ad00 100644 --- a/src/lib/libcrypto/pkcs12/p12_kiss.c +++ b/src/lib/libcrypto/pkcs12/p12_kiss.c | |||
@@ -151,14 +151,14 @@ static int parse_pk12 (PKCS12 *p12, const char *pass, int passlen, | |||
151 | ASN1_OCTET_STRING *keyid = NULL; | 151 | ASN1_OCTET_STRING *keyid = NULL; |
152 | 152 | ||
153 | char keymatch = 0; | 153 | char keymatch = 0; |
154 | if (!( asafes = M_PKCS12_unpack_authsafes (p12))) return 0; | 154 | if (!(asafes = PKCS12_unpack_authsafes (p12))) return 0; |
155 | for (i = 0; i < sk_PKCS7_num (asafes); i++) { | 155 | for (i = 0; i < sk_PKCS7_num (asafes); i++) { |
156 | p7 = sk_PKCS7_value (asafes, i); | 156 | p7 = sk_PKCS7_value (asafes, i); |
157 | bagnid = OBJ_obj2nid (p7->type); | 157 | bagnid = OBJ_obj2nid (p7->type); |
158 | if (bagnid == NID_pkcs7_data) { | 158 | if (bagnid == NID_pkcs7_data) { |
159 | bags = M_PKCS12_unpack_p7data(p7); | 159 | bags = PKCS12_unpack_p7data(p7); |
160 | } else if (bagnid == NID_pkcs7_encrypted) { | 160 | } else if (bagnid == NID_pkcs7_encrypted) { |
161 | bags = M_PKCS12_unpack_p7encdata(p7, pass, passlen); | 161 | bags = PKCS12_unpack_p7encdata(p7, pass, passlen); |
162 | } else continue; | 162 | } else continue; |
163 | if (!bags) { | 163 | if (!bags) { |
164 | sk_PKCS7_pop_free(asafes, PKCS7_free); | 164 | sk_PKCS7_pop_free(asafes, PKCS7_free); |
@@ -237,7 +237,7 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, | |||
237 | 237 | ||
238 | case NID_pkcs8ShroudedKeyBag: | 238 | case NID_pkcs8ShroudedKeyBag: |
239 | if (!lkey || !pkey) return 1; | 239 | if (!lkey || !pkey) return 1; |
240 | if (!(p8 = M_PKCS12_decrypt_skey(bag, pass, passlen))) | 240 | if (!(p8 = PKCS12_decrypt_skey(bag, pass, passlen))) |
241 | return 0; | 241 | return 0; |
242 | *pkey = EVP_PKCS82PKEY(p8); | 242 | *pkey = EVP_PKCS82PKEY(p8); |
243 | PKCS8_PRIV_KEY_INFO_free(p8); | 243 | PKCS8_PRIV_KEY_INFO_free(p8); |
@@ -248,7 +248,7 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, | |||
248 | case NID_certBag: | 248 | case NID_certBag: |
249 | if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate ) | 249 | if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate ) |
250 | return 1; | 250 | return 1; |
251 | if (!(x509 = M_PKCS12_certbag2x509(bag))) return 0; | 251 | if (!(x509 = PKCS12_certbag2x509(bag))) return 0; |
252 | if(ckid) X509_keyid_set1(x509, ckid->data, ckid->length); | 252 | if(ckid) X509_keyid_set1(x509, ckid->data, ckid->length); |
253 | if(fname) { | 253 | if(fname) { |
254 | int len; | 254 | int len; |
diff --git a/src/lib/libcrypto/pkcs12/p12_mutl.c b/src/lib/libcrypto/pkcs12/p12_mutl.c index 13d866da51..0fb67f74b8 100644 --- a/src/lib/libcrypto/pkcs12/p12_mutl.c +++ b/src/lib/libcrypto/pkcs12/p12_mutl.c | |||
@@ -56,7 +56,7 @@ | |||
56 | * | 56 | * |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_HMAC | 59 | #ifndef OPENSSL_NO_HMAC |
60 | #include <stdio.h> | 60 | #include <stdio.h> |
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include <openssl/hmac.h> | 62 | #include <openssl/hmac.h> |
@@ -71,6 +71,7 @@ int PKCS12_gen_mac (PKCS12 *p12, const char *pass, int passlen, | |||
71 | HMAC_CTX hmac; | 71 | HMAC_CTX hmac; |
72 | unsigned char key[PKCS12_MAC_KEY_LENGTH], *salt; | 72 | unsigned char key[PKCS12_MAC_KEY_LENGTH], *salt; |
73 | int saltlen, iter; | 73 | int saltlen, iter; |
74 | |||
74 | salt = p12->mac->salt->data; | 75 | salt = p12->mac->salt->data; |
75 | saltlen = p12->mac->salt->length; | 76 | saltlen = p12->mac->salt->length; |
76 | if (!p12->mac->iter) iter = 1; | 77 | if (!p12->mac->iter) iter = 1; |
@@ -85,10 +86,12 @@ int PKCS12_gen_mac (PKCS12 *p12, const char *pass, int passlen, | |||
85 | PKCS12err(PKCS12_F_PKCS12_GEN_MAC,PKCS12_R_KEY_GEN_ERROR); | 86 | PKCS12err(PKCS12_F_PKCS12_GEN_MAC,PKCS12_R_KEY_GEN_ERROR); |
86 | return 0; | 87 | return 0; |
87 | } | 88 | } |
88 | HMAC_Init (&hmac, key, PKCS12_MAC_KEY_LENGTH, md_type); | 89 | HMAC_CTX_init(&hmac); |
89 | HMAC_Update (&hmac, p12->authsafes->d.data->data, | 90 | HMAC_Init_ex(&hmac, key, PKCS12_MAC_KEY_LENGTH, md_type, NULL); |
91 | HMAC_Update(&hmac, p12->authsafes->d.data->data, | ||
90 | p12->authsafes->d.data->length); | 92 | p12->authsafes->d.data->length); |
91 | HMAC_Final (&hmac, mac, maclen); | 93 | HMAC_Final(&hmac, mac, maclen); |
94 | HMAC_CTX_cleanup(&hmac); | ||
92 | return 1; | 95 | return 1; |
93 | } | 96 | } |
94 | 97 | ||
@@ -113,7 +116,7 @@ int PKCS12_verify_mac (PKCS12 *p12, const char *pass, int passlen) | |||
113 | /* Set a mac */ | 116 | /* Set a mac */ |
114 | 117 | ||
115 | int PKCS12_set_mac (PKCS12 *p12, const char *pass, int passlen, | 118 | int PKCS12_set_mac (PKCS12 *p12, const char *pass, int passlen, |
116 | unsigned char *salt, int saltlen, int iter, EVP_MD *md_type) | 119 | unsigned char *salt, int saltlen, int iter, const EVP_MD *md_type) |
117 | { | 120 | { |
118 | unsigned char mac[EVP_MAX_MD_SIZE]; | 121 | unsigned char mac[EVP_MAX_MD_SIZE]; |
119 | unsigned int maclen; | 122 | unsigned int maclen; |
@@ -137,7 +140,7 @@ int PKCS12_set_mac (PKCS12 *p12, const char *pass, int passlen, | |||
137 | 140 | ||
138 | /* Set up a mac structure */ | 141 | /* Set up a mac structure */ |
139 | int PKCS12_setup_mac (PKCS12 *p12, int iter, unsigned char *salt, int saltlen, | 142 | int PKCS12_setup_mac (PKCS12 *p12, int iter, unsigned char *salt, int saltlen, |
140 | EVP_MD *md_type) | 143 | const EVP_MD *md_type) |
141 | { | 144 | { |
142 | if (!(p12->mac = PKCS12_MAC_DATA_new())) return PKCS12_ERROR; | 145 | if (!(p12->mac = PKCS12_MAC_DATA_new())) return PKCS12_ERROR; |
143 | if (iter > 1) { | 146 | if (iter > 1) { |
diff --git a/src/lib/libcrypto/pkcs12/p12_npas.c b/src/lib/libcrypto/pkcs12/p12_npas.c index 84e31a7f21..a549433eeb 100644 --- a/src/lib/libcrypto/pkcs12/p12_npas.c +++ b/src/lib/libcrypto/pkcs12/p12_npas.c | |||
@@ -113,15 +113,15 @@ static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass) | |||
113 | unsigned char mac[EVP_MAX_MD_SIZE]; | 113 | unsigned char mac[EVP_MAX_MD_SIZE]; |
114 | unsigned int maclen; | 114 | unsigned int maclen; |
115 | 115 | ||
116 | if (!(asafes = M_PKCS12_unpack_authsafes(p12))) return 0; | 116 | if (!(asafes = PKCS12_unpack_authsafes(p12))) return 0; |
117 | if(!(newsafes = sk_PKCS7_new_null())) return 0; | 117 | if(!(newsafes = sk_PKCS7_new_null())) return 0; |
118 | for (i = 0; i < sk_PKCS7_num (asafes); i++) { | 118 | for (i = 0; i < sk_PKCS7_num (asafes); i++) { |
119 | p7 = sk_PKCS7_value(asafes, i); | 119 | p7 = sk_PKCS7_value(asafes, i); |
120 | bagnid = OBJ_obj2nid(p7->type); | 120 | bagnid = OBJ_obj2nid(p7->type); |
121 | if (bagnid == NID_pkcs7_data) { | 121 | if (bagnid == NID_pkcs7_data) { |
122 | bags = M_PKCS12_unpack_p7data(p7); | 122 | bags = PKCS12_unpack_p7data(p7); |
123 | } else if (bagnid == NID_pkcs7_encrypted) { | 123 | } else if (bagnid == NID_pkcs7_encrypted) { |
124 | bags = M_PKCS12_unpack_p7encdata(p7, oldpass, -1); | 124 | bags = PKCS12_unpack_p7encdata(p7, oldpass, -1); |
125 | alg_get(p7->d.encrypted->enc_data->algorithm, | 125 | alg_get(p7->d.encrypted->enc_data->algorithm, |
126 | &pbe_nid, &pbe_iter, &pbe_saltlen); | 126 | &pbe_nid, &pbe_iter, &pbe_saltlen); |
127 | } else continue; | 127 | } else continue; |
@@ -151,7 +151,7 @@ static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass) | |||
151 | 151 | ||
152 | p12_data_tmp = p12->authsafes->d.data; | 152 | p12_data_tmp = p12->authsafes->d.data; |
153 | if(!(p12->authsafes->d.data = ASN1_OCTET_STRING_new())) goto saferr; | 153 | if(!(p12->authsafes->d.data = ASN1_OCTET_STRING_new())) goto saferr; |
154 | if(!M_PKCS12_pack_authsafes(p12, newsafes)) goto saferr; | 154 | if(!PKCS12_pack_authsafes(p12, newsafes)) goto saferr; |
155 | 155 | ||
156 | if(!PKCS12_gen_mac(p12, newpass, -1, mac, &maclen)) goto saferr; | 156 | if(!PKCS12_gen_mac(p12, newpass, -1, mac, &maclen)) goto saferr; |
157 | if(!(macnew = ASN1_OCTET_STRING_new())) goto saferr; | 157 | if(!(macnew = ASN1_OCTET_STRING_new())) goto saferr; |
@@ -194,7 +194,7 @@ static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass) | |||
194 | 194 | ||
195 | if(M_PKCS12_bag_type(bag) != NID_pkcs8ShroudedKeyBag) return 1; | 195 | if(M_PKCS12_bag_type(bag) != NID_pkcs8ShroudedKeyBag) return 1; |
196 | 196 | ||
197 | if (!(p8 = M_PKCS12_decrypt_skey(bag, oldpass, -1))) return 0; | 197 | if (!(p8 = PKCS8_decrypt(bag->value.shkeybag, oldpass, -1))) return 0; |
198 | alg_get(bag->value.shkeybag->algor, &p8_nid, &p8_iter, &p8_saltlen); | 198 | alg_get(bag->value.shkeybag->algor, &p8_nid, &p8_iter, &p8_saltlen); |
199 | if(!(p8new = PKCS8_encrypt(p8_nid, NULL, newpass, -1, NULL, p8_saltlen, | 199 | if(!(p8new = PKCS8_encrypt(p8_nid, NULL, newpass, -1, NULL, p8_saltlen, |
200 | p8_iter, p8))) return 0; | 200 | p8_iter, p8))) return 0; |
diff --git a/src/lib/libcrypto/pkcs12/p12_p8d.c b/src/lib/libcrypto/pkcs12/p12_p8d.c new file mode 100644 index 0000000000..3c6f377933 --- /dev/null +++ b/src/lib/libcrypto/pkcs12/p12_p8d.c | |||
@@ -0,0 +1,68 @@ | |||
1 | /* p12_p8d.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2001. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include "cryptlib.h" | ||
61 | #include <openssl/pkcs12.h> | ||
62 | |||
63 | PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass, int passlen) | ||
64 | { | ||
65 | return PKCS12_item_decrypt_d2i(p8->algor, ASN1_ITEM_rptr(PKCS8_PRIV_KEY_INFO), pass, | ||
66 | passlen, p8->digest, 1); | ||
67 | } | ||
68 | |||
diff --git a/src/lib/libcrypto/pkcs12/p12_p8e.c b/src/lib/libcrypto/pkcs12/p12_p8e.c new file mode 100644 index 0000000000..3d47956652 --- /dev/null +++ b/src/lib/libcrypto/pkcs12/p12_p8e.c | |||
@@ -0,0 +1,97 @@ | |||
1 | /* p12_p8e.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2001. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include "cryptlib.h" | ||
61 | #include <openssl/pkcs12.h> | ||
62 | |||
63 | X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, | ||
64 | const char *pass, int passlen, | ||
65 | unsigned char *salt, int saltlen, int iter, | ||
66 | PKCS8_PRIV_KEY_INFO *p8inf) | ||
67 | { | ||
68 | X509_SIG *p8 = NULL; | ||
69 | X509_ALGOR *pbe; | ||
70 | |||
71 | if (!(p8 = X509_SIG_new())) { | ||
72 | PKCS12err(PKCS12_F_PKCS8_ENCRYPT, ERR_R_MALLOC_FAILURE); | ||
73 | goto err; | ||
74 | } | ||
75 | |||
76 | if(pbe_nid == -1) pbe = PKCS5_pbe2_set(cipher, iter, salt, saltlen); | ||
77 | else pbe = PKCS5_pbe_set(pbe_nid, iter, salt, saltlen); | ||
78 | if(!pbe) { | ||
79 | PKCS12err(PKCS12_F_PKCS8_ENCRYPT, ERR_R_ASN1_LIB); | ||
80 | goto err; | ||
81 | } | ||
82 | X509_ALGOR_free(p8->algor); | ||
83 | p8->algor = pbe; | ||
84 | M_ASN1_OCTET_STRING_free(p8->digest); | ||
85 | p8->digest = PKCS12_item_i2d_encrypt(pbe, ASN1_ITEM_rptr(PKCS8_PRIV_KEY_INFO), | ||
86 | pass, passlen, p8inf, 1); | ||
87 | if(!p8->digest) { | ||
88 | PKCS12err(PKCS12_F_PKCS8_ENCRYPT, PKCS12_R_ENCRYPT_ERROR); | ||
89 | goto err; | ||
90 | } | ||
91 | |||
92 | return p8; | ||
93 | |||
94 | err: | ||
95 | X509_SIG_free(p8); | ||
96 | return NULL; | ||
97 | } | ||
diff --git a/src/lib/libcrypto/pkcs12/p12_utl.c b/src/lib/libcrypto/pkcs12/p12_utl.c index 2f1d1e534f..243ec76be9 100644 --- a/src/lib/libcrypto/pkcs12/p12_utl.c +++ b/src/lib/libcrypto/pkcs12/p12_utl.c | |||
@@ -97,26 +97,50 @@ char *uni2asc(unsigned char *uni, int unilen) | |||
97 | 97 | ||
98 | int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12) | 98 | int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12) |
99 | { | 99 | { |
100 | return ASN1_i2d_bio((int(*)())i2d_PKCS12, bp, (unsigned char *)p12); | 100 | return ASN1_item_i2d_bio(ASN1_ITEM_rptr(PKCS12), bp, p12); |
101 | } | 101 | } |
102 | 102 | ||
103 | #ifndef NO_FP_API | 103 | #ifndef OPENSSL_NO_FP_API |
104 | int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12) | 104 | int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12) |
105 | { | 105 | { |
106 | return ASN1_i2d_fp((int(*)())i2d_PKCS12, fp, (unsigned char *)p12); | 106 | return ASN1_item_i2d_fp(ASN1_ITEM_rptr(PKCS12), fp, p12); |
107 | } | 107 | } |
108 | #endif | 108 | #endif |
109 | 109 | ||
110 | PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12) | 110 | PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12) |
111 | { | 111 | { |
112 | return (PKCS12 *)ASN1_d2i_bio((char *(*)())PKCS12_new, | 112 | return ASN1_item_d2i_bio(ASN1_ITEM_rptr(PKCS12), bp, p12); |
113 | (char *(*)())d2i_PKCS12, bp, (unsigned char **)p12); | ||
114 | } | 113 | } |
115 | #ifndef NO_FP_API | 114 | #ifndef OPENSSL_NO_FP_API |
116 | PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12) | 115 | PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12) |
117 | { | 116 | { |
118 | return (PKCS12 *)ASN1_d2i_fp((char *(*)())PKCS12_new, | 117 | return ASN1_item_d2i_fp(ASN1_ITEM_rptr(PKCS12), fp, p12); |
119 | (char *(*)())d2i_PKCS12, fp, (unsigned char **)(p12)); | ||
120 | } | 118 | } |
121 | #endif | 119 | #endif |
122 | 120 | ||
121 | PKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509) | ||
122 | { | ||
123 | return PKCS12_item_pack_safebag(x509, ASN1_ITEM_rptr(X509), | ||
124 | NID_x509Certificate, NID_certBag); | ||
125 | } | ||
126 | |||
127 | PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl) | ||
128 | { | ||
129 | return PKCS12_item_pack_safebag(crl, ASN1_ITEM_rptr(X509_CRL), | ||
130 | NID_x509Crl, NID_crlBag); | ||
131 | } | ||
132 | |||
133 | X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag) | ||
134 | { | ||
135 | if(M_PKCS12_bag_type(bag) != NID_certBag) return NULL; | ||
136 | if(M_PKCS12_cert_bag_type(bag) != NID_x509Certificate) return NULL; | ||
137 | return ASN1_item_unpack(bag->value.bag->value.octet, ASN1_ITEM_rptr(X509)); | ||
138 | } | ||
139 | |||
140 | X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag) | ||
141 | { | ||
142 | if(M_PKCS12_bag_type(bag) != NID_crlBag) return NULL; | ||
143 | if(M_PKCS12_cert_bag_type(bag) != NID_x509Crl) return NULL; | ||
144 | return ASN1_item_unpack(bag->value.bag->value.octet, | ||
145 | ASN1_ITEM_rptr(X509_CRL)); | ||
146 | } | ||
diff --git a/src/lib/libcrypto/pkcs12/pk12err.c b/src/lib/libcrypto/pkcs12/pk12err.c index 12db54f49e..10ab80502c 100644 --- a/src/lib/libcrypto/pkcs12/pk12err.c +++ b/src/lib/libcrypto/pkcs12/pk12err.c | |||
@@ -63,7 +63,7 @@ | |||
63 | #include <openssl/pkcs12.h> | 63 | #include <openssl/pkcs12.h> |
64 | 64 | ||
65 | /* BEGIN ERROR CODES */ | 65 | /* BEGIN ERROR CODES */ |
66 | #ifndef NO_ERR | 66 | #ifndef OPENSSL_NO_ERR |
67 | static ERR_STRING_DATA PKCS12_str_functs[]= | 67 | static ERR_STRING_DATA PKCS12_str_functs[]= |
68 | { | 68 | { |
69 | {ERR_PACK(0,PKCS12_F_PARSE_BAGS,0), "PARSE_BAGS"}, | 69 | {ERR_PACK(0,PKCS12_F_PARSE_BAGS,0), "PARSE_BAGS"}, |
@@ -130,7 +130,7 @@ void ERR_load_PKCS12_strings(void) | |||
130 | if (init) | 130 | if (init) |
131 | { | 131 | { |
132 | init=0; | 132 | init=0; |
133 | #ifndef NO_ERR | 133 | #ifndef OPENSSL_NO_ERR |
134 | ERR_load_strings(ERR_LIB_PKCS12,PKCS12_str_functs); | 134 | ERR_load_strings(ERR_LIB_PKCS12,PKCS12_str_functs); |
135 | ERR_load_strings(ERR_LIB_PKCS12,PKCS12_str_reasons); | 135 | ERR_load_strings(ERR_LIB_PKCS12,PKCS12_str_reasons); |
136 | #endif | 136 | #endif |
diff --git a/src/lib/libcrypto/pkcs12/pkcs12.h b/src/lib/libcrypto/pkcs12/pkcs12.h index e529154f26..1786b6d4f3 100644 --- a/src/lib/libcrypto/pkcs12/pkcs12.h +++ b/src/lib/libcrypto/pkcs12/pkcs12.h | |||
@@ -120,7 +120,6 @@ union { | |||
120 | ASN1_TYPE *other; | 120 | ASN1_TYPE *other; |
121 | }value; | 121 | }value; |
122 | STACK_OF(X509_ATTRIBUTE) *attrib; | 122 | STACK_OF(X509_ATTRIBUTE) *attrib; |
123 | ASN1_TYPE *rest; | ||
124 | } PKCS12_SAFEBAG; | 123 | } PKCS12_SAFEBAG; |
125 | 124 | ||
126 | DECLARE_STACK_OF(PKCS12_SAFEBAG) | 125 | DECLARE_STACK_OF(PKCS12_SAFEBAG) |
@@ -141,55 +140,25 @@ union { | |||
141 | #define PKCS12_ERROR 0 | 140 | #define PKCS12_ERROR 0 |
142 | #define PKCS12_OK 1 | 141 | #define PKCS12_OK 1 |
143 | 142 | ||
144 | #define M_PKCS12_bag_type(bag) OBJ_obj2nid(bag->type) | 143 | /* Compatibility macros */ |
145 | #define M_PKCS12_cert_bag_type(bag) OBJ_obj2nid(bag->value.bag->type) | ||
146 | #define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type | ||
147 | |||
148 | #define M_PKCS12_x5092certbag(x509) \ | ||
149 | PKCS12_pack_safebag((char *)(x509), i2d_X509, NID_x509Certificate, NID_certBag) | ||
150 | |||
151 | #define M_PKCS12_x509crl2certbag(crl) \ | ||
152 | PKCS12_pack_safebag((char *)(crl), i2d_X509CRL, NID_x509Crl, NID_crlBag) | ||
153 | |||
154 | #define M_PKCS12_certbag2x509(bg) \ | ||
155 | (X509 *) ASN1_unpack_string((bg)->value.bag->value.octet, \ | ||
156 | (char *(*)())d2i_X509) | ||
157 | 144 | ||
158 | #define M_PKCS12_certbag2x509crl(bg) \ | 145 | #define M_PKCS12_x5092certbag PKCS12_x5092certbag |
159 | (X509CRL *) ASN1_unpack_string((bg)->value.bag->value.octet, \ | 146 | #define M_PKCS12_x509crl2certbag PKCS12_x509crl2certbag |
160 | (char *(*)())d2i_X509CRL) | ||
161 | 147 | ||
162 | /*#define M_PKCS12_pkcs82rsa(p8) \ | 148 | #define M_PKCS12_certbag2x509 PKCS12_certbag2x509 |
163 | (RSA *) ASN1_unpack_string((p8)->pkey, (char *(*)())d2i_RSAPrivateKey)*/ | 149 | #define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl |
164 | 150 | ||
165 | #define M_PKCS12_unpack_p7data(p7) \ | 151 | #define M_PKCS12_unpack_p7data PKCS12_unpack_p7data |
166 | ASN1_seq_unpack_PKCS12_SAFEBAG((p7)->d.data->data, p7->d.data->length, \ | 152 | #define M_PKCS12_pack_authsafes PKCS12_pack_authsafes |
167 | d2i_PKCS12_SAFEBAG, PKCS12_SAFEBAG_free) | 153 | #define M_PKCS12_unpack_authsafes PKCS12_unpack_authsafes |
154 | #define M_PKCS12_unpack_p7encdata PKCS12_unpack_p7encdata | ||
168 | 155 | ||
169 | #define M_PKCS12_pack_authsafes(p12, safes) \ | 156 | #define M_PKCS12_decrypt_skey PKCS12_decrypt_skey |
170 | ASN1_seq_pack_PKCS7((safes), i2d_PKCS7,\ | 157 | #define M_PKCS8_decrypt PKCS8_decrypt |
171 | &(p12)->authsafes->d.data->data, &(p12)->authsafes->d.data->length) | ||
172 | 158 | ||
173 | #define M_PKCS12_unpack_authsafes(p12) \ | 159 | #define M_PKCS12_bag_type(bag) OBJ_obj2nid(bag->type) |
174 | ASN1_seq_unpack_PKCS7((p12)->authsafes->d.data->data, \ | 160 | #define M_PKCS12_cert_bag_type(bag) OBJ_obj2nid(bag->value.bag->type) |
175 | (p12)->authsafes->d.data->length, d2i_PKCS7, PKCS7_free) | 161 | #define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type |
176 | |||
177 | #define M_PKCS12_unpack_p7encdata(p7, pass, passlen) \ | ||
178 | PKCS12_decrypt_d2i_PKCS12_SAFEBAG((p7)->d.encrypted->enc_data->algorithm,\ | ||
179 | d2i_PKCS12_SAFEBAG, PKCS12_SAFEBAG_free, \ | ||
180 | (pass), (passlen), \ | ||
181 | (p7)->d.encrypted->enc_data->enc_data, 3) | ||
182 | |||
183 | #define M_PKCS12_decrypt_skey(bag, pass, passlen) \ | ||
184 | (PKCS8_PRIV_KEY_INFO *) PKCS12_decrypt_d2i((bag)->value.shkeybag->algor, \ | ||
185 | (char *(*)())d2i_PKCS8_PRIV_KEY_INFO, (void (*)(void *))PKCS8_PRIV_KEY_INFO_free, \ | ||
186 | (pass), (passlen), \ | ||
187 | (bag)->value.shkeybag->digest, 2) | ||
188 | |||
189 | #define M_PKCS8_decrypt(p8, pass, passlen) \ | ||
190 | (PKCS8_PRIV_KEY_INFO *) PKCS12_decrypt_d2i((p8)->algor, \ | ||
191 | (char *(*)())d2i_PKCS8_PRIV_KEY_INFO, (void (*)(void *))PKCS8_PRIV_KEY_INFO_free,\ | ||
192 | (pass), (passlen), (p8)->digest, 2) | ||
193 | 162 | ||
194 | #define PKCS12_get_attr(bag, attr_nid) \ | 163 | #define PKCS12_get_attr(bag, attr_nid) \ |
195 | PKCS12_get_attr_gen(bag->attrib, attr_nid) | 164 | PKCS12_get_attr_gen(bag->attrib, attr_nid) |
@@ -200,8 +169,17 @@ PKCS12_decrypt_d2i_PKCS12_SAFEBAG((p7)->d.encrypted->enc_data->algorithm,\ | |||
200 | #define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0) | 169 | #define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0) |
201 | 170 | ||
202 | 171 | ||
203 | PKCS12_SAFEBAG *PKCS12_pack_safebag(char *obj, int (*i2d)(), int nid1, int nid2); | 172 | PKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509); |
173 | PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl); | ||
174 | X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag); | ||
175 | X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag); | ||
176 | |||
177 | PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, int nid1, | ||
178 | int nid2); | ||
204 | PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8); | 179 | PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8); |
180 | PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass, int passlen); | ||
181 | PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, const char *pass, | ||
182 | int passlen); | ||
205 | X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, | 183 | X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, |
206 | const char *pass, int passlen, | 184 | const char *pass, int passlen, |
207 | unsigned char *salt, int saltlen, int iter, | 185 | unsigned char *salt, int saltlen, int iter, |
@@ -211,12 +189,20 @@ PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass, | |||
211 | int saltlen, int iter, | 189 | int saltlen, int iter, |
212 | PKCS8_PRIV_KEY_INFO *p8); | 190 | PKCS8_PRIV_KEY_INFO *p8); |
213 | PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); | 191 | PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); |
192 | STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7); | ||
214 | PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, | 193 | PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, |
215 | unsigned char *salt, int saltlen, int iter, | 194 | unsigned char *salt, int saltlen, int iter, |
216 | STACK_OF(PKCS12_SAFEBAG) *bags); | 195 | STACK_OF(PKCS12_SAFEBAG) *bags); |
196 | STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen); | ||
197 | |||
198 | int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); | ||
199 | STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12); | ||
200 | |||
217 | int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen); | 201 | int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen); |
218 | int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, | 202 | int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, |
219 | int namelen); | 203 | int namelen); |
204 | int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, | ||
205 | int namelen); | ||
220 | int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, const unsigned char *name, | 206 | int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, const unsigned char *name, |
221 | int namelen); | 207 | int namelen); |
222 | int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage); | 208 | int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage); |
@@ -225,49 +211,38 @@ char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag); | |||
225 | unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, | 211 | unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, |
226 | int passlen, unsigned char *in, int inlen, | 212 | int passlen, unsigned char *in, int inlen, |
227 | unsigned char **data, int *datalen, int en_de); | 213 | unsigned char **data, int *datalen, int en_de); |
228 | char *PKCS12_decrypt_d2i(X509_ALGOR *algor, char *(*d2i)(), | 214 | void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it, |
229 | void (*free_func)(void *), const char *pass, int passlen, | 215 | const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf); |
230 | ASN1_STRING *oct, int seq); | 216 | ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *it, |
231 | ASN1_STRING *PKCS12_i2d_encrypt(X509_ALGOR *algor, int (*i2d)(), | 217 | const char *pass, int passlen, |
232 | const char *pass, int passlen, char *obj, | 218 | void *obj, int zbuf); |
233 | int seq); | ||
234 | PKCS12 *PKCS12_init(int mode); | 219 | PKCS12 *PKCS12_init(int mode); |
235 | int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt, | 220 | int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt, |
236 | int saltlen, int id, int iter, int n, | 221 | int saltlen, int id, int iter, int n, |
237 | unsigned char *out, const EVP_MD *md_type); | 222 | unsigned char *out, const EVP_MD *md_type); |
238 | int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int id, int iter, int n, unsigned char *out, const EVP_MD *md_type); | 223 | int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int id, int iter, int n, unsigned char *out, const EVP_MD *md_type); |
239 | int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | 224 | int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, |
240 | ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md_type, | 225 | ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md_type, |
241 | int en_de); | 226 | int en_de); |
242 | int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen, | 227 | int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen, |
243 | unsigned char *mac, unsigned int *maclen); | 228 | unsigned char *mac, unsigned int *maclen); |
244 | int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen); | 229 | int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen); |
245 | int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, | 230 | int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, |
246 | unsigned char *salt, int saltlen, int iter, | 231 | unsigned char *salt, int saltlen, int iter, |
247 | EVP_MD *md_type); | 232 | const EVP_MD *md_type); |
248 | int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, | 233 | int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, |
249 | int saltlen, EVP_MD *md_type); | 234 | int saltlen, const EVP_MD *md_type); |
250 | unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen); | 235 | unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen); |
251 | char *uni2asc(unsigned char *uni, int unilen); | 236 | char *uni2asc(unsigned char *uni, int unilen); |
252 | int i2d_PKCS12_BAGS(PKCS12_BAGS *a, unsigned char **pp); | 237 | |
253 | PKCS12_BAGS *PKCS12_BAGS_new(void); | 238 | DECLARE_ASN1_FUNCTIONS(PKCS12) |
254 | PKCS12_BAGS *d2i_PKCS12_BAGS(PKCS12_BAGS **a, unsigned char **pp, long length); | 239 | DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA) |
255 | void PKCS12_BAGS_free(PKCS12_BAGS *a); | 240 | DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG) |
256 | int i2d_PKCS12(PKCS12 *a, unsigned char **pp); | 241 | DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS) |
257 | PKCS12 *d2i_PKCS12(PKCS12 **a, unsigned char **pp, long length); | 242 | |
258 | PKCS12 *PKCS12_new(void); | 243 | DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS) |
259 | void PKCS12_free(PKCS12 *a); | 244 | DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES) |
260 | int i2d_PKCS12_MAC_DATA(PKCS12_MAC_DATA *a, unsigned char **pp); | 245 | |
261 | PKCS12_MAC_DATA *PKCS12_MAC_DATA_new(void); | ||
262 | PKCS12_MAC_DATA *d2i_PKCS12_MAC_DATA(PKCS12_MAC_DATA **a, unsigned char **pp, | ||
263 | long length); | ||
264 | void PKCS12_MAC_DATA_free(PKCS12_MAC_DATA *a); | ||
265 | int i2d_PKCS12_SAFEBAG(PKCS12_SAFEBAG *a, unsigned char **pp); | ||
266 | PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(void); | ||
267 | PKCS12_SAFEBAG *d2i_PKCS12_SAFEBAG(PKCS12_SAFEBAG **a, unsigned char **pp, | ||
268 | long length); | ||
269 | void PKCS12_SAFEBAG_free(PKCS12_SAFEBAG *a); | ||
270 | void ERR_load_PKCS12_strings(void); | ||
271 | void PKCS12_PBE_add(void); | 246 | void PKCS12_PBE_add(void); |
272 | int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, | 247 | int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, |
273 | STACK_OF(X509) **ca); | 248 | STACK_OF(X509) **ca); |
@@ -284,6 +259,7 @@ int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass); | |||
284 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 259 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
285 | * made after this point may be overwritten when the script is next run. | 260 | * made after this point may be overwritten when the script is next run. |
286 | */ | 261 | */ |
262 | void ERR_load_PKCS12_strings(void); | ||
287 | 263 | ||
288 | /* Error codes for the PKCS12 functions. */ | 264 | /* Error codes for the PKCS12 functions. */ |
289 | 265 | ||
@@ -342,4 +318,3 @@ int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass); | |||
342 | } | 318 | } |
343 | #endif | 319 | #endif |
344 | #endif | 320 | #endif |
345 | |||