From 3ceb42d62047d438cd7b6b6a201682452faf30fc Mon Sep 17 00:00:00 2001 From: tb <> Date: Fri, 18 Nov 2022 14:45:10 +0000 Subject: Change the pkey.ptr from char * to void * Now that EVP_PKEY is opaque, there is no reason to keep the ptr member of the pkey union as a weird char pointer, a void pointer will do. This avoids a few stupid casts and simplifies an upcoming diff. ok jsing --- src/lib/libcrypto/cmac/cm_ameth.c | 6 ++---- src/lib/libcrypto/cmac/cm_pmeth.c | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src/lib/libcrypto/cmac') diff --git a/src/lib/libcrypto/cmac/cm_ameth.c b/src/lib/libcrypto/cmac/cm_ameth.c index 26956465ee..1bc20082c1 100644 --- a/src/lib/libcrypto/cmac/cm_ameth.c +++ b/src/lib/libcrypto/cmac/cm_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cm_ameth.c,v 1.8 2021/12/12 21:30:13 tb Exp $ */ +/* $OpenBSD: cm_ameth.c,v 1.9 2022/11/18 14:45:10 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2010. */ @@ -73,9 +73,7 @@ cmac_size(const EVP_PKEY *pkey) static void cmac_key_free(EVP_PKEY *pkey) { - CMAC_CTX *cmctx = (CMAC_CTX *)pkey->pkey.ptr; - - CMAC_CTX_free(cmctx); + CMAC_CTX_free(pkey->pkey.ptr); } const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = { diff --git a/src/lib/libcrypto/cmac/cm_pmeth.c b/src/lib/libcrypto/cmac/cm_pmeth.c index d9059ca4a8..91f7e34c29 100644 --- a/src/lib/libcrypto/cmac/cm_pmeth.c +++ b/src/lib/libcrypto/cmac/cm_pmeth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cm_pmeth.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */ +/* $OpenBSD: cm_pmeth.c,v 1.9 2022/11/18 14:45:10 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2010. */ @@ -148,8 +148,7 @@ pkey_cmac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) break; case EVP_PKEY_CTRL_MD: - if (ctx->pkey && !CMAC_CTX_copy(ctx->data, - (CMAC_CTX *)ctx->pkey->pkey.ptr)) + if (ctx->pkey && !CMAC_CTX_copy(ctx->data, ctx->pkey->pkey.ptr)) return 0; if (!CMAC_Init(cmctx, NULL, 0, NULL, NULL)) return 0; -- cgit v1.2.3-55-g6feb