Commit bc197f57 authored by Dimitri John Ledkov's avatar Dimitri John Ledkov Committed by Herbert Xu

crypto: drbg - Remove SHA1 from drbg

SP800-90C 3rd draft states that SHA-1 will be removed from all
specifications, including drbg by end of 2030. Given kernels built
today will be operating past that date, start complying with upcoming
requirements.

No functional change, as SHA-256 / SHA-512 based DRBG have always been
the preferred ones.
Signed-off-by: default avatarDimitri John Ledkov <dimitri.ledkov@canonical.com>
Reviewed-by: default avatarStephan Mueller <smueller@chronox.de>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent dd9af704
...@@ -139,12 +139,6 @@ static const struct drbg_core drbg_cores[] = { ...@@ -139,12 +139,6 @@ static const struct drbg_core drbg_cores[] = {
#endif /* CONFIG_CRYPTO_DRBG_CTR */ #endif /* CONFIG_CRYPTO_DRBG_CTR */
#ifdef CONFIG_CRYPTO_DRBG_HASH #ifdef CONFIG_CRYPTO_DRBG_HASH
{ {
.flags = DRBG_HASH | DRBG_STRENGTH128,
.statelen = 55, /* 440 bits */
.blocklen_bytes = 20,
.cra_name = "sha1",
.backend_cra_name = "sha1",
}, {
.flags = DRBG_HASH | DRBG_STRENGTH256, .flags = DRBG_HASH | DRBG_STRENGTH256,
.statelen = 111, /* 888 bits */ .statelen = 111, /* 888 bits */
.blocklen_bytes = 48, .blocklen_bytes = 48,
...@@ -166,12 +160,6 @@ static const struct drbg_core drbg_cores[] = { ...@@ -166,12 +160,6 @@ static const struct drbg_core drbg_cores[] = {
#endif /* CONFIG_CRYPTO_DRBG_HASH */ #endif /* CONFIG_CRYPTO_DRBG_HASH */
#ifdef CONFIG_CRYPTO_DRBG_HMAC #ifdef CONFIG_CRYPTO_DRBG_HMAC
{ {
.flags = DRBG_HMAC | DRBG_STRENGTH128,
.statelen = 20, /* block length of cipher */
.blocklen_bytes = 20,
.cra_name = "hmac_sha1",
.backend_cra_name = "hmac(sha1)",
}, {
.flags = DRBG_HMAC | DRBG_STRENGTH256, .flags = DRBG_HMAC | DRBG_STRENGTH256,
.statelen = 48, /* block length of cipher */ .statelen = 48, /* block length of cipher */
.blocklen_bytes = 48, .blocklen_bytes = 48,
...@@ -648,8 +636,6 @@ MODULE_ALIAS_CRYPTO("drbg_pr_hmac_sha384"); ...@@ -648,8 +636,6 @@ MODULE_ALIAS_CRYPTO("drbg_pr_hmac_sha384");
MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha384"); MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha384");
MODULE_ALIAS_CRYPTO("drbg_pr_hmac_sha256"); MODULE_ALIAS_CRYPTO("drbg_pr_hmac_sha256");
MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha256"); MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha256");
MODULE_ALIAS_CRYPTO("drbg_pr_hmac_sha1");
MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha1");
/* update function of HMAC DRBG as defined in 10.1.2.2 */ /* update function of HMAC DRBG as defined in 10.1.2.2 */
static int drbg_hmac_update(struct drbg_state *drbg, struct list_head *seed, static int drbg_hmac_update(struct drbg_state *drbg, struct list_head *seed,
...@@ -768,8 +754,6 @@ MODULE_ALIAS_CRYPTO("drbg_pr_sha384"); ...@@ -768,8 +754,6 @@ MODULE_ALIAS_CRYPTO("drbg_pr_sha384");
MODULE_ALIAS_CRYPTO("drbg_nopr_sha384"); MODULE_ALIAS_CRYPTO("drbg_nopr_sha384");
MODULE_ALIAS_CRYPTO("drbg_pr_sha256"); MODULE_ALIAS_CRYPTO("drbg_pr_sha256");
MODULE_ALIAS_CRYPTO("drbg_nopr_sha256"); MODULE_ALIAS_CRYPTO("drbg_nopr_sha256");
MODULE_ALIAS_CRYPTO("drbg_pr_sha1");
MODULE_ALIAS_CRYPTO("drbg_nopr_sha1");
/* /*
* Increment buffer * Increment buffer
......
...@@ -4845,14 +4845,6 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -4845,14 +4845,6 @@ static const struct alg_test_desc alg_test_descs[] = {
.suite = { .suite = {
.drbg = __VECS(drbg_nopr_ctr_aes256_tv_template) .drbg = __VECS(drbg_nopr_ctr_aes256_tv_template)
} }
}, {
/*
* There is no need to specifically test the DRBG with every
* backend cipher -- covered by drbg_nopr_hmac_sha256 test
*/
.alg = "drbg_nopr_hmac_sha1",
.fips_allowed = 1,
.test = alg_test_null,
}, { }, {
.alg = "drbg_nopr_hmac_sha256", .alg = "drbg_nopr_hmac_sha256",
.test = alg_test_drbg, .test = alg_test_drbg,
...@@ -4861,7 +4853,10 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -4861,7 +4853,10 @@ static const struct alg_test_desc alg_test_descs[] = {
.drbg = __VECS(drbg_nopr_hmac_sha256_tv_template) .drbg = __VECS(drbg_nopr_hmac_sha256_tv_template)
} }
}, { }, {
/* covered by drbg_nopr_hmac_sha256 test */ /*
* There is no need to specifically test the DRBG with every
* backend cipher -- covered by drbg_nopr_hmac_sha512 test
*/
.alg = "drbg_nopr_hmac_sha384", .alg = "drbg_nopr_hmac_sha384",
.test = alg_test_null, .test = alg_test_null,
}, { }, {
...@@ -4871,10 +4866,6 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -4871,10 +4866,6 @@ static const struct alg_test_desc alg_test_descs[] = {
.suite = { .suite = {
.drbg = __VECS(drbg_nopr_hmac_sha512_tv_template) .drbg = __VECS(drbg_nopr_hmac_sha512_tv_template)
} }
}, {
.alg = "drbg_nopr_sha1",
.fips_allowed = 1,
.test = alg_test_null,
}, { }, {
.alg = "drbg_nopr_sha256", .alg = "drbg_nopr_sha256",
.test = alg_test_drbg, .test = alg_test_drbg,
...@@ -4906,10 +4897,6 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -4906,10 +4897,6 @@ static const struct alg_test_desc alg_test_descs[] = {
.alg = "drbg_pr_ctr_aes256", .alg = "drbg_pr_ctr_aes256",
.fips_allowed = 1, .fips_allowed = 1,
.test = alg_test_null, .test = alg_test_null,
}, {
.alg = "drbg_pr_hmac_sha1",
.fips_allowed = 1,
.test = alg_test_null,
}, { }, {
.alg = "drbg_pr_hmac_sha256", .alg = "drbg_pr_hmac_sha256",
.test = alg_test_drbg, .test = alg_test_drbg,
...@@ -4925,10 +4912,6 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -4925,10 +4912,6 @@ static const struct alg_test_desc alg_test_descs[] = {
.alg = "drbg_pr_hmac_sha512", .alg = "drbg_pr_hmac_sha512",
.test = alg_test_null, .test = alg_test_null,
.fips_allowed = 1, .fips_allowed = 1,
}, {
.alg = "drbg_pr_sha1",
.fips_allowed = 1,
.test = alg_test_null,
}, { }, {
.alg = "drbg_pr_sha256", .alg = "drbg_pr_sha256",
.test = alg_test_drbg, .test = alg_test_drbg,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment