summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-01-01 15:23:00 +0000
committertb <>2024-01-01 15:23:00 +0000
commit3b5c644fe6f635d6c796c6e8fed6b0529c9edd30 (patch)
tree28c7ecdded0ce5badf73db8e9b76b6aa593fdae6 /src
parent041234a38a0e40be63a39550fdb9f962260482c8 (diff)
downloadopenbsd-3b5c644fe6f635d6c796c6e8fed6b0529c9edd30.tar.gz
openbsd-3b5c644fe6f635d6c796c6e8fed6b0529c9edd30.tar.bz2
openbsd-3b5c644fe6f635d6c796c6e8fed6b0529c9edd30.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/evp/evp_local.h3
-rw-r--r--src/lib/libcrypto/evp/p_lib.c5
2 files changed, 2 insertions, 6 deletions
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 @@
1/* $OpenBSD: evp_local.h,v 1.10 2023/12/29 10:59:00 tb Exp $ */ 1/* $OpenBSD: evp_local.h,v 1.11 2024/01/01 15:23:00 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -156,7 +156,6 @@ struct evp_pkey_asn1_method_st {
156 * arbitrary encryption.... */ 156 * arbitrary encryption.... */
157struct evp_pkey_st { 157struct evp_pkey_st {
158 int type; 158 int type;
159 int save_type;
160 int references; 159 int references;
161 const EVP_PKEY_ASN1_METHOD *ameth; 160 const EVP_PKEY_ASN1_METHOD *ameth;
162 union { 161 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 @@
1/* $OpenBSD: p_lib.c,v 1.51 2023/12/29 10:59:00 tb Exp $ */ 1/* $OpenBSD: p_lib.c,v 1.52 2024/01/01 15:23:00 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -389,7 +389,6 @@ EVP_PKEY_new(void)
389 } 389 }
390 390
391 pkey->type = EVP_PKEY_NONE; 391 pkey->type = EVP_PKEY_NONE;
392 pkey->save_type = EVP_PKEY_NONE;
393 pkey->references = 1; 392 pkey->references = 1;
394 pkey->save_parameters = 1; 393 pkey->save_parameters = 1;
395 394
@@ -440,7 +439,6 @@ EVP_PKEY_set_type(EVP_PKEY *pkey, int type)
440 if (pkey != NULL) { 439 if (pkey != NULL) {
441 pkey->ameth = ameth; 440 pkey->ameth = ameth;
442 pkey->type = pkey->ameth->pkey_id; 441 pkey->type = pkey->ameth->pkey_id;
443 pkey->save_type = type;
444 } 442 }
445 443
446 return 1; 444 return 1;
@@ -460,7 +458,6 @@ EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len)
460 if (pkey != NULL) { 458 if (pkey != NULL) {
461 pkey->ameth = ameth; 459 pkey->ameth = ameth;
462 pkey->type = pkey->ameth->pkey_id; 460 pkey->type = pkey->ameth->pkey_id;
463 pkey->save_type = EVP_PKEY_NONE;
464 } 461 }
465 462
466 return 1; 463 return 1;