From: Hui Tang <tanghui20@huawei.com>
To: <herbert@gondor.apana.org.au>, <davem@davemloft.net>
Cc: <linux-crypto@vger.kernel.org>, <xuzaibo@huawei.com>,
<wangzhou1@hisilicon.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v3 1/4] crypto: ecdh - fix ecdh-nist-p192's entry in testmgr
Date: Sat, 22 May 2021 10:44:28 +0800 [thread overview]
Message-ID: <1621651471-42010-2-git-send-email-tanghui20@huawei.com> (raw)
In-Reply-To: <1621651471-42010-1-git-send-email-tanghui20@huawei.com>
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>
---
crypto/ecdh.c | 1 +
crypto/testmgr.c | 3 ---
crypto/testmgr.h | 2 --
3 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/crypto/ecdh.c b/crypto/ecdh.c
index 04a427b..4227d35 100644
--- a/crypto/ecdh.c
+++ b/crypto/ecdh.c
@@ -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;
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 10c5b3b..26e40db 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -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,
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 34e4a3d..fe1e59d 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -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[] = {
{
--
2.8.1
next prev parent reply other threads:[~2021-05-22 2:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-22 2:44 [PATCH v3 0/4] crypto: ecdh - register NIST P384 Hui Tang
2021-05-22 2:44 ` Hui Tang [this message]
2021-05-22 2:44 ` [PATCH v3 2/4] crypto: ecdh - fix 'ecdh_init' Hui Tang
2021-05-22 2:44 ` [PATCH v3 3/4] crypto: ecdh - register NIST P384 tfm Hui Tang
2021-05-22 2:44 ` [PATCH v3 4/4] crypto: ecdh - add test suite for NIST P384 Hui Tang
2021-05-28 7:28 ` [PATCH v3 0/4] crypto: ecdh - register " Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1621651471-42010-2-git-send-email-tanghui20@huawei.com \
--to=tanghui20@huawei.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wangzhou1@hisilicon.com \
--cc=xuzaibo@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®