summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/hmac
diff options
context:
space:
mode:
authortb <>2024-01-04 17:01:26 +0000
committertb <>2024-01-04 17:01:26 +0000
commit28fd80a9189b82d0223c35153f8ed6f9cfb59161 (patch)
tree352dd8b119595c9dcef2c0b2739e1e98f14a4676 /src/lib/libcrypto/hmac
parent6ac39f8daa6e59d602f970b08d9bc152a63fd7a5 (diff)
downloadopenbsd-28fd80a9189b82d0223c35153f8ed6f9cfb59161.tar.gz
openbsd-28fd80a9189b82d0223c35153f8ed6f9cfb59161.tar.bz2
openbsd-28fd80a9189b82d0223c35153f8ed6f9cfb59161.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/hmac')
-rw-r--r--src/lib/libcrypto/hmac/hm_ameth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/hmac/hm_ameth.c b/src/lib/libcrypto/hmac/hm_ameth.c
index 7e6ad6d69e..8bb1dc786f 100644
--- a/src/lib/libcrypto/hmac/hm_ameth.c
+++ b/src/lib/libcrypto/hmac/hm_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hm_ameth.c,v 1.19 2022/11/26 16:08:53 tb Exp $ */ 1/* $OpenBSD: hm_ameth.c,v 1.20 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 2007. 3 * project 2007.
4 */ 4 */
@@ -153,8 +153,8 @@ hmac_get_priv_key(const EVP_PKEY *pkey, unsigned char *priv, size_t *len)
153} 153}
154 154
155const EVP_PKEY_ASN1_METHOD hmac_asn1_meth = { 155const EVP_PKEY_ASN1_METHOD hmac_asn1_meth = {
156 .base_method = &hmac_asn1_meth,
156 .pkey_id = EVP_PKEY_HMAC, 157 .pkey_id = EVP_PKEY_HMAC,
157 .pkey_base_id = EVP_PKEY_HMAC,
158 158
159 .pem_str = "HMAC", 159 .pem_str = "HMAC",
160 .info = "OpenSSL HMAC method", 160 .info = "OpenSSL HMAC method",