Coverage Report

Created: 2025-06-13 06:58

/src/openssl31/providers/common/securitycheck_default.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2020-2023 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_securitycheck_enabled(OSSL_LIB_CTX *libctx)
21
0
{
22
0
    return 0;
23
0
}
24
25
/* Disable the ems check in the default provider */
26
int ossl_tls1_prf_ems_check_enabled(OSSL_LIB_CTX *libctx)
27
12.3k
{
28
12.3k
    return 0;
29
12.3k
}
30
31
int ossl_digest_rsa_sign_get_md_nid(OSSL_LIB_CTX *ctx, const EVP_MD *md,
32
                                    ossl_unused int sha1_allowed)
33
55.2k
{
34
55.2k
    int mdnid;
35
36
55.2k
    static const OSSL_ITEM name_to_nid[] = {
37
55.2k
        { NID_md5,       OSSL_DIGEST_NAME_MD5       },
38
55.2k
        { NID_md5_sha1,  OSSL_DIGEST_NAME_MD5_SHA1  },
39
55.2k
        { NID_md2,       OSSL_DIGEST_NAME_MD2       },
40
55.2k
        { NID_md4,       OSSL_DIGEST_NAME_MD4       },
41
55.2k
        { NID_mdc2,      OSSL_DIGEST_NAME_MDC2      },
42
55.2k
        { NID_ripemd160, OSSL_DIGEST_NAME_RIPEMD160 },
43
55.2k
    };
44
45
55.2k
    mdnid = ossl_digest_get_approved_nid_with_sha1(ctx, md, 1);
46
55.2k
    if (mdnid == NID_undef)
47
795
        mdnid = ossl_digest_md_to_nid(md, name_to_nid, OSSL_NELEM(name_to_nid));
48
55.2k
    return mdnid;
49
55.2k
}