Path: blob/main/crypto/openssl/providers/common/securitycheck_default.c
48261 views
/*1* Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.2*3* Licensed under the Apache License 2.0 (the "License"). You may not use4* this file except in compliance with the License. You can obtain a copy5* in the file LICENSE in the source distribution or at6* https://www.openssl.org/source/license.html7*/89#include "internal/deprecated.h"1011#include <openssl/rsa.h>12#include <openssl/core.h>13#include <openssl/core_names.h>14#include <openssl/obj_mac.h>15#include "prov/securitycheck.h"16#include "internal/nelem.h"1718/* Disable the security checks in the default provider */19int ossl_fips_config_securitycheck_enabled(OSSL_LIB_CTX *libctx)20{21return 0;22}2324int ossl_digest_rsa_sign_get_md_nid(const EVP_MD *md)25{26int mdnid;2728static const OSSL_ITEM name_to_nid[] = {29{ NID_md5, OSSL_DIGEST_NAME_MD5 },30{ NID_md5_sha1, OSSL_DIGEST_NAME_MD5_SHA1 },31{ NID_md2, OSSL_DIGEST_NAME_MD2 },32{ NID_md4, OSSL_DIGEST_NAME_MD4 },33{ NID_mdc2, OSSL_DIGEST_NAME_MDC2 },34{ NID_ripemd160, OSSL_DIGEST_NAME_RIPEMD160 },35{ NID_sm3, OSSL_DIGEST_NAME_SM3 },36};3738mdnid = ossl_digest_get_approved_nid(md);39if (mdnid == NID_undef)40mdnid = ossl_digest_md_to_nid(md, name_to_nid, OSSL_NELEM(name_to_nid));41return mdnid;42}434445