diff options
Diffstat (limited to 'librecrypt_get_encoding.c')
| -rw-r--r-- | librecrypt_get_encoding.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/librecrypt_get_encoding.c b/librecrypt_get_encoding.c index cad16df..c1cf64c 100644 --- a/librecrypt_get_encoding.c +++ b/librecrypt_get_encoding.c @@ -4,17 +4,12 @@ const void * -librecrypt_get_encoding(const char *settings, size_t len, char *pad_out, int *strict_pad_out, int decoding, void *reserved) +librecrypt_get_encoding(const char *settings, size_t len, char *pad_out, int *strict_pad_out, + int decoding, LIBRECRYPT_CONTEXT *ctx) { size_t i, start = 0u; const struct librecrypt_algorithm *algo; - /* Ensure the reserved parameter is NULL */ - if (reserved != NULL) { - errno = EINVAL; - return NULL; - } - /* Find last algorithm in the chain */ for (i = 0u; i < len; i++) if (settings[i] == LIBRECRYPT_ALGORITHM_LINK_DELIMITER) @@ -23,7 +18,7 @@ librecrypt_get_encoding(const char *settings, size_t len, char *pad_out, int *st len -= start; /* Identify the algorithm */ - algo = librecrypt_find_first_algorithm_(settings, len); + algo = librecrypt_find_first_algorithm_(settings, len, ctx); if (!algo) { errno = ENOSYS; return NULL; @@ -110,7 +105,6 @@ check_decoding_lut(const unsigned char *lut, const char *alpha) int main(void) { - char reserved[1] = {0}; const char *elut; const unsigned char *dlut; char pad; @@ -120,10 +114,6 @@ main(void) INIT_RESOURCE_TEST(); errno = 0; - EXPECT(librecrypt_get_encoding("$argon2i$", sizeof("$argon2i$") - 1u, &pad, &strict_pad, 0, reserved) == NULL); - EXPECT(errno == EINVAL); - - errno = 0; EXPECT(librecrypt_get_encoding(NSA, sizeof(NSA) - 1u, &pad, &strict_pad, 0, NULL) == NULL); EXPECT(errno == ENOSYS); |
