Set PSS padding mode for PSS keys.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2177)
This commit is contained in:
Dr. Stephen Henson 2016-11-30 16:23:18 +00:00
parent 410877bad2
commit ad4b3d0a65

View File

@ -49,7 +49,10 @@ static int pkey_rsa_init(EVP_PKEY_CTX *ctx)
if (rctx == NULL)
return 0;
rctx->nbits = 1024;
rctx->pad_mode = RSA_PKCS1_PADDING;
if (ctx->pmeth->pkey_id == EVP_PKEY_RSA_PSS)
rctx->pad_mode = RSA_PKCS1_PSS_PADDING;
else
rctx->pad_mode = RSA_PKCS1_PADDING;
rctx->saltlen = -2;
ctx->data = rctx;
ctx->keygen_info = rctx->gentmp;