2 * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
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
10 #ifndef OSSL_INTERNAL_CORE_H
11 # define OSSL_INTERNAL_CORE_H
16 * ossl_method_ Core Method API
20 * construct an arbitrary method from a dispatch table found by looking
21 * up a match for the < operation_id, name, property > combination.
22 * constructor and destructor are the constructor and destructor for that
25 * These objects are normally cached, unless the provider says not to cache.
26 * However, force_cache can be used to force caching whatever the provider
27 * says (for example, because the application knows better).
29 typedef struct ossl_method_construct_method_st
{
31 void *(*alloc_tmp_store
)(void);
33 void (*dealloc_tmp_store
)(void *store
);
34 /* Get an already existing method from a store */
35 void *(*get
)(OPENSSL_CTX
*libctx
, void *store
, const char *propquery
,
37 /* Store a method in a store */
38 int (*put
)(OPENSSL_CTX
*libctx
, void *store
, const char *propdef
,
39 void *method
, void *data
);
40 /* Construct a new method */
41 void *(*construct
)(const OSSL_DISPATCH
*fns
, OSSL_PROVIDER
*prov
,
43 /* Destruct a method */
44 void (*destruct
)(void *method
);
45 } OSSL_METHOD_CONSTRUCT_METHOD
;
47 void *ossl_method_construct(OPENSSL_CTX
*ctx
, int operation_id
,
48 const char *name
, const char *properties
,
50 OSSL_METHOD_CONSTRUCT_METHOD
*mcm
, void *mcm_data
);