aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Broz <gmazyland@gmail.com>2024-02-13 11:58:54 +0100
committerMilan Broz <gmazyland@gmail.com>2024-02-13 12:38:00 +0100
commita6d9dc0a16b8896e9f4148a7761b922567698469 (patch)
tree1761a9a2e9c2182822c94361adeac5d599cb6392
parentf681194b57c406d655e45564fb2b49f823015bc8 (diff)
downloadcryptsetup-a6d9dc0a16b8896e9f4148a7761b922567698469.tar.gz
Do not require argon2.h if implemented natively in crypto library.
-rw-r--r--lib/crypto_backend/argon2_generic.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/crypto_backend/argon2_generic.c b/lib/crypto_backend/argon2_generic.c
index eca575be..9b3c0393 100644
--- a/lib/crypto_backend/argon2_generic.c
+++ b/lib/crypto_backend/argon2_generic.c
@@ -21,15 +21,18 @@
#include <errno.h>
#include "crypto_backend_internal.h"
+
+/* Check for HAVE_ARGON2_H is run only if libargon2 code is used */
+#if USE_INTERNAL_ARGON2 || HAVE_ARGON2_H
+
+#define CONST_CAST(x) (x)(uintptr_t)
+
#if HAVE_ARGON2_H
#include <argon2.h>
#else
#include "argon2/argon2.h"
#endif
-#define CONST_CAST(x) (x)(uintptr_t)
-
-#if USE_INTERNAL_ARGON2 || HAVE_ARGON2_H
int argon2(const char *type, const char *password, size_t password_length,
const char *salt, size_t salt_length,
char *key, size_t key_length,