pkey_gost_mac_keygen: check for NULL after allocating keydata
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
787e992965
commit
0716f9e405
@ -562,6 +562,8 @@ static int pkey_gost_mac_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
keydata = OPENSSL_malloc(32);
|
keydata = OPENSSL_malloc(32);
|
||||||
|
if (keydata == NULL)
|
||||||
|
return 0;
|
||||||
memcpy(keydata,data->key,32);
|
memcpy(keydata,data->key,32);
|
||||||
EVP_PKEY_assign(pkey, NID_id_Gost28147_89_MAC, keydata);
|
EVP_PKEY_assign(pkey, NID_id_Gost28147_89_MAC, keydata);
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user