提交 bc1ea030 编写于 作者: D Dr. Stephen Henson

Use more desciptive macro name rsa_pss_restricted()

Reviewed-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NMatt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2177)
上级 b6b885c6
......@@ -45,7 +45,7 @@ typedef struct {
} RSA_PKEY_CTX;
/* True if PSS parameters are restricted */
#define rsa_pss_param(rctx) (rctx->min_saltlen != -1)
#define rsa_pss_restricted(rctx) (rctx->min_saltlen != -1)
static int pkey_rsa_init(EVP_PKEY_CTX *ctx)
{
......@@ -431,7 +431,7 @@ static int pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
} else {
if (p1 < -2)
return -2;
if (rsa_pss_param(rctx) && p1 < rctx->min_saltlen) {
if (rsa_pss_restricted(rctx) && p1 < rctx->min_saltlen) {
RSAerr(RSA_F_PKEY_RSA_CTRL, RSA_R_PSS_SALTLEN_TOO_SMALL);
return 0;
}
......@@ -471,7 +471,7 @@ static int pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
case EVP_PKEY_CTRL_MD:
if (!check_padding_md(p2, rctx->pad_mode))
return 0;
if (rsa_pss_param(rctx)) {
if (rsa_pss_restricted(rctx)) {
if (EVP_MD_type(rctx->md) == EVP_MD_type(p2))
return 1;
RSAerr(RSA_F_PKEY_RSA_CTRL, RSA_R_DIGEST_NOT_ALLOWED);
......@@ -497,7 +497,7 @@ static int pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
else
*(const EVP_MD **)p2 = rctx->md;
} else {
if (rsa_pss_param(rctx)) {
if (rsa_pss_restricted(rctx)) {
if (EVP_MD_type(rctx->md) == EVP_MD_type(p2))
return 1;
RSAerr(RSA_F_PKEY_RSA_CTRL, RSA_R_MGF1_DIGEST_NOT_ALLOWED);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册