mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Remove expected length from the pwhash_str_verify()/needs_rehash()
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -242,7 +242,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];
|
||||
@@ -272,7 +272,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_;
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user