summaryrefslogtreecommitdiffstats
path: root/crypto/kdf/tls1_prf.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/kdf/tls1_prf.c')
-rw-r--r--crypto/kdf/tls1_prf.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/kdf/tls1_prf.c b/crypto/kdf/tls1_prf.c
index f5b2334a58..49f7ecced9 100644
--- a/crypto/kdf/tls1_prf.c
+++ b/crypto/kdf/tls1_prf.c
@@ -37,9 +37,10 @@ static int pkey_tls1_prf_init(EVP_PKEY_CTX *ctx)
{
TLS1_PRF_PKEY_CTX *kctx;
- kctx = OPENSSL_zalloc(sizeof(*kctx));
- if (kctx == NULL)
+ if ((kctx = OPENSSL_zalloc(sizeof(*kctx))) == NULL) {
+ KDFerr(KDF_F_PKEY_TLS1_PRF_INIT, ERR_R_MALLOC_FAILURE);
return 0;
+ }
ctx->data = kctx;
return 1;
@@ -256,9 +257,10 @@ static int tls1_prf_alg(const EVP_MD *md,
seed, seed_len, out, olen))
return 0;
- tmp = OPENSSL_malloc(olen);
- if (tmp == NULL)
+ if ((tmp = OPENSSL_malloc(olen)) == NULL) {
+ KDFerr(KDF_F_TLS1_PRF_ALG, ERR_R_MALLOC_FAILURE);
return 0;
+ }
if (!tls1_prf_P_hash(EVP_sha1(), sec + slen/2, slen/2 + (slen & 1),
seed, seed_len, tmp, olen)) {
OPENSSL_clear_free(tmp, olen);