summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pkcs12/p12_crt.c
diff options
context:
space:
mode:
authortb <>2022-08-03 20:16:06 +0000
committertb <>2022-08-03 20:16:06 +0000
commit65a74ca85df35967792e35e1060f5c4f7cfea35c (patch)
tree2050ca3c5df6f38c2b64ca740e75145adf5ebc5a /src/lib/libcrypto/pkcs12/p12_crt.c
parent0086325146fe45a6dcc6b30f48bdb72f604e792f (diff)
downloadopenbsd-65a74ca85df35967792e35e1060f5c4f7cfea35c.tar.gz
openbsd-65a74ca85df35967792e35e1060f5c4f7cfea35c.tar.bz2
openbsd-65a74ca85df35967792e35e1060f5c4f7cfea35c.zip
Prepare to provide PKCS12 accessors
In order to be able to make pkcs12/ opaque, we need an entire family of accessors. These are in a particularly nasty tangle since this was done in about a dozen steps while sprinkling const, renaming functions, etc. The public API also adds backward compat macros for functions that were in the tree for half a day and then renamed. Of course some of them got picked up by some ports. Some of the gruesome hacks in here will go away with the next bump, but that doesn't mean that the pkcs12 directory will be prettier afterward. ok jsing
Diffstat (limited to 'src/lib/libcrypto/pkcs12/p12_crt.c')
-rw-r--r--src/lib/libcrypto/pkcs12/p12_crt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_crt.c b/src/lib/libcrypto/pkcs12/p12_crt.c
index f8ba3357e7..dbcfd25478 100644
--- a/src/lib/libcrypto/pkcs12/p12_crt.c
+++ b/src/lib/libcrypto/pkcs12/p12_crt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_crt.c,v 1.18 2018/05/13 13:46:55 tb Exp $ */ 1/* $OpenBSD: p12_crt.c,v 1.19 2022/08/03 20:16:06 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. 3 * project.
4 */ 4 */
@@ -232,12 +232,12 @@ PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key, int key_usage,
232 if (key_usage && !PKCS8_add_keyusage(p8, key_usage)) 232 if (key_usage && !PKCS8_add_keyusage(p8, key_usage))
233 goto err; 233 goto err;
234 if (nid_key != -1) { 234 if (nid_key != -1) {
235 bag = PKCS12_MAKE_SHKEYBAG(nid_key, pass, -1, NULL, 0, 235 bag = PKCS12_SAFEBAG_create_pkcs8_encrypt(nid_key, pass, -1,
236 iter, p8); 236 NULL, 0, iter, p8);
237 PKCS8_PRIV_KEY_INFO_free(p8); 237 PKCS8_PRIV_KEY_INFO_free(p8);
238 p8 = NULL; 238 p8 = NULL;
239 } else { 239 } else {
240 bag = PKCS12_MAKE_KEYBAG(p8); 240 bag = PKCS12_SAFEBAG_create0_p8inf(p8);
241 if (bag != NULL) 241 if (bag != NULL)
242 p8 = NULL; 242 p8 = NULL;
243 } 243 }