diff options
| author | tb <> | 2024-01-04 17:01:26 +0000 |
|---|---|---|
| committer | tb <> | 2024-01-04 17:01:26 +0000 |
| commit | 9f1cd2582409ac5778c5a0e28dfb77f18d122c98 (patch) | |
| tree | 352dd8b119595c9dcef2c0b2739e1e98f14a4676 /src/lib/libcrypto/dh | |
| parent | 7054693affbb29c6d4c57fe0291eb64b4748ce17 (diff) | |
| download | openbsd-9f1cd2582409ac5778c5a0e28dfb77f18d122c98.tar.gz openbsd-9f1cd2582409ac5778c5a0e28dfb77f18d122c98.tar.bz2 openbsd-9f1cd2582409ac5778c5a0e28dfb77f18d122c98.zip | |
Replace .pkey_base_id with a .base_method pointer
Every EVP_PKEY_ASN1_METHOD is either an ASN.1 method or an alias.
As such it resolves to an underlying ASN.1 method (in one step).
This information can be stored in a base_method pointer in allusion
to the pkey_base_id, which is the name for the nid (aka pkey_id aka
type) of the underlying method.
For an ASN.1 method, the base method is itself, so the base method
is set as a pointer to itself. For an alias it is of course a pointer
to the underlying method. Then obviously ameth->pkey_base_id is the
same as ameth->base_method->pkey_id, so rework all ASN.1 methods to
follow that.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/dh')
| -rw-r--r-- | src/lib/libcrypto/dh/dh_ameth.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/dh/dh_ameth.c b/src/lib/libcrypto/dh/dh_ameth.c index 43beb469f2..d51a5bea4c 100644 --- a/src/lib/libcrypto/dh/dh_ameth.c +++ b/src/lib/libcrypto/dh/dh_ameth.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: dh_ameth.c,v 1.39 2023/08/12 07:59:48 tb Exp $ */ | 1 | /* $OpenBSD: dh_ameth.c,v 1.40 2024/01/04 17:01:26 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 2006. | 3 | * project 2006. |
| 4 | */ | 4 | */ |
| @@ -523,8 +523,8 @@ dh_pkey_param_check(const EVP_PKEY *pkey) | |||
| 523 | } | 523 | } |
| 524 | 524 | ||
| 525 | const EVP_PKEY_ASN1_METHOD dh_asn1_meth = { | 525 | const EVP_PKEY_ASN1_METHOD dh_asn1_meth = { |
| 526 | .base_method = &dh_asn1_meth, | ||
| 526 | .pkey_id = EVP_PKEY_DH, | 527 | .pkey_id = EVP_PKEY_DH, |
| 527 | .pkey_base_id = EVP_PKEY_DH, | ||
| 528 | 528 | ||
| 529 | .pem_str = "DH", | 529 | .pem_str = "DH", |
| 530 | .info = "OpenSSL PKCS#3 DH method", | 530 | .info = "OpenSSL PKCS#3 DH method", |
