Use a common KDF function

Cleanup the KDF function to use only one function per crypto backend.
Improve the KDF function to properly handle requested lenght and to
avoid unnecessarily reallocating buffers.

In OpenSSL use the new EVP_KDF API if available.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Simo Sorce
2018-10-01 18:00:01 -04:00
committed by Andreas Schneider
parent c180211c6b
commit 104c9dca3f
11 changed files with 299 additions and 256 deletions

View File

@@ -130,6 +130,7 @@ set(libssh_SRCS
error.c
getpass.c
init.c
kdf.c
kex.c
known_hosts.c
knownhosts.c