From: tb Date: Mon, 1 Jan 2024 15:23:00 +0000 (+0000) Subject: Remove EVP_PKEY's save_type member X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=697566c9bfbedfa8755af237232535662a2fd9f6;p=openbsd 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 --- diff --git a/lib/libcrypto/evp/evp_local.h b/lib/libcrypto/evp/evp_local.h index d21919ac9b4..eaede4409a7 100644 --- a/lib/libcrypto/evp/evp_local.h +++ b/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/lib/libcrypto/evp/p_lib.c b/lib/libcrypto/evp/p_lib.c index 24e1dbb14c7..b64977bab8c 100644 --- a/lib/libcrypto/evp/p_lib.c +++ b/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;