diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-11-30 16:23:18 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2017-01-08 01:42:47 +0000 |
commit | ad4b3d0a658a2f5e4028714109d347c2b105dae4 (patch) | |
tree | 4b2cbaa34aa506a7a1fe301092977c8791edfc2f /crypto/rsa | |
parent | 410877bad2445796890831d883105cdb982a2d82 (diff) |
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)
Diffstat (limited to 'crypto/rsa')
-rw-r--r-- | crypto/rsa/rsa_pmeth.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |