Latest update.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
LIBS=../../../libcrypto
|
||||
SOURCE[../../../libcrypto]=rsa_enc.c
|
||||
# We make separate GOAL variables for each algorithm, to make it easy to
|
||||
# switch each to the Legacy provider when needed.
|
||||
|
||||
$RSA_GOAL=../../libimplementations.a
|
||||
|
||||
SOURCE[$RSA_GOAL]=rsa_enc.c
|
||||
@@ -118,6 +118,12 @@ static int rsa_encrypt(void *vprsactx, unsigned char *out, size_t *outlen,
|
||||
PROVerr(0, ERR_R_MALLOC_FAILURE);
|
||||
return 0;
|
||||
}
|
||||
if (prsactx->oaep_md == NULL) {
|
||||
OPENSSL_free(tbuf);
|
||||
prsactx->oaep_md = EVP_MD_fetch(prsactx->libctx, "SHA-1", NULL);
|
||||
PROVerr(0, ERR_R_INTERNAL_ERROR);
|
||||
return 0;
|
||||
}
|
||||
ret = RSA_padding_add_PKCS1_OAEP_mgf1(tbuf, rsasize, in, inlen,
|
||||
prsactx->oaep_label,
|
||||
prsactx->oaep_labellen,
|
||||
@@ -194,6 +200,13 @@ static int rsa_decrypt(void *vprsactx, unsigned char *out, size_t *outlen,
|
||||
return 0;
|
||||
}
|
||||
if (prsactx->pad_mode == RSA_PKCS1_OAEP_PADDING) {
|
||||
if (prsactx->oaep_md == NULL) {
|
||||
prsactx->oaep_md = EVP_MD_fetch(prsactx->libctx, "SHA-1", NULL);
|
||||
if (prsactx->oaep_md == NULL) {
|
||||
PROVerr(0, ERR_R_INTERNAL_ERROR);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
ret = RSA_padding_check_PKCS1_OAEP_mgf1(out, outsize, tbuf,
|
||||
len, len,
|
||||
prsactx->oaep_label,
|
||||
|
||||
Reference in New Issue
Block a user