From ff355d111f09e2fe94c2f76128ada22dc959bea9 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 5 Oct 2026 09:27:21 +0900 Subject: [PATCH] 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. --- src/Crypto/Argon2/src/selftest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Crypto/Argon2/src/selftest.c b/src/Crypto/Argon2/src/selftest.c index d937fdd1..8512bd7d 100644 --- a/src/Crypto/Argon2/src/selftest.c +++ b/src/Crypto/Argon2/src/selftest.c @@ -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;