diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/hmac/hm_ameth.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/lib/libcrypto/hmac/hm_ameth.c b/src/lib/libcrypto/hmac/hm_ameth.c index dfd7169ba0..5b52af658c 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.17 2022/11/19 04:32:49 tb Exp $ */ | 1 | /* $OpenBSD: hm_ameth.c,v 1.18 2022/11/19 04:36:52 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 | */ |
| @@ -84,13 +84,15 @@ hmac_size(const EVP_PKEY *pkey) | |||
| 84 | static void | 84 | static void |
| 85 | hmac_key_free(EVP_PKEY *pkey) | 85 | hmac_key_free(EVP_PKEY *pkey) |
| 86 | { | 86 | { |
| 87 | ASN1_OCTET_STRING *os = pkey->pkey.ptr; | 87 | ASN1_OCTET_STRING *os; |
| 88 | 88 | ||
| 89 | if (os) { | 89 | if ((os = pkey->pkey.ptr) == NULL) |
| 90 | if (os->data) | 90 | return; |
| 91 | explicit_bzero(os->data, os->length); | 91 | |
| 92 | ASN1_OCTET_STRING_free(os); | 92 | if (os->data != NULL) |
| 93 | } | 93 | explicit_bzero(os->data, os->length); |
| 94 | |||
| 95 | ASN1_OCTET_STRING_free(os); | ||
| 94 | } | 96 | } |
| 95 | 97 | ||
| 96 | static int | 98 | static int |
