From 39184b5b96176536f905bb42eafdc59c22a20e6e Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 10 Nov 2023 12:11:46 +0100 Subject: [PATCH] Include argon2id in crypto_pwhash_primitive() Fixes #1331 --- src/libsodium/include/sodium/crypto_pwhash.h | 2 +- test/default/pwhash_argon2id.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsodium/include/sodium/crypto_pwhash.h b/src/libsodium/include/sodium/crypto_pwhash.h index 307265d3..85a1be33 100644 --- a/src/libsodium/include/sodium/crypto_pwhash.h +++ b/src/libsodium/include/sodium/crypto_pwhash.h @@ -135,7 +135,7 @@ int crypto_pwhash_str_needs_rehash(const char *str, unsigned long long opslimit, size_t memlimit) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); -#define crypto_pwhash_PRIMITIVE "argon2i" +#define crypto_pwhash_PRIMITIVE "argon2id,argon2i" SODIUM_EXPORT const char *crypto_pwhash_primitive(void) __attribute__ ((warn_unused_result)); diff --git a/test/default/pwhash_argon2id.c b/test/default/pwhash_argon2id.c index 8e9db044..82d7d118 100644 --- a/test/default/pwhash_argon2id.c +++ b/test/default/pwhash_argon2id.c @@ -432,7 +432,7 @@ main(void) assert(crypto_pwhash_memlimit_moderate() > 0U); assert(crypto_pwhash_opslimit_sensitive() > 0U); assert(crypto_pwhash_memlimit_sensitive() > 0U); - assert(strcmp(crypto_pwhash_primitive(), "argon2i") == 0); + assert(strcmp(crypto_pwhash_primitive(), "argon2id,argon2i") == 0); assert(crypto_pwhash_bytes_min() == crypto_pwhash_BYTES_MIN); assert(crypto_pwhash_bytes_max() == crypto_pwhash_BYTES_MAX);