2 * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include "internal/deprecated.h"
12 #include <openssl/rsa.h>
13 #include <openssl/dsa.h>
14 #include <openssl/dh.h>
15 #include <openssl/ec.h>
16 #include <openssl/err.h>
17 #include <openssl/core_names.h>
18 #include <openssl/obj_mac.h>
19 #include "prov/securitycheck.h"
20 #include "prov/providercommonerr.h"
22 extern int FIPS_security_check_enabled(void);
24 int securitycheck_enabled(void)
26 #if !defined(OPENSSL_NO_FIPS_SECURITYCHECKS)
27 return FIPS_security_check_enabled();
30 #endif /* OPENSSL_NO_FIPS_SECURITYCHECKS */
33 int digest_rsa_sign_get_md_nid(const EVP_MD *md, int sha1_allowed)
35 #if !defined(OPENSSL_NO_FIPS_SECURITYCHECKS)
36 if (securitycheck_enabled())
37 return digest_get_approved_nid_with_sha1(md, sha1_allowed);
38 #endif /* OPENSSL_NO_FIPS_SECURITYCHECKS */
39 return digest_get_approved_nid(md);