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/dsa | |
| 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/dsa')
| -rw-r--r-- | src/lib/libcrypto/dsa/dsa_ameth.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_ameth.c b/src/lib/libcrypto/dsa/dsa_ameth.c index d4cce72fcb..f9b6a9e7d3 100644 --- a/src/lib/libcrypto/dsa/dsa_ameth.c +++ b/src/lib/libcrypto/dsa/dsa_ameth.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: dsa_ameth.c,v 1.56 2024/01/04 16:41:56 tb Exp $ */ | 1 | /* $OpenBSD: dsa_ameth.c,v 1.57 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 | */ |
| @@ -675,8 +675,8 @@ dsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) | |||
| 675 | } | 675 | } |
| 676 | 676 | ||
| 677 | const EVP_PKEY_ASN1_METHOD dsa_asn1_meth = { | 677 | const EVP_PKEY_ASN1_METHOD dsa_asn1_meth = { |
| 678 | .base_method = &dsa_asn1_meth, | ||
| 678 | .pkey_id = EVP_PKEY_DSA, | 679 | .pkey_id = EVP_PKEY_DSA, |
| 679 | .pkey_base_id = EVP_PKEY_DSA, | ||
| 680 | 680 | ||
| 681 | .pem_str = "DSA", | 681 | .pem_str = "DSA", |
| 682 | .info = "OpenSSL DSA method", | 682 | .info = "OpenSSL DSA method", |
| @@ -709,25 +709,25 @@ const EVP_PKEY_ASN1_METHOD dsa_asn1_meth = { | |||
| 709 | }; | 709 | }; |
| 710 | 710 | ||
| 711 | const EVP_PKEY_ASN1_METHOD dsa1_asn1_meth = { | 711 | const EVP_PKEY_ASN1_METHOD dsa1_asn1_meth = { |
| 712 | .base_method = &dsa_asn1_meth, | ||
| 712 | .pkey_id = EVP_PKEY_DSA1, | 713 | .pkey_id = EVP_PKEY_DSA1, |
| 713 | .pkey_base_id = EVP_PKEY_DSA, | ||
| 714 | .pkey_flags = ASN1_PKEY_ALIAS, | 714 | .pkey_flags = ASN1_PKEY_ALIAS, |
| 715 | }; | 715 | }; |
| 716 | 716 | ||
| 717 | const EVP_PKEY_ASN1_METHOD dsa2_asn1_meth = { | 717 | const EVP_PKEY_ASN1_METHOD dsa2_asn1_meth = { |
| 718 | .base_method = &dsa_asn1_meth, | ||
| 718 | .pkey_id = EVP_PKEY_DSA2, | 719 | .pkey_id = EVP_PKEY_DSA2, |
| 719 | .pkey_base_id = EVP_PKEY_DSA, | ||
| 720 | .pkey_flags = ASN1_PKEY_ALIAS, | 720 | .pkey_flags = ASN1_PKEY_ALIAS, |
| 721 | }; | 721 | }; |
| 722 | 722 | ||
| 723 | const EVP_PKEY_ASN1_METHOD dsa3_asn1_meth = { | 723 | const EVP_PKEY_ASN1_METHOD dsa3_asn1_meth = { |
| 724 | .base_method = &dsa_asn1_meth, | ||
| 724 | .pkey_id = EVP_PKEY_DSA3, | 725 | .pkey_id = EVP_PKEY_DSA3, |
| 725 | .pkey_base_id = EVP_PKEY_DSA, | ||
| 726 | .pkey_flags = ASN1_PKEY_ALIAS, | 726 | .pkey_flags = ASN1_PKEY_ALIAS, |
| 727 | }; | 727 | }; |
| 728 | 728 | ||
| 729 | const EVP_PKEY_ASN1_METHOD dsa4_asn1_meth = { | 729 | const EVP_PKEY_ASN1_METHOD dsa4_asn1_meth = { |
| 730 | .base_method = &dsa_asn1_meth, | ||
| 730 | .pkey_id = EVP_PKEY_DSA4, | 731 | .pkey_id = EVP_PKEY_DSA4, |
| 731 | .pkey_base_id = EVP_PKEY_DSA, | ||
| 732 | .pkey_flags = ASN1_PKEY_ALIAS, | 732 | .pkey_flags = ASN1_PKEY_ALIAS, |
| 733 | }; | 733 | }; |
