diff --git a/yhwrap/CMakeLists.txt b/yhwrap/CMakeLists.txt index 915a6e8c..4ab69354 100644 --- a/yhwrap/CMakeLists.txt +++ b/yhwrap/CMakeLists.txt @@ -21,6 +21,7 @@ set ( SOURCE ../common/hash.c ../common/parsing.c + ../common/pkcs5.c ../common/util.c ../common/openssl-compat.c main.c diff --git a/yhwrap/main.c b/yhwrap/main.c index 2579dc28..850a209f 100644 --- a/yhwrap/main.c +++ b/yhwrap/main.c @@ -35,6 +35,7 @@ #include "cmdline.h" #include "parsing.h" +#include "pkcs5.h" #include "util.h" #include @@ -315,11 +316,11 @@ int main(int argc, char *argv[]) { } uint8_t key[YH_KEY_LEN * 2]; - int ret = - PKCS5_PBKDF2_HMAC((const char *) password, password_len, - (uint8_t *) YH_DEFAULT_SALT, strlen(YH_DEFAULT_SALT), - YH_DEFAULT_ITERS, EVP_sha256(), sizeof(key), key); - if (ret != 1) { + bool ret = + pkcs5_pbkdf2_hmac((const uint8_t *) password, password_len, + (const uint8_t *) YH_DEFAULT_SALT, strlen(YH_DEFAULT_SALT), + YH_DEFAULT_ITERS, _SHA256, key, sizeof(key)); + if (ret == false) { fprintf(stderr, "Unable to derive keys\n"); goto main_exit; }