Commit a1915d51 authored by Jarod Wilson's avatar Jarod Wilson Committed by Herbert Xu

crypto: testmgr - Mark algs allowed in fips mode

Set the fips_allowed flag in testmgr.c's alg_test_descs[] for algs
that are allowed to be used when in fips mode.

One caveat: des isn't actually allowed anymore, but des (and thus also
ecb(des)) has to be permitted, because disallowing them results in
des3_ede being unable to properly register (see des module init func).

Also, crc32 isn't technically on the fips approved list, but I think
it gets used in various places that necessitate it being allowed.

This list is based on
http://csrc.nist.gov/groups/STM/cavp/index.html

Important note: allowed/approved here does NOT mean "validated", just
that its an alg that *could* be validated.
Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent f7cb80f2
...@@ -94,6 +94,7 @@ struct alg_test_desc { ...@@ -94,6 +94,7 @@ struct alg_test_desc {
const char *alg; const char *alg;
int (*test)(const struct alg_test_desc *desc, const char *driver, int (*test)(const struct alg_test_desc *desc, const char *driver,
u32 type, u32 mask); u32 type, u32 mask);
int fips_allowed; /* set if alg is allowed in fips mode */
union { union {
struct aead_test_suite aead; struct aead_test_suite aead;
...@@ -1432,6 +1433,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1432,6 +1433,7 @@ static const struct alg_test_desc alg_test_descs[] = {
{ {
.alg = "ansi_cprng", .alg = "ansi_cprng",
.test = alg_test_cprng, .test = alg_test_cprng,
.fips_allowed = 1,
.suite = { .suite = {
.cprng = { .cprng = {
.vecs = ansi_cprng_aes_tv_template, .vecs = ansi_cprng_aes_tv_template,
...@@ -1441,6 +1443,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1441,6 +1443,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "cbc(aes)", .alg = "cbc(aes)",
.test = alg_test_skcipher, .test = alg_test_skcipher,
.fips_allowed = 1,
.suite = { .suite = {
.cipher = { .cipher = {
.enc = { .enc = {
...@@ -1516,6 +1519,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1516,6 +1519,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "cbc(des3_ede)", .alg = "cbc(des3_ede)",
.test = alg_test_skcipher, .test = alg_test_skcipher,
.fips_allowed = 1,
.suite = { .suite = {
.cipher = { .cipher = {
.enc = { .enc = {
...@@ -1546,6 +1550,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1546,6 +1550,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "ccm(aes)", .alg = "ccm(aes)",
.test = alg_test_aead, .test = alg_test_aead,
.fips_allowed = 1,
.suite = { .suite = {
.aead = { .aead = {
.enc = { .enc = {
...@@ -1561,6 +1566,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1561,6 +1566,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "crc32c", .alg = "crc32c",
.test = alg_test_crc32c, .test = alg_test_crc32c,
.fips_allowed = 1,
.suite = { .suite = {
.hash = { .hash = {
.vecs = crc32c_tv_template, .vecs = crc32c_tv_template,
...@@ -1570,6 +1576,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1570,6 +1576,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "ctr(aes)", .alg = "ctr(aes)",
.test = alg_test_skcipher, .test = alg_test_skcipher,
.fips_allowed = 1,
.suite = { .suite = {
.cipher = { .cipher = {
.enc = { .enc = {
...@@ -1615,6 +1622,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1615,6 +1622,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "ecb(aes)", .alg = "ecb(aes)",
.test = alg_test_skcipher, .test = alg_test_skcipher,
.fips_allowed = 1,
.suite = { .suite = {
.cipher = { .cipher = {
.enc = { .enc = {
...@@ -1720,6 +1728,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1720,6 +1728,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "ecb(des)", .alg = "ecb(des)",
.test = alg_test_skcipher, .test = alg_test_skcipher,
.fips_allowed = 1,
.suite = { .suite = {
.cipher = { .cipher = {
.enc = { .enc = {
...@@ -1735,6 +1744,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1735,6 +1744,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "ecb(des3_ede)", .alg = "ecb(des3_ede)",
.test = alg_test_skcipher, .test = alg_test_skcipher,
.fips_allowed = 1,
.suite = { .suite = {
.cipher = { .cipher = {
.enc = { .enc = {
...@@ -1870,6 +1880,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1870,6 +1880,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "gcm(aes)", .alg = "gcm(aes)",
.test = alg_test_aead, .test = alg_test_aead,
.fips_allowed = 1,
.suite = { .suite = {
.aead = { .aead = {
.enc = { .enc = {
...@@ -1912,6 +1923,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1912,6 +1923,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "hmac(sha1)", .alg = "hmac(sha1)",
.test = alg_test_hash, .test = alg_test_hash,
.fips_allowed = 1,
.suite = { .suite = {
.hash = { .hash = {
.vecs = hmac_sha1_tv_template, .vecs = hmac_sha1_tv_template,
...@@ -1921,6 +1933,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1921,6 +1933,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "hmac(sha224)", .alg = "hmac(sha224)",
.test = alg_test_hash, .test = alg_test_hash,
.fips_allowed = 1,
.suite = { .suite = {
.hash = { .hash = {
.vecs = hmac_sha224_tv_template, .vecs = hmac_sha224_tv_template,
...@@ -1930,6 +1943,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1930,6 +1943,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "hmac(sha256)", .alg = "hmac(sha256)",
.test = alg_test_hash, .test = alg_test_hash,
.fips_allowed = 1,
.suite = { .suite = {
.hash = { .hash = {
.vecs = hmac_sha256_tv_template, .vecs = hmac_sha256_tv_template,
...@@ -1939,6 +1953,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1939,6 +1953,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "hmac(sha384)", .alg = "hmac(sha384)",
.test = alg_test_hash, .test = alg_test_hash,
.fips_allowed = 1,
.suite = { .suite = {
.hash = { .hash = {
.vecs = hmac_sha384_tv_template, .vecs = hmac_sha384_tv_template,
...@@ -1948,6 +1963,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -1948,6 +1963,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "hmac(sha512)", .alg = "hmac(sha512)",
.test = alg_test_hash, .test = alg_test_hash,
.fips_allowed = 1,
.suite = { .suite = {
.hash = { .hash = {
.vecs = hmac_sha512_tv_template, .vecs = hmac_sha512_tv_template,
...@@ -2029,6 +2045,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -2029,6 +2045,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "rfc3686(ctr(aes))", .alg = "rfc3686(ctr(aes))",
.test = alg_test_skcipher, .test = alg_test_skcipher,
.fips_allowed = 1,
.suite = { .suite = {
.cipher = { .cipher = {
.enc = { .enc = {
...@@ -2044,6 +2061,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -2044,6 +2061,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "rfc4309(ccm(aes))", .alg = "rfc4309(ccm(aes))",
.test = alg_test_aead, .test = alg_test_aead,
.fips_allowed = 1,
.suite = { .suite = {
.aead = { .aead = {
.enc = { .enc = {
...@@ -2106,6 +2124,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -2106,6 +2124,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "sha1", .alg = "sha1",
.test = alg_test_hash, .test = alg_test_hash,
.fips_allowed = 1,
.suite = { .suite = {
.hash = { .hash = {
.vecs = sha1_tv_template, .vecs = sha1_tv_template,
...@@ -2115,6 +2134,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -2115,6 +2134,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "sha224", .alg = "sha224",
.test = alg_test_hash, .test = alg_test_hash,
.fips_allowed = 1,
.suite = { .suite = {
.hash = { .hash = {
.vecs = sha224_tv_template, .vecs = sha224_tv_template,
...@@ -2124,6 +2144,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -2124,6 +2144,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "sha256", .alg = "sha256",
.test = alg_test_hash, .test = alg_test_hash,
.fips_allowed = 1,
.suite = { .suite = {
.hash = { .hash = {
.vecs = sha256_tv_template, .vecs = sha256_tv_template,
...@@ -2133,6 +2154,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -2133,6 +2154,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "sha384", .alg = "sha384",
.test = alg_test_hash, .test = alg_test_hash,
.fips_allowed = 1,
.suite = { .suite = {
.hash = { .hash = {
.vecs = sha384_tv_template, .vecs = sha384_tv_template,
...@@ -2142,6 +2164,7 @@ static const struct alg_test_desc alg_test_descs[] = { ...@@ -2142,6 +2164,7 @@ static const struct alg_test_desc alg_test_descs[] = {
}, { }, {
.alg = "sha512", .alg = "sha512",
.test = alg_test_hash, .test = alg_test_hash,
.fips_allowed = 1,
.suite = { .suite = {
.hash = { .hash = {
.vecs = sha512_tv_template, .vecs = sha512_tv_template,
......
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