VirtualBox

source: vbox/trunk/src/libs/openssl-3.0.7/providers/common/provider_ctx.c@ 98661

最後變更 在這個檔案從98661是 94320,由 vboxsync 提交於 3 年 前

libs/openssl-3.0.1: Export to OSE and fix copyright headers in Makefiles, bugref:10128

檔案大小: 1.3 KB
 
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
14PROV_CTX *ossl_prov_ctx_new(void)
15{
16 return OPENSSL_zalloc(sizeof(PROV_CTX));
17}
18
19void ossl_prov_ctx_free(PROV_CTX *ctx)
20{
21 OPENSSL_free(ctx);
22}
23
24void ossl_prov_ctx_set0_libctx(PROV_CTX *ctx, OSSL_LIB_CTX *libctx)
25{
26 if (ctx != NULL)
27 ctx->libctx = libctx;
28}
29
30void ossl_prov_ctx_set0_handle(PROV_CTX *ctx, const OSSL_CORE_HANDLE *handle)
31{
32 if (ctx != NULL)
33 ctx->handle = handle;
34}
35
36void ossl_prov_ctx_set0_core_bio_method(PROV_CTX *ctx, BIO_METHOD *corebiometh)
37{
38 if (ctx != NULL)
39 ctx->corebiometh = corebiometh;
40}
41
42OSSL_LIB_CTX *ossl_prov_ctx_get0_libctx(PROV_CTX *ctx)
43{
44 if (ctx == NULL)
45 return NULL;
46 return ctx->libctx;
47}
48
49const OSSL_CORE_HANDLE *ossl_prov_ctx_get0_handle(PROV_CTX *ctx)
50{
51 if (ctx == NULL)
52 return NULL;
53 return ctx->handle;
54}
55
56BIO_METHOD *ossl_prov_ctx_get0_core_bio_method(PROV_CTX *ctx)
57{
58 if (ctx == NULL)
59 return NULL;
60 return ctx->corebiometh;
61}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette