VirtualBox

source: vbox/trunk/src/libs/openssl-3.0.3/include/internal/property.h@ 96317

Last change on this file since 96317 was 94320, checked in by vboxsync, 3 years ago

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

File size: 4.2 KB
Line 
1/*
2 * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
3 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
4 *
5 * Licensed under the Apache License 2.0 (the "License"). You may not use
6 * this file except in compliance with the License. You can obtain a copy
7 * in the file LICENSE in the source distribution or at
8 * https://www.openssl.org/source/license.html
9 */
10
11#ifndef OSSL_INTERNAL_PROPERTY_H
12# define OSSL_INTERNAL_PROPERTY_H
13# pragma once
14
15# include "internal/cryptlib.h"
16
17typedef struct ossl_method_store_st OSSL_METHOD_STORE;
18typedef struct ossl_property_list_st OSSL_PROPERTY_LIST;
19
20typedef enum {
21 OSSL_PROPERTY_TYPE_STRING, OSSL_PROPERTY_TYPE_NUMBER,
22 OSSL_PROPERTY_TYPE_VALUE_UNDEFINED
23} OSSL_PROPERTY_TYPE;
24typedef struct ossl_property_definition_st OSSL_PROPERTY_DEFINITION;
25
26/* Initialisation */
27int ossl_property_parse_init(OSSL_LIB_CTX *ctx);
28
29/* Property definition parser */
30OSSL_PROPERTY_LIST *ossl_parse_property(OSSL_LIB_CTX *ctx, const char *defn);
31/* Property query parser */
32OSSL_PROPERTY_LIST *ossl_parse_query(OSSL_LIB_CTX *ctx, const char *s,
33 int create_values);
34/* Property checker of query vs definition */
35int ossl_property_match_count(const OSSL_PROPERTY_LIST *query,
36 const OSSL_PROPERTY_LIST *defn);
37int ossl_property_is_enabled(OSSL_LIB_CTX *ctx, const char *property_name,
38 const OSSL_PROPERTY_LIST *prop_list);
39/* Free a parsed property list */
40void ossl_property_free(OSSL_PROPERTY_LIST *p);
41
42/* Get a property from a property list */
43const OSSL_PROPERTY_DEFINITION *
44ossl_property_find_property(const OSSL_PROPERTY_LIST *list,
45 OSSL_LIB_CTX *libctx, const char *name);
46OSSL_PROPERTY_TYPE ossl_property_get_type(const OSSL_PROPERTY_DEFINITION *prop);
47const char *ossl_property_get_string_value(OSSL_LIB_CTX *libctx,
48 const OSSL_PROPERTY_DEFINITION *prop);
49int64_t ossl_property_get_number_value(const OSSL_PROPERTY_DEFINITION *prop);
50
51
52/* Implementation store functions */
53OSSL_METHOD_STORE *ossl_method_store_new(OSSL_LIB_CTX *ctx);
54void ossl_method_store_free(OSSL_METHOD_STORE *store);
55int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov,
56 int nid, const char *properties, void *method,
57 int (*method_up_ref)(void *),
58 void (*method_destruct)(void *));
59int ossl_method_store_remove(OSSL_METHOD_STORE *store, int nid,
60 const void *method);
61void ossl_method_store_do_all(OSSL_METHOD_STORE *store,
62 void (*fn)(int id, void *method, void *fnarg),
63 void *fnarg);
64int ossl_method_store_fetch(OSSL_METHOD_STORE *store,
65 int nid, const char *prop_query,
66 const OSSL_PROVIDER **prov, void **method);
67
68/* Get the global properties associate with the specified library context */
69OSSL_PROPERTY_LIST **ossl_ctx_global_properties(OSSL_LIB_CTX *ctx,
70 int loadconfig);
71
72/* property query cache functions */
73int ossl_method_store_cache_get(OSSL_METHOD_STORE *store, OSSL_PROVIDER *prov,
74 int nid, const char *prop_query, void **result);
75int ossl_method_store_cache_set(OSSL_METHOD_STORE *store, OSSL_PROVIDER *prov,
76 int nid, const char *prop_query, void *result,
77 int (*method_up_ref)(void *),
78 void (*method_destruct)(void *));
79
80__owur int ossl_method_store_flush_cache(OSSL_METHOD_STORE *store, int all);
81
82/* Merge two property queries together */
83OSSL_PROPERTY_LIST *ossl_property_merge(const OSSL_PROPERTY_LIST *a,
84 const OSSL_PROPERTY_LIST *b);
85
86size_t ossl_property_list_to_string(OSSL_LIB_CTX *ctx,
87 const OSSL_PROPERTY_LIST *list, char *buf,
88 size_t bufsize);
89
90int ossl_global_properties_no_mirrored(OSSL_LIB_CTX *libctx);
91void ossl_global_properties_stop_mirroring(OSSL_LIB_CTX *libctx);
92
93#endif
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