From adfa8e1265f6155d1a582baa9929af198bb5d4de Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 1 May 2026 17:45:39 +0200 Subject: Misc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- librecrypt_get_encoding.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'librecrypt_get_encoding.c') diff --git a/librecrypt_get_encoding.c b/librecrypt_get_encoding.c index dd5d33d..2eef882 100644 --- a/librecrypt_get_encoding.c +++ b/librecrypt_get_encoding.c @@ -9,18 +9,21 @@ librecrypt_get_encoding(const char *settings, size_t len, char *pad_out, int *st size_t i, start = 0u; const struct algorithm *algo; + /* Find last algorithm in the chain */ for (i = 0u; i < len; i++) if (settings[i] == LIBRECRYPT_ALGORITHM_LINK_DELIMITER) start = i + 1u; settings = &settings[start]; len -= start; + /* Identify the algorithm */ algo = librecrypt_find_first_algorithm_(settings, len); if (!algo) { errno = ENOSYS; return NULL; } + /* Return the algorithms salt/hash encoding format */ *pad_out = algo->pad; *strict_pad_out = algo->strict_pad; if (decoding) -- cgit v1.2.3-70-g09d2