mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
If oaep_md is not initialized, correctly initialize it
Fixes #20993 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20994)
This commit is contained in:
parent
ab17dd8fa3
commit
c5aa719502
@ -162,10 +162,12 @@ static int rsa_encrypt(void *vprsactx, unsigned char *out, size_t *outlen,
|
||||
if ((tbuf = OPENSSL_malloc(rsasize)) == NULL)
|
||||
return 0;
|
||||
if (prsactx->oaep_md == NULL) {
|
||||
OPENSSL_free(tbuf);
|
||||
prsactx->oaep_md = EVP_MD_fetch(prsactx->libctx, "SHA-1", NULL);
|
||||
ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
|
||||
return 0;
|
||||
if (prsactx->oaep_md == NULL) {
|
||||
OPENSSL_free(tbuf);
|
||||
ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
ret =
|
||||
ossl_rsa_padding_add_PKCS1_OAEP_mgf1_ex(prsactx->libctx, tbuf,
|
||||
|
Loading…
Reference in New Issue
Block a user