Skip to content

Commit 6dd43dc

Browse files
andrewkdinhnhorman
authored andcommitted
Fix logic errors for HMAC-DRBG
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> MergeDate: Tue Mar 3 20:06:04 2026 (Merged from #30232)
1 parent e57696e commit 6dd43dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

providers/implementations/rands/drbg_hmac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ static int drbg_fetch_algs_from_prov(const OSSL_PARAM params[],
437437

438438
p = OSSL_PARAM_locate_const(params, OSSL_ALG_PARAM_DIGEST);
439439
if (p) {
440-
if (OSSL_PARAM_get_utf8_string_ptr(p, &digest_name)) {
440+
if (!OSSL_PARAM_get_utf8_string_ptr(p, &digest_name)) {
441441
ERR_raise(ERR_LIB_PROV, PROV_R_VALUE_ERROR);
442442
goto done;
443443
}
@@ -458,7 +458,7 @@ static int drbg_fetch_algs_from_prov(const OSSL_PARAM params[],
458458
if (p == NULL) {
459459
hmac_name = "HMAC";
460460
} else {
461-
if (OSSL_PARAM_get_utf8_string_ptr(p, &hmac_name)) {
461+
if (!OSSL_PARAM_get_utf8_string_ptr(p, &hmac_name)) {
462462
ERR_raise(ERR_LIB_PROV, PROV_R_VALUE_ERROR);
463463
goto done;
464464
}

0 commit comments

Comments
 (0)