forked from cory/tildefriends
Latest libsodium-1.0.18-stable.tar.gz.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4193 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
22
deps/libsodium/test/default/pwhash_argon2i.c
vendored
22
deps/libsodium/test/default/pwhash_argon2i.c
vendored
@ -290,10 +290,24 @@ str_tests(void)
|
||||
-1) {
|
||||
printf("pwhash_str() with a small opslimit should have failed\n");
|
||||
}
|
||||
if (crypto_pwhash_argon2i_str_verify("$argon2i$m=65536,t=2,p=1c29tZXNhbHQ"
|
||||
"$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ",
|
||||
"password", 0x100000000ULL) != -1) {
|
||||
printf("pwhash_str_verify(invalid(0)) failure\n");
|
||||
{
|
||||
const char *str_in_ = "$argon2i$m=65536,t=2,p=1c29tZXNhbHQ"
|
||||
"$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ";
|
||||
char *str_in = (char *) sodium_malloc(strlen(str_in_) + 1U);
|
||||
|
||||
const char *password_in_ = "password";
|
||||
char *password_in = (char *) sodium_malloc(strlen(password_in_) + 1U);
|
||||
|
||||
memcpy(str_in, str_in_, strlen(str_in_) + 1U);
|
||||
memcpy(password_in, password_in_, strlen(password_in_) + 1U);
|
||||
|
||||
if (crypto_pwhash_argon2i_str_verify(str_in, password_in,
|
||||
0x100000000ULL) != -1) {
|
||||
printf("pwhash_str_verify(invalid(0)) failure\n");
|
||||
}
|
||||
|
||||
sodium_free(password_in);
|
||||
sodium_free(str_in);
|
||||
}
|
||||
if (crypto_pwhash_argon2i_str_verify("$argon2i$m=65536,t=2,p=1c29tZXNhbHQ"
|
||||
"$9sTbSlTio3Biev89thdrlKKiCaYsjjYVJxGAL3swxpQ",
|
||||
|
Reference in New Issue
Block a user