diff options
author | Doug Hogan <[email protected]> | 2019-01-04 01:22:37 -0800 |
---|---|---|
committer | Doug Hogan <[email protected]> | 2019-01-08 01:11:58 -0800 |
commit | 83fc1366cfd005b3fb8ce18e40af83f5f6f2818f (patch) | |
tree | 98e1b71dfc2a31a47f9bf9dbda127344b12a949c /lib/crypto/c_src/evp_compat.h | |
parent | 9b1a6e47ce5989eac129100280279f50ccef6b46 (diff) | |
download | otp-83fc1366cfd005b3fb8ce18e40af83f5f6f2818f.tar.gz otp-83fc1366cfd005b3fb8ce18e40af83f5f6f2818f.tar.bz2 otp-83fc1366cfd005b3fb8ce18e40af83f5f6f2818f.zip |
Revamp evp_compat HMAC_CTX_new()
* Add error handling for OpenSSL call.
Diffstat (limited to 'lib/crypto/c_src/evp_compat.h')
-rw-r--r-- | lib/crypto/c_src/evp_compat.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/crypto/c_src/evp_compat.h b/lib/crypto/c_src/evp_compat.h index 98c861c45e..c81d1e35ee 100644 --- a/lib/crypto/c_src/evp_compat.h +++ b/lib/crypto/c_src/evp_compat.h @@ -37,7 +37,11 @@ static INLINE void HMAC_CTX_free(HMAC_CTX *ctx); static INLINE HMAC_CTX *HMAC_CTX_new() { - HMAC_CTX *ctx = CRYPTO_malloc(sizeof(HMAC_CTX), __FILE__, __LINE__); + HMAC_CTX *ctx; + + if ((ctx = CRYPTO_malloc(sizeof(HMAC_CTX), __FILE__, __LINE__)) == NULL) + return NULL; + HMAC_CTX_init(ctx); return ctx; } |