summaryrefslogtreecommitdiffstats
path: root/crypto/kdf
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2019-03-24 19:11:42 +1000
committerMatt Caswell <matt@openssl.org>2019-03-28 10:17:38 +0000
commita3c62426b9c056af802ab7988f217e55eaf2b213 (patch)
tree3658410aaeab2a665f5f4552d5d62f30e475762e /crypto/kdf
parent72b89b8e201d17dea0219b4b92df7af7e17f183a (diff)
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.c7
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;
}