]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
drbg: streamline test for allowed digests
authorPauli <ppzgs1@gmail.com>
Fri, 26 Jul 2024 01:59:09 +0000 (11:59 +1000)
committerPauli <ppzgs1@gmail.com>
Sun, 28 Jul 2024 08:49:52 +0000 (18:49 +1000)
Under FIPS, we've got a whitelist of algorithms.  There is no need to then
also check for XOF digests because they aren't possible.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25007)

providers/implementations/rands/drbg.c

index 66b61bbd33bc654dbcc802779808582c30b2d45c..c15c4606e62da84f1df43125384a3f3472e86bfe 100644 (file)
@@ -1029,11 +1029,12 @@ int ossl_drbg_verify_digest(PROV_DRBG *drbg, OSSL_LIB_CTX *libctx,
             return 0;
         }
     }
-#endif
+#else   /* FIPS_MODULE */
     /* Outside of FIPS, any digests that are not XOF are allowed */
     if ((EVP_MD_get_flags(md) & EVP_MD_FLAG_XOF) != 0) {
         ERR_raise(ERR_LIB_PROV, PROV_R_XOF_DIGESTS_NOT_ALLOWED);
         return 0;
     }
+#endif  /* FIPS_MODULE */
     return 1;
 }