diff options
author | Tobias Heider <tobias.heider@canonical.com> | 2023-03-30 11:36:34 +0200 |
---|---|---|
committer | Tobias Heider <tobias.heider@canonical.com> | 2023-03-30 11:42:26 +0200 |
commit | d8d0a00b4206e1d9b627ae7509a1eb5743b59d23 (patch) | |
tree | bf668721a5c9664d1802475c18fb474063ac0b6b | |
parent | b3fe5c229474a4dd0e74e955afb6bdc5d54c462d (diff) | |
download | gnutls-d8d0a00b4206e1d9b627ae7509a1eb5743b59d23.tar.gz |
fips: add additional pbkdf limit checks as defined in SP 800-132
Signed-off-by: Tobias Heider <tobias.heider@canonical.com>
-rw-r--r-- | lib/crypto-api.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/crypto-api.c b/lib/crypto-api.c index 9f7619bd68..568edf7571 100644 --- a/lib/crypto-api.c +++ b/lib/crypto-api.c @@ -2218,6 +2218,16 @@ gnutls_pbkdf2(gnutls_mac_algorithm_t mac, not_approved = true; } + /* Minimum salt length of 128 bits (SP 800-132 5.1) */ + if (salt->size < 16) { + not_approved = true; + } + + /* Minimum iterations bound (SP 800-132 5.2) */ + if (iter_count < 1000) { + not_approved = true; + } + ret = _gnutls_kdf_ops.pbkdf2(mac, key->data, key->size, salt->data, salt->size, iter_count, output, length); |