From f8097ca488d38b254a6328b17b9e7d7ae0a4af91 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 9 Mar 2025 15:45:52 +0000 Subject: Reinstate PKCS12_key_gen_uni() Unfortunately, this is used in acsm-calibre-plugin, via oscrypto. Fixes https://github.com/Leseratte10/acsm-calibre-plugin/issues/112 ok jsing --- src/lib/libcrypto/Symbols.list | 1 + src/lib/libcrypto/hidden/openssl/pkcs12.h | 3 ++- src/lib/libcrypto/pkcs12/p12_key.c | 3 ++- src/lib/libcrypto/pkcs12/pkcs12.h | 5 ++++- src/lib/libcrypto/pkcs12/pkcs12_local.h | 5 +---- 5 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list index 7e681aa38f..e259430bbf 100644 --- a/src/lib/libcrypto/Symbols.list +++ b/src/lib/libcrypto/Symbols.list @@ -1788,6 +1788,7 @@ PKCS12_free PKCS12_get0_mac PKCS12_get_friendlyname PKCS12_it +PKCS12_key_gen_uni PKCS12_mac_present PKCS12_new PKCS12_newpass diff --git a/src/lib/libcrypto/hidden/openssl/pkcs12.h b/src/lib/libcrypto/hidden/openssl/pkcs12.h index 0144ba4e35..7e5607ab77 100644 --- a/src/lib/libcrypto/hidden/openssl/pkcs12.h +++ b/src/lib/libcrypto/hidden/openssl/pkcs12.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs12.h,v 1.4 2024/07/09 06:13:22 beck Exp $ */ +/* $OpenBSD: pkcs12.h,v 1.5 2025/03/09 15:45:52 tb Exp $ */ /* * Copyright (c) 2022 Bob Beck * @@ -46,6 +46,7 @@ LCRYPTO_USED(PKCS12_unpack_p7encdata); LCRYPTO_USED(PKCS12_unpack_authsafes); LCRYPTO_USED(PKCS8_add_keyusage); LCRYPTO_USED(PKCS12_get_friendlyname); +LCRYPTO_USED(PKCS12_key_gen_uni); LCRYPTO_USED(PKCS12_verify_mac); LCRYPTO_USED(PKCS12_set_mac); LCRYPTO_USED(OPENSSL_asc2uni); diff --git a/src/lib/libcrypto/pkcs12/p12_key.c b/src/lib/libcrypto/pkcs12/p12_key.c index 78e7d0450e..443d632c87 100644 --- a/src/lib/libcrypto/pkcs12/p12_key.c +++ b/src/lib/libcrypto/pkcs12/p12_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_key.c,v 1.35 2024/03/02 10:15:16 tb Exp $ */ +/* $OpenBSD: p12_key.c,v 1.36 2025/03/09 15:45:52 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -194,3 +194,4 @@ PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, return ret; } +LCRYPTO_ALIAS(PKCS12_key_gen_uni); diff --git a/src/lib/libcrypto/pkcs12/pkcs12.h b/src/lib/libcrypto/pkcs12/pkcs12.h index 962403976d..200712039b 100644 --- a/src/lib/libcrypto/pkcs12/pkcs12.h +++ b/src/lib/libcrypto/pkcs12/pkcs12.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs12.h,v 1.28 2024/03/02 10:15:16 tb Exp $ */ +/* $OpenBSD: pkcs12.h,v 1.29 2025/03/09 15:45:52 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -182,6 +182,9 @@ STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12); int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage); char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag); +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); int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen); int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, unsigned char *salt, int saltlen, int iter, diff --git a/src/lib/libcrypto/pkcs12/pkcs12_local.h b/src/lib/libcrypto/pkcs12/pkcs12_local.h index dfdcdce1f9..4a3ce4b3f0 100644 --- a/src/lib/libcrypto/pkcs12/pkcs12_local.h +++ b/src/lib/libcrypto/pkcs12/pkcs12_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs12_local.h,v 1.5 2024/03/02 10:15:16 tb Exp $ */ +/* $OpenBSD: pkcs12_local.h,v 1.6 2025/03/09 15:45:52 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -153,9 +153,6 @@ PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt, int saltlen, int id, int iter, int n, unsigned char *out, const EVP_MD *md_type); -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); int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); -- cgit v1.2.3-55-g6feb