VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.2/include/internal/property.h@ 101021

Last change on this file since 101021 was 101021, checked in by vboxsync, 18 months ago

openssl-3.1.2: Applied and adjusted our OpenSSL changes to 3.1.0. bugref:10519

File size: 4.6 KB
Line 
1/*
2 * Copyright 2019-2022 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# ifndef RT_WITHOUT_PRAGMA_ONCE /* VBOX */
14# pragma once
15# endif /* VBOX */
16
17# include "internal/cryptlib.h"
18
19typedef struct ossl_method_store_st OSSL_METHOD_STORE;
20typedef struct ossl_property_list_st OSSL_PROPERTY_LIST;
21
22typedef enum {
23 OSSL_PROPERTY_TYPE_STRING, OSSL_PROPERTY_TYPE_NUMBER,
24 OSSL_PROPERTY_TYPE_VALUE_UNDEFINED
25} OSSL_PROPERTY_TYPE;
26typedef struct ossl_property_definition_st OSSL_PROPERTY_DEFINITION;
27
28/* Initialisation */
29int ossl_property_parse_init(OSSL_LIB_CTX *ctx);
30
31/* Property definition parser */
32OSSL_PROPERTY_LIST *ossl_parse_property(OSSL_LIB_CTX *ctx, const char *defn);
33/* Property query parser */
34OSSL_PROPERTY_LIST *ossl_parse_query(OSSL_LIB_CTX *ctx, const char *s,
35 int create_values);
36/* Property checker of query vs definition */
37int ossl_property_match_count(const OSSL_PROPERTY_LIST *query,
38 const OSSL_PROPERTY_LIST *defn);
39int ossl_property_is_enabled(OSSL_LIB_CTX *ctx, const char *property_name,
40 const OSSL_PROPERTY_LIST *prop_list);
41/* Free a parsed property list */
42void ossl_property_free(OSSL_PROPERTY_LIST *p);
43
44/* Get a property from a property list */
45const OSSL_PROPERTY_DEFINITION *
46ossl_property_find_property(const OSSL_PROPERTY_LIST *list,
47 OSSL_LIB_CTX *libctx, const char *name);
48OSSL_PROPERTY_TYPE ossl_property_get_type(const OSSL_PROPERTY_DEFINITION *prop);
49const char *ossl_property_get_string_value(OSSL_LIB_CTX *libctx,
50 const OSSL_PROPERTY_DEFINITION *prop);
51int64_t ossl_property_get_number_value(const OSSL_PROPERTY_DEFINITION *prop);
52
53
54/* Implementation store functions */
55OSSL_METHOD_STORE *ossl_method_store_new(OSSL_LIB_CTX *ctx);
56void ossl_method_store_free(OSSL_METHOD_STORE *store);
57
58int ossl_method_lock_store(OSSL_METHOD_STORE *store);
59int ossl_method_unlock_store(OSSL_METHOD_STORE *store);
60
61int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov,
62 int nid, const char *properties, void *method,
63 int (*method_up_ref)(void *),
64 void (*method_destruct)(void *));
65int ossl_method_store_remove(OSSL_METHOD_STORE *store, int nid,
66 const void *method);
67void ossl_method_store_do_all(OSSL_METHOD_STORE *store,
68 void (*fn)(int id, void *method, void *fnarg),
69 void *fnarg);
70int ossl_method_store_fetch(OSSL_METHOD_STORE *store,
71 int nid, const char *prop_query,
72 const OSSL_PROVIDER **prov, void **method);
73int ossl_method_store_remove_all_provided(OSSL_METHOD_STORE *store,
74 const OSSL_PROVIDER *prov);
75
76/* Get the global properties associate with the specified library context */
77OSSL_PROPERTY_LIST **ossl_ctx_global_properties(OSSL_LIB_CTX *ctx,
78 int loadconfig);
79
80/* property query cache functions */
81int ossl_method_store_cache_get(OSSL_METHOD_STORE *store, OSSL_PROVIDER *prov,
82 int nid, const char *prop_query, void **result);
83int ossl_method_store_cache_set(OSSL_METHOD_STORE *store, OSSL_PROVIDER *prov,
84 int nid, const char *prop_query, void *result,
85 int (*method_up_ref)(void *),
86 void (*method_destruct)(void *));
87
88__owur int ossl_method_store_cache_flush_all(OSSL_METHOD_STORE *store);
89
90/* Merge two property queries together */
91OSSL_PROPERTY_LIST *ossl_property_merge(const OSSL_PROPERTY_LIST *a,
92 const OSSL_PROPERTY_LIST *b);
93
94size_t ossl_property_list_to_string(OSSL_LIB_CTX *ctx,
95 const OSSL_PROPERTY_LIST *list, char *buf,
96 size_t bufsize);
97
98int ossl_global_properties_no_mirrored(OSSL_LIB_CTX *libctx);
99void ossl_global_properties_stop_mirroring(OSSL_LIB_CTX *libctx);
100
101#endif
Note: See TracBrowser for help on using the repository browser.

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