VirtualBox

source: vbox/trunk/src/libs/openssl-3.4.1/crypto/indicator_core.c

Last change on this file was 109052, checked in by vboxsync, 4 weeks ago

openssl-3.4.1: Applied our changes, regenerated files, added missing files and functions. This time with a three way merge. ​bugref:10890

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 KB
Line 
1/*
2 * Copyright 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 <openssl/indicator.h>
11#include <openssl/core_names.h>
12#include <openssl/params.h>
13#include "internal/cryptlib.h"
14#include "crypto/context.h"
15
16typedef struct indicator_cb_st
17{
18 OSSL_INDICATOR_CALLBACK *cb;
19} INDICATOR_CB;
20
21void *ossl_indicator_set_callback_new(OSSL_LIB_CTX *ctx)
22{
23 INDICATOR_CB *cb;
24
25 cb = OPENSSL_zalloc(sizeof(*cb));
26 return cb;
27}
28
29void ossl_indicator_set_callback_free(void *cb)
30{
31 OPENSSL_free(cb);
32}
33
34static INDICATOR_CB *get_indicator_callback(OSSL_LIB_CTX *libctx)
35{
36 return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_INDICATOR_CB_INDEX);
37}
38
39void OSSL_INDICATOR_set_callback(OSSL_LIB_CTX *libctx,
40 OSSL_INDICATOR_CALLBACK *cb)
41{
42 INDICATOR_CB *icb = get_indicator_callback(libctx);
43
44 if (icb != NULL)
45 icb->cb = cb;
46}
47
48void OSSL_INDICATOR_get_callback(OSSL_LIB_CTX *libctx,
49 OSSL_INDICATOR_CALLBACK **cb)
50{
51 INDICATOR_CB *icb = get_indicator_callback(libctx);
52
53 if (cb != NULL)
54 *cb = (icb != NULL ? icb->cb : NULL);
55}
Note: See TracBrowser for help on using the repository browser.

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