aboutsummaryrefslogtreecommitdiffstats
path: root/librecrypt_make_settings.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_make_settings.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 '')
-rw-r--r--librecrypt_make_settings.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/librecrypt_make_settings.c b/librecrypt_make_settings.c
index b883e4f..075d2a6 100644
--- a/librecrypt_make_settings.c
+++ b/librecrypt_make_settings.c
@@ -4,17 +4,13 @@
ssize_t
-librecrypt_make_settings(char *out_buffer, size_t size, const char *algorithm, size_t memcost, uintmax_t timecost,
- int gensalt, ssize_t (*rng)(void *out, size_t n, void *user), void *user, void *reserved)
+librecrypt_make_settings(char *out_buffer, size_t size, const char *algorithm,
+ size_t memcost, uintmax_t timecost, int gensalt,
+ ssize_t (*rng)(void *out, size_t n, void *user), void *user,
+ LIBRECRYPT_CONTEXT *ctx)
{
const struct librecrypt_algorithm *algo;
- /* Ensure the reserved parameter is NULL */
- if (reserved != NULL) {
- errno = EINVAL;
- return -1;
- }
-
/* Get algorithm */
if (!algorithm) {
/* Select best algorithm if `NULL` is specified */
@@ -28,7 +24,7 @@ librecrypt_make_settings(char *out_buffer, size_t size, const char *algorithm, s
return -1;
}
/* Identify the algorithm */
- algo = librecrypt_find_first_algorithm_(algorithm, strlen(algorithm));
+ algo = librecrypt_find_first_algorithm_(algorithm, strlen(algorithm), ctx);
if (!algo)
goto enosys;
}
@@ -81,7 +77,6 @@ main(void)
int any_supported = 0;
int any_salted = 0;
ssize_t r;
- char reserved[1] = {0};
SET_UP_ALARM();
INIT_RESOURCE_TEST();
@@ -103,10 +98,6 @@ main(void)
EXPECT(errno == ENOSYS);
#if defined(SUPPORT_ARGON2I)
- errno = 0;
- EXPECT(librecrypt_make_settings(NULL, 0u, "$argon2id$", 0u, 0u, 0, NULL, NULL, reserved) == -1);
- EXPECT(errno == EINVAL);
-
saltbyte = 0u;
CANARY_FILL(buf);
r = librecrypt_make_settings(buf, sizeof(buf), "$argon2i$", 8192u << 10, (uintmax_t)81920u, 1, &saltgen, &saltbyte, NULL);