mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-05 16:46:35 -05:00
Argon2: fail self tests on context errors
Count argon2_ctx errors as test failures. Previously, failed calls skipped the hash comparison without increasing the failure count.
This commit is contained in:
1 file changed
+3
-3
@@ -96,13 +96,13 @@ static int argon2_selftest_ctx (void)
|
||||
|
||||
/* Test execution for Argon2d, Argon2i, Argon2id */
|
||||
|
||||
if (argon2_ctx (&context, Argon2_d) == ARGON2_OK &&
|
||||
if (argon2_ctx (&context, Argon2_d) != ARGON2_OK ||
|
||||
memcmp (hash, ref0d, 32) != 0) err++;
|
||||
|
||||
if (argon2_ctx (&context, Argon2_i) == ARGON2_OK &&
|
||||
if (argon2_ctx (&context, Argon2_i) != ARGON2_OK ||
|
||||
memcmp (hash, ref0i, 32) != 0) err++;
|
||||
|
||||
if (argon2_ctx (&context, Argon2_id) == ARGON2_OK &&
|
||||
if (argon2_ctx (&context, Argon2_id) != ARGON2_OK ||
|
||||
memcmp (hash, ref0id, 32) != 0) err++;
|
||||
|
||||
return err;
|
||||
|
||||
Reference in new issue
Block a user