diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrypto/ec/ec_asn1.c | 24 | ||||
-rw-r--r-- | lib/libcrypto/ec/ec_lib.c | 24 |
2 files changed, 24 insertions, 24 deletions
diff --git a/lib/libcrypto/ec/ec_asn1.c b/lib/libcrypto/ec/ec_asn1.c index 006ad7662a0..ed7bae16b94 100644 --- a/lib/libcrypto/ec/ec_asn1.c +++ b/lib/libcrypto/ec/ec_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_asn1.c,v 1.105 2024/11/02 19:21:24 tb Exp $ */ +/* $OpenBSD: ec_asn1.c,v 1.106 2024/11/08 13:55:45 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -1403,6 +1403,28 @@ d2i_ECParameters(EC_KEY **out_ec_key, const unsigned char **in, long len) LCRYPTO_ALIAS(d2i_ECParameters); EC_KEY * +ECParameters_dup(EC_KEY *key) +{ + const unsigned char *p; + unsigned char *der = NULL; + EC_KEY *dup = NULL; + int len; + + if (key == NULL) + return NULL; + + if ((len = i2d_ECParameters(key, &der)) <= 0) + return NULL; + + p = der; + dup = d2i_ECParameters(NULL, &p, len); + freezero(der, len); + + return dup; +} +LCRYPTO_ALIAS(ECParameters_dup); + +EC_KEY * o2i_ECPublicKey(EC_KEY **in_ec_key, const unsigned char **in, long len) { EC_KEY *ec_key = NULL; diff --git a/lib/libcrypto/ec/ec_lib.c b/lib/libcrypto/ec/ec_lib.c index f409df1a7ba..d61dea9f125 100644 --- a/lib/libcrypto/ec/ec_lib.c +++ b/lib/libcrypto/ec/ec_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_lib.c,v 1.84 2024/11/08 01:33:20 tb Exp $ */ +/* $OpenBSD: ec_lib.c,v 1.85 2024/11/08 13:55:45 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -1436,25 +1436,3 @@ ec_group_simple_order_bits(const EC_GROUP *group) #endif return BN_num_bits(&group->order); } - -EC_KEY * -ECParameters_dup(EC_KEY *key) -{ - const unsigned char *p; - unsigned char *der = NULL; - EC_KEY *dup = NULL; - int len; - - if (key == NULL) - return NULL; - - if ((len = i2d_ECParameters(key, &der)) <= 0) - return NULL; - - p = der; - dup = d2i_ECParameters(NULL, &p, len); - freezero(der, len); - - return dup; -} -LCRYPTO_ALIAS(ECParameters_dup); |