From: Dr. Stephen Henson Date: Tue, 6 Dec 2016 00:54:19 +0000 (+0000) Subject: Return errors PKCS#7/CMS enveloped data ctrls and PSS X-Git-Tag: OpenSSL_1_1_1-pre1~2767 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=186e48cd1bdb3b75b76b5e73c3c9502e46d17197;p=oweals%2Fopenssl.git Return errors PKCS#7/CMS enveloped data ctrls and PSS 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 10cd4428cf..b3672bc9d9 100644 --- a/crypto/rsa/rsa_pmeth.c +++ b/crypto/rsa/rsa_pmeth.c @@ -526,14 +526,18 @@ static int pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) return rctx->oaep_labellen; case EVP_PKEY_CTRL_DIGESTINIT: + case EVP_PKEY_CTRL_PKCS7_SIGN: +#ifndef OPENSSL_NO_CMS + case EVP_PKEY_CTRL_CMS_SIGN: +#endif + return 1; + case EVP_PKEY_CTRL_PKCS7_ENCRYPT: case EVP_PKEY_CTRL_PKCS7_DECRYPT: - case EVP_PKEY_CTRL_PKCS7_SIGN: - return 1; #ifndef OPENSSL_NO_CMS case EVP_PKEY_CTRL_CMS_DECRYPT: case EVP_PKEY_CTRL_CMS_ENCRYPT: - case EVP_PKEY_CTRL_CMS_SIGN: + if (!pkey_ctx_is_pss(ctx)) return 1; #endif case EVP_PKEY_CTRL_PEER_KEY: