diff options
| author | tb <> | 2025-01-17 15:39:19 +0000 |
|---|---|---|
| committer | tb <> | 2025-01-17 15:39:19 +0000 |
| commit | 13bb4d5ac808eefe3abb437533ddc959dfeeceee (patch) | |
| tree | 99395b779ef6a5ca76a2a90d27270dcf1709d64e /src | |
| parent | 071781692607cb832d536eb95653e83fd533cb88 (diff) | |
| download | openbsd-13bb4d5ac808eefe3abb437533ddc959dfeeceee.tar.gz openbsd-13bb4d5ac808eefe3abb437533ddc959dfeeceee.tar.bz2 openbsd-13bb4d5ac808eefe3abb437533ddc959dfeeceee.zip | |
rsa_pmeth: unify strcmp return checks
ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/rsa/rsa_pmeth.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_pmeth.c b/src/lib/libcrypto/rsa/rsa_pmeth.c index b4e0448ef2..453570cf74 100644 --- a/src/lib/libcrypto/rsa/rsa_pmeth.c +++ b/src/lib/libcrypto/rsa/rsa_pmeth.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rsa_pmeth.c,v 1.42 2025/01/17 08:50:07 tb Exp $ */ | 1 | /* $OpenBSD: rsa_pmeth.c,v 1.43 2025/01/17 15:39:19 tb Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project 2006. | 3 | * project 2006. |
| 4 | */ | 4 | */ |
| @@ -637,19 +637,17 @@ pkey_rsa_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, const char *value) | |||
| 637 | RSAerror(RSA_R_VALUE_MISSING); | 637 | RSAerror(RSA_R_VALUE_MISSING); |
| 638 | return 0; | 638 | return 0; |
| 639 | } | 639 | } |
| 640 | if (!strcmp(type, "rsa_padding_mode")) { | 640 | if (strcmp(type, "rsa_padding_mode") == 0) { |
| 641 | int pm; | 641 | int pm; |
| 642 | if (!strcmp(value, "pkcs1")) | 642 | if (strcmp(value, "pkcs1") == 0) |
| 643 | pm = RSA_PKCS1_PADDING; | 643 | pm = RSA_PKCS1_PADDING; |
| 644 | else if (!strcmp(value, "none")) | 644 | else if (strcmp(value, "none") == 0) |
| 645 | pm = RSA_NO_PADDING; | 645 | pm = RSA_NO_PADDING; |
| 646 | else if (!strcmp(value, "oeap")) | 646 | else if (strcmp(value, "oaep") == 0 || strcmp(value, "oeap") == 0) |
| 647 | pm = RSA_PKCS1_OAEP_PADDING; | 647 | pm = RSA_PKCS1_OAEP_PADDING; |
| 648 | else if (!strcmp(value, "oaep")) | 648 | else if (strcmp(value, "x931") == 0) |
| 649 | pm = RSA_PKCS1_OAEP_PADDING; | ||
| 650 | else if (!strcmp(value, "x931")) | ||
| 651 | pm = RSA_X931_PADDING; | 649 | pm = RSA_X931_PADDING; |
| 652 | else if (!strcmp(value, "pss")) | 650 | else if (strcmp(value, "pss") == 0) |
| 653 | pm = RSA_PKCS1_PSS_PADDING; | 651 | pm = RSA_PKCS1_PSS_PADDING; |
| 654 | else { | 652 | else { |
| 655 | RSAerror(RSA_R_UNKNOWN_PADDING_TYPE); | 653 | RSAerror(RSA_R_UNKNOWN_PADDING_TYPE); |
| @@ -661,11 +659,11 @@ pkey_rsa_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, const char *value) | |||
| 661 | if (strcmp(type, "rsa_pss_saltlen") == 0) { | 659 | if (strcmp(type, "rsa_pss_saltlen") == 0) { |
| 662 | int saltlen; | 660 | int saltlen; |
| 663 | 661 | ||
| 664 | if (!strcmp(value, "digest")) | 662 | if (strcmp(value, "digest") == 0) |
| 665 | saltlen = RSA_PSS_SALTLEN_DIGEST; | 663 | saltlen = RSA_PSS_SALTLEN_DIGEST; |
| 666 | else if (!strcmp(value, "max")) | 664 | else if (strcmp(value, "max") == 0) |
| 667 | saltlen = RSA_PSS_SALTLEN_MAX; | 665 | saltlen = RSA_PSS_SALTLEN_MAX; |
| 668 | else if (!strcmp(value, "auto")) | 666 | else if (strcmp(value, "auto") == 0) |
| 669 | saltlen = RSA_PSS_SALTLEN_AUTO; | 667 | saltlen = RSA_PSS_SALTLEN_AUTO; |
| 670 | else { | 668 | else { |
| 671 | /* | 669 | /* |
