diff options
| author | tb <> | 2022-11-18 14:45:10 +0000 |
|---|---|---|
| committer | tb <> | 2022-11-18 14:45:10 +0000 |
| commit | 3ceb42d62047d438cd7b6b6a201682452faf30fc (patch) | |
| tree | 48e2b4585e54a8205c6dbeb0131ead3e7cfc4d15 /src/lib/libcrypto/cmac | |
| parent | 41d386b23bbf3c918e8a2e1e6b980bad1bce714d (diff) | |
| download | openbsd-3ceb42d62047d438cd7b6b6a201682452faf30fc.tar.gz openbsd-3ceb42d62047d438cd7b6b6a201682452faf30fc.tar.bz2 openbsd-3ceb42d62047d438cd7b6b6a201682452faf30fc.zip | |
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
Diffstat (limited to 'src/lib/libcrypto/cmac')
| -rw-r--r-- | src/lib/libcrypto/cmac/cm_ameth.c | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/cmac/cm_pmeth.c | 5 |
2 files changed, 4 insertions, 7 deletions
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 @@ | |||
| 1 | /* $OpenBSD: cm_ameth.c,v 1.8 2021/12/12 21:30:13 tb Exp $ */ | 1 | /* $OpenBSD: cm_ameth.c,v 1.9 2022/11/18 14:45:10 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 2010. | 3 | * project 2010. |
| 4 | */ | 4 | */ |
| @@ -73,9 +73,7 @@ cmac_size(const EVP_PKEY *pkey) | |||
| 73 | static void | 73 | static void |
| 74 | cmac_key_free(EVP_PKEY *pkey) | 74 | cmac_key_free(EVP_PKEY *pkey) |
| 75 | { | 75 | { |
| 76 | CMAC_CTX *cmctx = (CMAC_CTX *)pkey->pkey.ptr; | 76 | CMAC_CTX_free(pkey->pkey.ptr); |
| 77 | |||
| 78 | CMAC_CTX_free(cmctx); | ||
| 79 | } | 77 | } |
| 80 | 78 | ||
| 81 | const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = { | 79 | 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 @@ | |||
| 1 | /* $OpenBSD: cm_pmeth.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */ | 1 | /* $OpenBSD: cm_pmeth.c,v 1.9 2022/11/18 14:45:10 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 2010. | 3 | * project 2010. |
| 4 | */ | 4 | */ |
| @@ -148,8 +148,7 @@ pkey_cmac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) | |||
| 148 | break; | 148 | break; |
| 149 | 149 | ||
| 150 | case EVP_PKEY_CTRL_MD: | 150 | case EVP_PKEY_CTRL_MD: |
| 151 | if (ctx->pkey && !CMAC_CTX_copy(ctx->data, | 151 | if (ctx->pkey && !CMAC_CTX_copy(ctx->data, ctx->pkey->pkey.ptr)) |
| 152 | (CMAC_CTX *)ctx->pkey->pkey.ptr)) | ||
| 153 | return 0; | 152 | return 0; |
| 154 | if (!CMAC_Init(cmctx, NULL, 0, NULL, NULL)) | 153 | if (!CMAC_Init(cmctx, NULL, 0, NULL, NULL)) |
| 155 | return 0; | 154 | return 0; |
