]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: Convert KEYCTL_DH_COMPUTE to use the crypto KPP API
authorMat Martineau <mathew.j.martineau@linux.intel.com>
Thu, 8 Jun 2017 13:50:11 +0000 (14:50 +0100)
committerJames Morris <james.l.morris@oracle.com>
Fri, 9 Jun 2017 03:29:50 +0000 (13:29 +1000)
commitcb302b55ca5f0f358ec30ce5bc8166ccf2ebfd48
tree437ceb7be54a31c89b5bebf24b2dcda09210c2a0
parentf7b66efe93427f32780d6809a9d3f82f459cdf66
KEYS: Convert KEYCTL_DH_COMPUTE to use the crypto KPP API

The initial Diffie-Hellman computation made direct use of the MPI
library because the crypto module did not support DH at the time. Now
that KPP is implemented, KEYCTL_DH_COMPUTE should use it to get rid of
duplicate code and leverage possible hardware acceleration.

This fixes an issue whereby the input to the KDF computation would
include additional uninitialized memory when the result of the
Diffie-Hellman computation was shorter than the input prime number.

Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
security/keys/Kconfig
security/keys/dh.c