aboutsummaryrefslogtreecommitdiffstats
path: root/librecrypt_find_first_algorithm_.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-20 23:04:11 +0200
committerMattias Andrée <m@maandree.se>2026-05-20 23:04:11 +0200
commitc35b47228f5494f4d806e9166628110af6dd2469 (patch)
tree3b5a123af999a5e047b8565efee293a5d95c3f6c /librecrypt_find_first_algorithm_.c
parentPrepare for supporting custom algorithms (diff)
downloadlibrecrypt-c35b47228f5494f4d806e9166628110af6dd2469.tar.gz
librecrypt-c35b47228f5494f4d806e9166628110af6dd2469.tar.bz2
librecrypt-c35b47228f5494f4d806e9166628110af6dd2469.tar.xz
Add (so far untested and undocument) support for pepperHEADmaster
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'librecrypt_find_first_algorithm_.c')
-rw-r--r--librecrypt_find_first_algorithm_.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/librecrypt_find_first_algorithm_.c b/librecrypt_find_first_algorithm_.c
index 2a33b5e..ebe3699 100644
--- a/librecrypt_find_first_algorithm_.c
+++ b/librecrypt_find_first_algorithm_.c
@@ -4,12 +4,14 @@
const struct librecrypt_algorithm *
-librecrypt_find_first_algorithm_(const char *settings, size_t len)
+librecrypt_find_first_algorithm_(const char *settings, size_t len, LIBRECRYPT_CONTEXT *ctx)
{
unsigned r, priority = 0;
const struct librecrypt_algorithm *algo, *found = NULL;
size_t i;
+ (void) ctx; /* TODO */
+
for (i = 0u;; i++) {
/* Get next algorithm in the list */
algo = &librecrypt_algorithms_[i];
@@ -45,10 +47,10 @@ librecrypt_find_first_algorithm_(const char *settings, size_t len)
#define CHECK(ALGO)\
do {\
- algo = librecrypt_find_first_algorithm_(ALGO, sizeof(ALGO) - 1u);\
+ algo = librecrypt_find_first_algorithm_(ALGO, sizeof(ALGO) - 1u, NULL);\
EXPECT(algo != NULL);\
EXPECT((*algo->is_algorithm)(ALGO, sizeof(ALGO) - 1u) > 0u);\
- EXPECT(librecrypt_find_first_algorithm_(ALGO">"NSA, sizeof(ALGO">"NSA) - 1u) == algo);\
+ EXPECT(librecrypt_find_first_algorithm_(ALGO">"NSA, sizeof(ALGO">"NSA) - 1u, NULL) == algo);\
} while (0)
@@ -60,8 +62,8 @@ main(void)
SET_UP_ALARM();
INIT_RESOURCE_TEST();
- EXPECT(librecrypt_find_first_algorithm_(NSA, sizeof(NSA) - 1u) == NULL);
- EXPECT(librecrypt_find_first_algorithm_(NSA">", sizeof(NSA">") - 1u) == NULL);
+ EXPECT(librecrypt_find_first_algorithm_(NSA, sizeof(NSA) - 1u, NULL) == NULL);
+ EXPECT(librecrypt_find_first_algorithm_(NSA">", sizeof(NSA">") - 1u, NULL) == NULL);
IF__argon2i__SUPPORTED(CHECK("$argon2i$"));
IF__argon2d__SUPPORTED(CHECK("$argon2d$"));