diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2019-03-24 10:11:42 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-03-28 11:17:38 +0100 |
commit | a3c62426b9c056af802ab7988f217e55eaf2b213 (patch) | |
tree | 3658410aaeab2a665f5f4552d5d62f30e475762e /crypto/kdf | |
parent | Add some checks of OCSP functions (diff) | |
download | openssl-a3c62426b9c056af802ab7988f217e55eaf2b213.tar.xz openssl-a3c62426b9c056af802ab7988f217e55eaf2b213.zip |
coverity fixes for SSKDF + mac_app + kdf test cleanup
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8566)
Diffstat (limited to 'crypto/kdf')
-rw-r--r-- | crypto/kdf/sskdf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/kdf/sskdf.c b/crypto/kdf/sskdf.c index 935428f77f..89e4e5b484 100644 --- a/crypto/kdf/sskdf.c +++ b/crypto/kdf/sskdf.c @@ -247,10 +247,13 @@ static int SSKDF_mac_kdm(const EVP_MAC *kdf_mac, const EVP_MD *hmac_md, } ret = 1; end: - OPENSSL_free(kmac_buffer); + if (kmac_buffer != NULL) + OPENSSL_clear_free(kmac_buffer, kmac_out_len); + else + OPENSSL_cleanse(mac_buf, sizeof(mac_buf)); + EVP_MAC_CTX_free(ctx); EVP_MAC_CTX_free(ctx_init); - OPENSSL_cleanse(mac, sizeof(mac)); return ret; } |