/src/openssl/providers/common/securitycheck_default.c
Line  | Count  | Source  | 
1  |  | /*  | 
2  |  |  * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.  | 
3  |  |  *  | 
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  | 
8  |  |  */  | 
9  |  |  | 
10  |  | #include "internal/deprecated.h"  | 
11  |  |  | 
12  |  | #include <openssl/rsa.h>  | 
13  |  | #include <openssl/core.h>  | 
14  |  | #include <openssl/core_names.h>  | 
15  |  | #include <openssl/obj_mac.h>  | 
16  |  | #include "prov/securitycheck.h"  | 
17  |  | #include "internal/nelem.h"  | 
18  |  |  | 
19  |  | /* Disable the security checks in the default provider */  | 
20  |  | int ossl_fips_config_securitycheck_enabled(OSSL_LIB_CTX *libctx)  | 
21  | 0  | { | 
22  | 0  |     return 0;  | 
23  | 0  | }  | 
24  |  |  | 
25  |  | int ossl_digest_rsa_sign_get_md_nid(const EVP_MD *md)  | 
26  | 0  | { | 
27  | 0  |     int mdnid;  | 
28  |  | 
  | 
29  | 0  |     static const OSSL_ITEM name_to_nid[] = { | 
30  | 0  |         { NID_md5,       OSSL_DIGEST_NAME_MD5       }, | 
31  | 0  |         { NID_md5_sha1,  OSSL_DIGEST_NAME_MD5_SHA1  }, | 
32  | 0  |         { NID_md2,       OSSL_DIGEST_NAME_MD2       }, | 
33  | 0  |         { NID_md4,       OSSL_DIGEST_NAME_MD4       }, | 
34  | 0  |         { NID_mdc2,      OSSL_DIGEST_NAME_MDC2      }, | 
35  | 0  |         { NID_ripemd160, OSSL_DIGEST_NAME_RIPEMD160 }, | 
36  | 0  |         { NID_sm3,       OSSL_DIGEST_NAME_SM3 }, | 
37  | 0  |     };  | 
38  |  | 
  | 
39  | 0  |     mdnid = ossl_digest_get_approved_nid(md);  | 
40  | 0  |     if (mdnid == NID_undef)  | 
41  | 0  |         mdnid = ossl_digest_md_to_nid(md, name_to_nid, OSSL_NELEM(name_to_nid));  | 
42  | 0  |     return mdnid;  | 
43  | 0  | }  |