Coverage Report

Created: 2025-12-31 06:58

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl33/providers/common/provider_ctx.c
Line
Count
Source
1
/*
2
 * Copyright 2020 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 <stdlib.h>
11
#include "prov/provider_ctx.h"
12
#include "prov/bio.h"
13
14
PROV_CTX *ossl_prov_ctx_new(void)
15
99
{
16
99
    return OPENSSL_zalloc(sizeof(PROV_CTX));
17
99
}
18
19
void ossl_prov_ctx_free(PROV_CTX *ctx)
20
72
{
21
72
    OPENSSL_free(ctx);
22
72
}
23
24
void ossl_prov_ctx_set0_libctx(PROV_CTX *ctx, OSSL_LIB_CTX *libctx)
25
99
{
26
99
    if (ctx != NULL)
27
99
        ctx->libctx = libctx;
28
99
}
29
30
void ossl_prov_ctx_set0_handle(PROV_CTX *ctx, const OSSL_CORE_HANDLE *handle)
31
99
{
32
99
    if (ctx != NULL)
33
99
        ctx->handle = handle;
34
99
}
35
36
void ossl_prov_ctx_set0_core_bio_method(PROV_CTX *ctx, BIO_METHOD *corebiometh)
37
99
{
38
99
    if (ctx != NULL)
39
99
        ctx->corebiometh = corebiometh;
40
99
}
41
42
OSSL_LIB_CTX *ossl_prov_ctx_get0_libctx(PROV_CTX *ctx)
43
6.93M
{
44
6.93M
    if (ctx == NULL)
45
0
        return NULL;
46
6.93M
    return ctx->libctx;
47
6.93M
}
48
49
const OSSL_CORE_HANDLE *ossl_prov_ctx_get0_handle(PROV_CTX *ctx)
50
2.94k
{
51
2.94k
    if (ctx == NULL)
52
0
        return NULL;
53
2.94k
    return ctx->handle;
54
2.94k
}
55
56
BIO_METHOD *ossl_prov_ctx_get0_core_bio_method(PROV_CTX *ctx)
57
6.30M
{
58
6.30M
    if (ctx == NULL)
59
0
        return NULL;
60
6.30M
    return ctx->corebiometh;
61
6.30M
}