From 3abceb25bec4e525f0a8d1e7d947a513c1e999d6 Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 15 Apr 2024 15:42:23 +0000 Subject: [PATCH] Unexport the ECPKPARAMETERS API ok jsing --- lib/libcrypto/Symbols.list | 5 ----- lib/libcrypto/ec/ec.h | 4 +--- lib/libcrypto/ec/ec_asn1.c | 22 +++++++++++----------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index 0bb8bb6aea6..7d50c8a1bc8 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -885,9 +885,6 @@ ECDSA_do_verify ECDSA_sign ECDSA_size ECDSA_verify -ECPKPARAMETERS_free -ECPKPARAMETERS_it -ECPKPARAMETERS_new ECPKParameters_print ECPKParameters_print_fp ECParameters_dup @@ -3001,7 +2998,6 @@ d2i_DSAparams d2i_DSAparams_bio d2i_DSAparams_fp d2i_ECDSA_SIG -d2i_ECPKPARAMETERS d2i_ECPKParameters d2i_ECParameters d2i_ECPrivateKey @@ -3191,7 +3187,6 @@ i2d_DSAparams i2d_DSAparams_bio i2d_DSAparams_fp i2d_ECDSA_SIG -i2d_ECPKPARAMETERS i2d_ECPKParameters i2d_ECParameters i2d_ECPrivateKey diff --git a/lib/libcrypto/ec/ec.h b/lib/libcrypto/ec/ec.h index be3f146d462..10513795e42 100644 --- a/lib/libcrypto/ec/ec.h +++ b/lib/libcrypto/ec/ec.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ec.h,v 1.47 2024/04/10 15:01:31 beck Exp $ */ +/* $OpenBSD: ec.h,v 1.48 2024/04/15 15:42:23 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -237,8 +237,6 @@ int EC_GROUP_get_basis_type(const EC_GROUP *); #define OPENSSL_EC_EXPLICIT_CURVE 0x000 #define OPENSSL_EC_NAMED_CURVE 0x001 -typedef struct ecpk_parameters_st ECPKPARAMETERS; - EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len); int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out); diff --git a/lib/libcrypto/ec/ec_asn1.c b/lib/libcrypto/ec/ec_asn1.c index eb28fa53324..4bd95d6efcf 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.49 2024/04/15 15:41:27 tb Exp $ */ +/* $OpenBSD: ec_asn1.c,v 1.50 2024/04/15 15:42:23 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -125,14 +125,14 @@ typedef struct ec_parameters_st { ASN1_INTEGER *cofactor; } ECPARAMETERS; -struct ecpk_parameters_st { +typedef struct ecpk_parameters_st { int type; union { ASN1_OBJECT *named_curve; ECPARAMETERS *parameters; ASN1_NULL *implicitlyCA; } value; -} /* ECPKPARAMETERS */ ; +} ECPKPARAMETERS; /* SEC1 ECPrivateKey */ typedef struct ec_privatekey_st { @@ -497,31 +497,31 @@ const ASN1_ITEM ECPKPARAMETERS_it = { .sname = "ECPKPARAMETERS", }; -ECPKPARAMETERS *ECPKPARAMETERS_new(void); -void ECPKPARAMETERS_free(ECPKPARAMETERS *a); -ECPKPARAMETERS *d2i_ECPKPARAMETERS(ECPKPARAMETERS **a, const unsigned char **in, long len); -int i2d_ECPKPARAMETERS(const ECPKPARAMETERS *a, unsigned char **out); +static ECPKPARAMETERS *ECPKPARAMETERS_new(void); +static void ECPKPARAMETERS_free(ECPKPARAMETERS *a); +static ECPKPARAMETERS *d2i_ECPKPARAMETERS(ECPKPARAMETERS **a, const unsigned char **in, long len); +static int i2d_ECPKPARAMETERS(const ECPKPARAMETERS *a, unsigned char **out); -ECPKPARAMETERS * +static ECPKPARAMETERS * d2i_ECPKPARAMETERS(ECPKPARAMETERS **a, const unsigned char **in, long len) { return (ECPKPARAMETERS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &ECPKPARAMETERS_it); } -int +static int i2d_ECPKPARAMETERS(const ECPKPARAMETERS *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &ECPKPARAMETERS_it); } -ECPKPARAMETERS * +static ECPKPARAMETERS * ECPKPARAMETERS_new(void) { return (ECPKPARAMETERS *)ASN1_item_new(&ECPKPARAMETERS_it); } -void +static void ECPKPARAMETERS_free(ECPKPARAMETERS *a) { ASN1_item_free((ASN1_VALUE *)a, &ECPKPARAMETERS_it); -- 2.20.1