From: Dr. Stephen Henson Date: Wed, 30 Nov 2016 16:23:18 +0000 (+0000) Subject: Set PSS padding mode for PSS keys. X-Git-Tag: OpenSSL_1_1_1-pre1~2775 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ad4b3d0a658a2f5e4028714109d347c2b105dae4;p=oweals%2Fopenssl.git Set PSS padding mode for PSS keys. Reviewed-by: Rich Salz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/2177) --- diff --git a/crypto/rsa/rsa_pmeth.c b/crypto/rsa/rsa_pmeth.c index 93202815c4..e720a0b2a3 100644 --- a/crypto/rsa/rsa_pmeth.c +++ b/crypto/rsa/rsa_pmeth.c @@ -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;