diff options
| author | Mattias Andrée <m@maandree.se> | 2026-05-15 01:22:19 +0200 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-05-15 01:22:19 +0200 |
| commit | 68d6804a43dca2749a68a557e67b98e6005ead83 (patch) | |
| tree | 9c4137a48cd37ea423578d1ac3df6e3953cb2156 /argon2/hash.c | |
| parent | Fix minor errors in the test and check that we are not writing out of bounds (diff) | |
| download | librecrypt-68d6804a43dca2749a68a557e67b98e6005ead83.tar.gz librecrypt-68d6804a43dca2749a68a557e67b98e6005ead83.tar.bz2 librecrypt-68d6804a43dca2749a68a557e67b98e6005ead83.tar.xz | |
Fix some minor issues
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
| -rw-r--r-- | argon2/hash.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/argon2/hash.c b/argon2/hash.c index 9223e55..9c65e6a 100644 --- a/argon2/hash.c +++ b/argon2/hash.c @@ -100,8 +100,9 @@ librecrypt__argon2__hash(char *restrict out_buffer, size_t size, const char *phr type[1u] == 's' ? LIBAR2_ARGON2DS : type[0u] == 'i' ? LIBAR2_ARGON2I : LIBAR2_ARGON2D; - params.version = version[3u] == '9' ? LIBAR2_ARGON2_VERSION_13 : /* 19 = 0x13 = 1.3 */ - LIBAR2_ARGON2_VERSION_10; /* 16 = 0x10 = 1.0 */ + params.version = !*version ? LIBAR2_ARGON2_VERSION_10 : + version[3u] == '9' ? LIBAR2_ARGON2_VERSION_13 : /* 19 = 0x13 = 1.3 */ + LIBAR2_ARGON2_VERSION_10; /* 16 = 0x10 = 1.0 */ params.t_cost = (uint_least32_t)tcost; params.m_cost = (uint_least32_t)mcost; params.lanes = (uint_least32_t)lanes; |
