summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pkcs12/p12_add.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/pkcs12/p12_add.c')
-rw-r--r--src/lib/libcrypto/pkcs12/p12_add.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_add.c b/src/lib/libcrypto/pkcs12/p12_add.c
index 66cb95b1db..93c7c7221e 100644
--- a/src/lib/libcrypto/pkcs12/p12_add.c
+++ b/src/lib/libcrypto/pkcs12/p12_add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_add.c,v 1.21 2022/11/12 13:03:28 beck Exp $ */ 1/* $OpenBSD: p12_add.c,v 1.22 2023/02/16 08:38:17 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -90,7 +90,7 @@ PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, int nid1, int nid2)
90 safebag->type = OBJ_nid2obj(nid2); 90 safebag->type = OBJ_nid2obj(nid2);
91 return safebag; 91 return safebag;
92} 92}
93LCRYPTO_ALIAS(PKCS12_item_pack_safebag) 93LCRYPTO_ALIAS(PKCS12_item_pack_safebag);
94 94
95/* Turn a stack of SAFEBAGS into a PKCS#7 data Contentinfo */ 95/* Turn a stack of SAFEBAGS into a PKCS#7 data Contentinfo */
96PKCS7 * 96PKCS7 *
@@ -118,7 +118,7 @@ err:
118 PKCS7_free(p7); 118 PKCS7_free(p7);
119 return NULL; 119 return NULL;
120} 120}
121LCRYPTO_ALIAS(PKCS12_pack_p7data) 121LCRYPTO_ALIAS(PKCS12_pack_p7data);
122 122
123/* Unpack SAFEBAGS from PKCS#7 data ContentInfo */ 123/* Unpack SAFEBAGS from PKCS#7 data ContentInfo */
124STACK_OF(PKCS12_SAFEBAG) * 124STACK_OF(PKCS12_SAFEBAG) *
@@ -130,7 +130,7 @@ PKCS12_unpack_p7data(PKCS7 *p7)
130 } 130 }
131 return ASN1_item_unpack(p7->d.data, &PKCS12_SAFEBAGS_it); 131 return ASN1_item_unpack(p7->d.data, &PKCS12_SAFEBAGS_it);
132} 132}
133LCRYPTO_ALIAS(PKCS12_unpack_p7data) 133LCRYPTO_ALIAS(PKCS12_unpack_p7data);
134 134
135/* Turn a stack of SAFEBAGS into a PKCS#7 encrypted data ContentInfo */ 135/* Turn a stack of SAFEBAGS into a PKCS#7 encrypted data ContentInfo */
136 136
@@ -177,7 +177,7 @@ err:
177 PKCS7_free(p7); 177 PKCS7_free(p7);
178 return NULL; 178 return NULL;
179} 179}
180LCRYPTO_ALIAS(PKCS12_pack_p7encdata) 180LCRYPTO_ALIAS(PKCS12_pack_p7encdata);
181 181
182STACK_OF(PKCS12_SAFEBAG) * 182STACK_OF(PKCS12_SAFEBAG) *
183PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen) 183PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen)
@@ -188,14 +188,14 @@ PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen)
188 &PKCS12_SAFEBAGS_it, pass, passlen, 188 &PKCS12_SAFEBAGS_it, pass, passlen,
189 p7->d.encrypted->enc_data->enc_data, 1); 189 p7->d.encrypted->enc_data->enc_data, 1);
190} 190}
191LCRYPTO_ALIAS(PKCS12_unpack_p7encdata) 191LCRYPTO_ALIAS(PKCS12_unpack_p7encdata);
192 192
193PKCS8_PRIV_KEY_INFO * 193PKCS8_PRIV_KEY_INFO *
194PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag, const char *pass, int passlen) 194PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag, const char *pass, int passlen)
195{ 195{
196 return PKCS8_decrypt(bag->value.shkeybag, pass, passlen); 196 return PKCS8_decrypt(bag->value.shkeybag, pass, passlen);
197} 197}
198LCRYPTO_ALIAS(PKCS12_decrypt_skey) 198LCRYPTO_ALIAS(PKCS12_decrypt_skey);
199 199
200int 200int
201PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes) 201PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes)
@@ -205,7 +205,7 @@ PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes)
205 return 1; 205 return 1;
206 return 0; 206 return 0;
207} 207}
208LCRYPTO_ALIAS(PKCS12_pack_authsafes) 208LCRYPTO_ALIAS(PKCS12_pack_authsafes);
209 209
210STACK_OF(PKCS7) * 210STACK_OF(PKCS7) *
211PKCS12_unpack_authsafes(const PKCS12 *p12) 211PKCS12_unpack_authsafes(const PKCS12 *p12)
@@ -217,4 +217,4 @@ PKCS12_unpack_authsafes(const PKCS12 *p12)
217 return ASN1_item_unpack(p12->authsafes->d.data, 217 return ASN1_item_unpack(p12->authsafes->d.data,
218 &PKCS12_AUTHSAFES_it); 218 &PKCS12_AUTHSAFES_it);
219} 219}
220LCRYPTO_ALIAS(PKCS12_unpack_authsafes) 220LCRYPTO_ALIAS(PKCS12_unpack_authsafes);