From 630f6daf10fc98b5f14b3ccc66b0862df2a8f102 Mon Sep 17 00:00:00 2001 From: tb <> Date: Mon, 1 Jan 2024 15:23:00 +0000 Subject: Remove EVP_PKEY's save_type member This was only used to avoid an ameth lookup in EVP_PKEY_set_type(), a micro-optimization that was removed in p_lib.c r1.48. ok jsing --- src/lib/libcrypto/evp/evp_local.h | 3 +-- src/lib/libcrypto/evp/p_lib.c | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/evp/evp_local.h b/src/lib/libcrypto/evp/evp_local.h index d21919ac9b..eaede4409a 100644 --- a/src/lib/libcrypto/evp/evp_local.h +++ b/src/lib/libcrypto/evp/evp_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_local.h,v 1.10 2023/12/29 10:59:00 tb Exp $ */ +/* $OpenBSD: evp_local.h,v 1.11 2024/01/01 15:23:00 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -156,7 +156,6 @@ struct evp_pkey_asn1_method_st { * arbitrary encryption.... */ struct evp_pkey_st { int type; - int save_type; int references; const EVP_PKEY_ASN1_METHOD *ameth; union { diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c index 24e1dbb14c..b64977bab8 100644 --- a/src/lib/libcrypto/evp/p_lib.c +++ b/src/lib/libcrypto/evp/p_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p_lib.c,v 1.51 2023/12/29 10:59:00 tb Exp $ */ +/* $OpenBSD: p_lib.c,v 1.52 2024/01/01 15:23:00 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -389,7 +389,6 @@ EVP_PKEY_new(void) } pkey->type = EVP_PKEY_NONE; - pkey->save_type = EVP_PKEY_NONE; pkey->references = 1; pkey->save_parameters = 1; @@ -440,7 +439,6 @@ EVP_PKEY_set_type(EVP_PKEY *pkey, int type) if (pkey != NULL) { pkey->ameth = ameth; pkey->type = pkey->ameth->pkey_id; - pkey->save_type = type; } return 1; @@ -460,7 +458,6 @@ EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len) if (pkey != NULL) { pkey->ameth = ameth; pkey->type = pkey->ameth->pkey_id; - pkey->save_type = EVP_PKEY_NONE; } return 1; -- cgit v1.2.3-55-g6feb