crypto: ecdh - fix ecdh-nist-p192's entry in testmgr
authorHui Tang <tanghui20@huawei.com>
Sat, 22 May 2021 02:44:28 +0000 (10:44 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 28 May 2021 07:11:47 +0000 (15:11 +0800)
Add a comment that p192 will fail to register in FIPS mode.

Fix ecdh-nist-p192's entry in testmgr by removing the ifdefs
and not setting fips_allowed.

Signed-off-by: Hui Tang <tanghui20@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/ecdh.c
crypto/testmgr.c
crypto/testmgr.h

index 07eb34fef25b74b223b01b31a889d4c90b09d139..1974675093239bc2edbd893a5db62c0353079f65 100644 (file)
@@ -179,6 +179,7 @@ static int ecdh_init(void)
 {
        int ret;
 
+       /* NIST p192 will fail to register in FIPS mode */
        ret = crypto_register_kpp(&ecdh_nist_p192);
        ecdh_nist_p192_registered = ret == 0;
 
index 10c5b3b01ec47c2e45a044f3ad8c4180004f8c5a..26e40dba9ad2951212bacc08c2a03d3b83545804 100644 (file)
@@ -4899,15 +4899,12 @@ static const struct alg_test_desc alg_test_descs[] = {
                }
        }, {
 #endif
-#ifndef CONFIG_CRYPTO_FIPS
                .alg = "ecdh-nist-p192",
                .test = alg_test_kpp,
-               .fips_allowed = 1,
                .suite = {
                        .kpp = __VECS(ecdh_p192_tv_template)
                }
        }, {
-#endif
                .alg = "ecdh-nist-p256",
                .test = alg_test_kpp,
                .fips_allowed = 1,
index aead75d904933c6b5260c709b74d2ce97b999cfa..b9cf5b815532a6d44d7f1658a970a6c848ae3d84 100644 (file)
@@ -2685,7 +2685,6 @@ static const struct kpp_testvec curve25519_tv_template[] = {
 }
 };
 
-#ifndef CONFIG_CRYPTO_FIPS
 static const struct kpp_testvec ecdh_p192_tv_template[] = {
        {
        .secret =
@@ -2725,7 +2724,6 @@ static const struct kpp_testvec ecdh_p192_tv_template[] = {
        .expected_ss_size = 24
        }
 };
-#endif
 
 static const struct kpp_testvec ecdh_p256_tv_template[] = {
        {