summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2025-01-17 15:39:19 +0000
committertb <>2025-01-17 15:39:19 +0000
commit0ed18cf1c50e6c6067e10eb7cdea0c2d008bb2db (patch)
tree99395b779ef6a5ca76a2a90d27270dcf1709d64e
parent43e4fc1810c2b37f526c64cd274aed4f96eae01e (diff)
downloadopenbsd-0ed18cf1c50e6c6067e10eb7cdea0c2d008bb2db.tar.gz
openbsd-0ed18cf1c50e6c6067e10eb7cdea0c2d008bb2db.tar.bz2
openbsd-0ed18cf1c50e6c6067e10eb7cdea0c2d008bb2db.zip
rsa_pmeth: unify strcmp return checks
ok jsing
-rw-r--r--src/lib/libcrypto/rsa/rsa_pmeth.c22
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 /*