Skip to contentSkip to conversation

crypto: testmgr - move pkcs1pad(rsa,sha3-*) to correct place

PATCH In review Eric Biggers 2 participants 2 messages Oct 27, 2023 – Oct 31, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: testmgr - move pkcs1pad(rsa,sha3-*) to correct place

From: Eric Biggers <[email protected]>

alg_test_descs[] needs to be in sorted order, since it is used for binary search. This fixes the following boot-time warning:

testmgr: alg_test_descs entries in wrong order: 'pkcs1pad(rsa,sha512)' before 'pkcs1pad(rsa,sha3-256)'

Fixes ee62afb9d02d ("crypto: rsa-pkcs1pad - Add FIPS 202 SHA-3 support")
---
 crypto/testmgr.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
crypto/testmgr.c +5 -5
index 1dc93bf608d4..15c7a3011269 100644
@@ -5450,37 +5450,37 @@ static const struct alg_test_desc alg_test_descs[] = {
 		.test = alg_test_null,
 		.fips_allowed = 1,
 	}, {
 		.alg = "pkcs1pad(rsa,sha256)",
 		.test = alg_test_akcipher,
 		.fips_allowed = 1,
 		.suite = {
 			.akcipher = __VECS(pkcs1pad_rsa_tv_template)
 		}
 	}, {
-		.alg = "pkcs1pad(rsa,sha384)",
+		.alg = "pkcs1pad(rsa,sha3-256)",
 		.test = alg_test_null,
 		.fips_allowed = 1,
 	}, {
-		.alg = "pkcs1pad(rsa,sha512)",
+		.alg = "pkcs1pad(rsa,sha3-384)",
 		.test = alg_test_null,
 		.fips_allowed = 1,
 	}, {
-		.alg = "pkcs1pad(rsa,sha3-256)",
+		.alg = "pkcs1pad(rsa,sha3-512)",
 		.test = alg_test_null,
 		.fips_allowed = 1,
 	}, {
-		.alg = "pkcs1pad(rsa,sha3-384)",
+		.alg = "pkcs1pad(rsa,sha384)",
 		.test = alg_test_null,
 		.fips_allowed = 1,
 	}, {
-		.alg = "pkcs1pad(rsa,sha3-512)",
+		.alg = "pkcs1pad(rsa,sha512)",
 		.test = alg_test_null,
 		.fips_allowed = 1,
 	}, {
 		.alg = "poly1305",
 		.test = alg_test_hash,
 		.suite = {
 			.hash = __VECS(poly1305_tv_template)
 		}
 	}, {
 		.alg = "polyval",

base-commit: f2b88bab69c86d4dab2bfd25a0e741d7df411f7a

Signature · 1 line
2.42.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · On Fri, 27 Oct 2023, 22:52 Eric Biggers, <[email protected]> wrote:

From: Eric Biggers <[email protected]>

alg_test_descs[] needs to be in sorted order, since it is used for binary search. This fixes the following boot-time warning:

testmgr: alg_test_descs entries in wrong order: 'pkcs1pad(rsa,sha512)' before 'pkcs1pad(rsa,sha3-256)'

Fixes ee62afb9d02d ("crypto: rsa-pkcs1pad - Add FIPS 202 SHA-3 support")

Noted, and will check for this in the future. I didn't know that order matters.

Quoted 56 lines
---
 crypto/testmgr.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
crypto/testmgr.c +5 -5
index 1dc93bf608d4..15c7a3011269 100644
@@ -5450,37 +5450,37 @@ static const struct alg_test_desc alg_test_descs[] = {
                .test = alg_test_null,
                .fips_allowed = 1,
        }, {
                .alg = "pkcs1pad(rsa,sha256)",
                .test = alg_test_akcipher,
                .fips_allowed = 1,
                .suite = {
                        .akcipher = __VECS(pkcs1pad_rsa_tv_template)
                }
        }, {
-               .alg = "pkcs1pad(rsa,sha384)",
+               .alg = "pkcs1pad(rsa,sha3-256)",
                .test = alg_test_null,
                .fips_allowed = 1,
        }, {
-               .alg = "pkcs1pad(rsa,sha512)",
+               .alg = "pkcs1pad(rsa,sha3-384)",
                .test = alg_test_null,
                .fips_allowed = 1,
        }, {
-               .alg = "pkcs1pad(rsa,sha3-256)",
+               .alg = "pkcs1pad(rsa,sha3-512)",
                .test = alg_test_null,
                .fips_allowed = 1,
        }, {
-               .alg = "pkcs1pad(rsa,sha3-384)",
+               .alg = "pkcs1pad(rsa,sha384)",
                .test = alg_test_null,
                .fips_allowed = 1,
        }, {
-               .alg = "pkcs1pad(rsa,sha3-512)",
+               .alg = "pkcs1pad(rsa,sha512)",
                .test = alg_test_null,
                .fips_allowed = 1,
        }, {
                .alg = "poly1305",
                .test = alg_test_hash,
                .suite = {
                        .hash = __VECS(poly1305_tv_template)
                }
        }, {
                .alg = "polyval",

base-commit: f2b88bab69c86d4dab2bfd25a0e741d7df411f7a --
2.42.0