]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: DH: forbid using digest_null as the KDF hash
authorEric Biggers <ebiggers@google.com>
Thu, 8 Jun 2017 13:49:34 +0000 (14:49 +0100)
committerJames Morris <james.l.morris@oracle.com>
Fri, 9 Jun 2017 03:29:49 +0000 (13:29 +1000)
commit254851549c7a7b04e10a72d96ab2e6d1fc536a16
tree662839ffc98b691fe598cef81a1bab0c2b123ccd
parentea9624bd30708661fb39e5ddea6b3cc4a872a3c0
KEYS: DH: forbid using digest_null as the KDF hash

Requesting "digest_null" in the keyctl_kdf_params caused an infinite
loop in kdf_ctr() because the "null" hash has a digest size of 0.  Fix
it by rejecting hash algorithms with a digest size of 0.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: James Morris <james.l.morris@oracle.com>
security/keys/dh.c