diff --git a/src/libsodium/crypto_pwhash/crypto_pwhash.c b/src/libsodium/crypto_pwhash/crypto_pwhash.c index 761fa9e5..b9c87f19 100644 --- a/src/libsodium/crypto_pwhash/crypto_pwhash.c +++ b/src/libsodium/crypto_pwhash/crypto_pwhash.c @@ -59,8 +59,10 @@ int crypto_pwhash(unsigned char * const out, unsigned long long outlen, const char * const passwd, unsigned long long passwdlen, const unsigned char * const salt, - unsigned long long opslimit, size_t memlimit) + unsigned long long opslimit, size_t memlimit, + const struct crypto_pwhash_options *options) { + (void) options; return crypto_pwhash_argon2i(out, outlen, passwd, passwdlen, salt, opslimit, memlimit); } diff --git a/src/libsodium/include/sodium/crypto_pwhash.h b/src/libsodium/include/sodium/crypto_pwhash.h index ac6b76f7..75e0249f 100644 --- a/src/libsodium/include/sodium/crypto_pwhash.h +++ b/src/libsodium/include/sodium/crypto_pwhash.h @@ -49,11 +49,14 @@ size_t crypto_pwhash_opslimit_sensitive(void); SODIUM_EXPORT size_t crypto_pwhash_memlimit_sensitive(void); +typedef struct crypto_pwhash_options crypto_pwhash_options; + SODIUM_EXPORT int crypto_pwhash(unsigned char * const out, unsigned long long outlen, const char * const passwd, unsigned long long passwdlen, const unsigned char * const salt, - unsigned long long opslimit, size_t memlimit) + unsigned long long opslimit, size_t memlimit, + const crypto_pwhash_options *options) __attribute__ ((warn_unused_result)); SODIUM_EXPORT diff --git a/test/default/pwhash_argon2i.c b/test/default/pwhash_argon2i.c index 0c1e9838..8f3b9ae6 100644 --- a/test/default/pwhash_argon2i.c +++ b/test/default/pwhash_argon2i.c @@ -89,11 +89,10 @@ static void tv(void) NULL, NULL); sodium_hex2bin(salt, sizeof salt, tests[i].salt_hex, strlen(tests[i].salt_hex), NULL, NULL, NULL); - if (crypto_pwhash( - out, (unsigned long long) tests[i].outlen, - passwd, tests[i].passwdlen, - (const unsigned char *) salt, tests[i].opslimit, - tests[i].memlimit) != 0) { + if (crypto_pwhash(out, (unsigned long long) tests[i].outlen, + passwd, tests[i].passwdlen, + (const unsigned char *) salt, tests[i].opslimit, + tests[i].memlimit, NULL) != 0) { printf("[tv] pwhash failure (maybe intentional): [%u]\n", (unsigned int) i); continue; } @@ -140,11 +139,10 @@ static void tv2(void) NULL, NULL); sodium_hex2bin(salt, sizeof salt, tests[i].salt_hex, strlen(tests[i].salt_hex), NULL, NULL, NULL); - if (crypto_pwhash( - out, (unsigned long long) tests[i].outlen, - passwd, tests[i].passwdlen, - (const unsigned char *) salt, tests[i].opslimit, - tests[i].memlimit) != 0) { + if (crypto_pwhash(out, (unsigned long long) tests[i].outlen, + passwd, tests[i].passwdlen, + (const unsigned char *) salt, tests[i].opslimit, + tests[i].memlimit, NULL) != 0) { printf("[tv2] pwhash failure: [%u]\n", (unsigned int) i); continue; } @@ -179,7 +177,7 @@ static void tv3(void) passwd = (char *) sodium_malloc(strlen(tests[i].passwd) + 1U); assert(passwd != NULL); memcpy(passwd, tests[i].passwd, strlen(tests[i].passwd) + 1U); - if (crypto_pwhash_argon2i_str_verify + if (crypto_pwhash_str_verify (out, passwd, strlen(passwd)) != 0) { printf("[tv3] pwhash_str failure (maybe intentional): [%u]\n", (unsigned int) i); continue;