From 443617d7507498f7477703f0b51cb596d4539262 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 11 Nov 2021 14:15:24 +0100 Subject: [PATCH] Remove expected length from the pwhash_str_verify()/needs_rehash() --- src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c | 8 ++++---- src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c | 4 ++-- src/libsodium/crypto_pwhash/crypto_pwhash.c | 4 ++-- .../scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c | 4 ++-- src/libsodium/include/sodium/crypto_pwhash.h | 4 ++-- src/libsodium/include/sodium/crypto_pwhash_argon2i.h | 4 ++-- src/libsodium/include/sodium/crypto_pwhash_argon2id.h | 4 ++-- .../include/sodium/crypto_pwhash_scryptsalsa208sha256.h | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c b/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c index f9e9a390..8e17c5b2 100644 --- a/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c +++ b/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c @@ -214,8 +214,8 @@ crypto_pwhash_argon2i_str(char out[crypto_pwhash_argon2i_STRBYTES], } int -crypto_pwhash_argon2i_str_verify(const char str[crypto_pwhash_argon2i_STRBYTES], - const char *const passwd, +crypto_pwhash_argon2i_str_verify(const char * str, + const char * const passwd, unsigned long long passwdlen) { int verify_ret; @@ -280,14 +280,14 @@ _needs_rehash(const char *str, unsigned long long opslimit, size_t memlimit, } int -crypto_pwhash_argon2i_str_needs_rehash(const char str[crypto_pwhash_argon2i_STRBYTES], +crypto_pwhash_argon2i_str_needs_rehash(const char * str, unsigned long long opslimit, size_t memlimit) { return _needs_rehash(str, opslimit, memlimit, Argon2_i); } int -crypto_pwhash_argon2id_str_needs_rehash(const char str[crypto_pwhash_argon2id_STRBYTES], +crypto_pwhash_argon2id_str_needs_rehash(const char * str, unsigned long long opslimit, size_t memlimit) { return _needs_rehash(str, opslimit, memlimit, Argon2_id); diff --git a/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c b/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c index d641a617..e08be0a8 100644 --- a/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c +++ b/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c @@ -210,8 +210,8 @@ crypto_pwhash_argon2id_str(char out[crypto_pwhash_argon2id_STRBYTES], } int -crypto_pwhash_argon2id_str_verify(const char str[crypto_pwhash_argon2id_STRBYTES], - const char *const passwd, +crypto_pwhash_argon2id_str_verify(const char * str, + const char * const passwd, unsigned long long passwdlen) { int verify_ret; diff --git a/src/libsodium/crypto_pwhash/crypto_pwhash.c b/src/libsodium/crypto_pwhash/crypto_pwhash.c index a229b9f7..fde099a6 100644 --- a/src/libsodium/crypto_pwhash/crypto_pwhash.c +++ b/src/libsodium/crypto_pwhash/crypto_pwhash.c @@ -172,7 +172,7 @@ crypto_pwhash_str_alg(char out[crypto_pwhash_STRBYTES], } int -crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES], +crypto_pwhash_str_verify(const char * str, const char * const passwd, unsigned long long passwdlen) { @@ -190,7 +190,7 @@ crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES], } int -crypto_pwhash_str_needs_rehash(const char str[crypto_pwhash_STRBYTES], +crypto_pwhash_str_needs_rehash(const char * str, unsigned long long opslimit, size_t memlimit) { if (strncmp(str, crypto_pwhash_argon2id_STRPREFIX, diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c index fe701714..f44e04e2 100644 --- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c +++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c @@ -243,7 +243,7 @@ crypto_pwhash_scryptsalsa208sha256_str( int crypto_pwhash_scryptsalsa208sha256_str_verify( - const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES], + const char *str, const char *const passwd, unsigned long long passwdlen) { char wanted[crypto_pwhash_scryptsalsa208sha256_STRBYTES]; @@ -273,7 +273,7 @@ crypto_pwhash_scryptsalsa208sha256_str_verify( int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash( - const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES], + const char * str, unsigned long long opslimit, size_t memlimit) { uint32_t N_log2, N_log2_; diff --git a/src/libsodium/include/sodium/crypto_pwhash.h b/src/libsodium/include/sodium/crypto_pwhash.h index 585a993e..40e7ceb5 100644 --- a/src/libsodium/include/sodium/crypto_pwhash.h +++ b/src/libsodium/include/sodium/crypto_pwhash.h @@ -125,13 +125,13 @@ int crypto_pwhash_str_alg(char out[crypto_pwhash_STRBYTES], __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_str_verify(const char str[crypto_pwhash_STRBYTES], +int crypto_pwhash_str_verify(const char *str, const char * const passwd, unsigned long long passwdlen) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_str_needs_rehash(const char str[crypto_pwhash_STRBYTES], +int crypto_pwhash_str_needs_rehash(const char *str, unsigned long long opslimit, size_t memlimit) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); diff --git a/src/libsodium/include/sodium/crypto_pwhash_argon2i.h b/src/libsodium/include/sodium/crypto_pwhash_argon2i.h index 88ff6221..63abdf4a 100644 --- a/src/libsodium/include/sodium/crypto_pwhash_argon2i.h +++ b/src/libsodium/include/sodium/crypto_pwhash_argon2i.h @@ -105,13 +105,13 @@ int crypto_pwhash_argon2i_str(char out[crypto_pwhash_argon2i_STRBYTES], __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_argon2i_str_verify(const char str[crypto_pwhash_argon2i_STRBYTES], +int crypto_pwhash_argon2i_str_verify(const char * str, const char * const passwd, unsigned long long passwdlen) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_argon2i_str_needs_rehash(const char str[crypto_pwhash_argon2i_STRBYTES], +int crypto_pwhash_argon2i_str_needs_rehash(const char * str, unsigned long long opslimit, size_t memlimit) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); diff --git a/src/libsodium/include/sodium/crypto_pwhash_argon2id.h b/src/libsodium/include/sodium/crypto_pwhash_argon2id.h index 7183abd1..98bc83e0 100644 --- a/src/libsodium/include/sodium/crypto_pwhash_argon2id.h +++ b/src/libsodium/include/sodium/crypto_pwhash_argon2id.h @@ -105,13 +105,13 @@ int crypto_pwhash_argon2id_str(char out[crypto_pwhash_argon2id_STRBYTES], __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_argon2id_str_verify(const char str[crypto_pwhash_argon2id_STRBYTES], +int crypto_pwhash_argon2id_str_verify(const char * str, const char * const passwd, unsigned long long passwdlen) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_argon2id_str_needs_rehash(const char str[crypto_pwhash_argon2id_STRBYTES], +int crypto_pwhash_argon2id_str_needs_rehash(const char * str, unsigned long long opslimit, size_t memlimit) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); diff --git a/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h b/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h index 5c0bf7d3..8956dfbf 100644 --- a/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h +++ b/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h @@ -95,7 +95,7 @@ int crypto_pwhash_scryptsalsa208sha256_str(char out[crypto_pwhash_scryptsalsa208 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_scryptsalsa208sha256_str_verify(const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES], +int crypto_pwhash_scryptsalsa208sha256_str_verify(const char * str, const char * const passwd, unsigned long long passwdlen) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); @@ -108,7 +108,7 @@ int crypto_pwhash_scryptsalsa208sha256_ll(const uint8_t * passwd, size_t passwdl __attribute__ ((warn_unused_result)) __attribute__ ((nonnull)); SODIUM_EXPORT -int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(const char str[crypto_pwhash_scryptsalsa208sha256_STRBYTES], +int crypto_pwhash_scryptsalsa208sha256_str_needs_rehash(const char * str, unsigned long long opslimit, size_t memlimit) __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));