]> git.ipfire.org Git - thirdparty/openssl.git/blame - include/openssl/core_numbers.h
rand: core APIs for provider friendly random.
[thirdparty/openssl.git] / include / openssl / core_numbers.h
CommitLineData
4c2883a9 1/*
33388b44 2 * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
4c2883a9
RL
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
ae4186b0
DMSP
10#ifndef OPENSSL_CORE_NUMBERS_H
11# define OPENSSL_CORE_NUMBERS_H
4c2883a9 12
3593266d 13# include <stdarg.h>
4c2883a9
RL
14# include <openssl/core.h>
15
16# ifdef __cplusplus
17extern "C" {
18# endif
19
20/*-
21 * Identities
22 * ----------
23 *
24 * All series start with 1, to allow 0 to be an array terminator.
25 * For any FUNC identity, we also provide a function signature typedef
26 * and a static inline function to extract a function pointer from a
27 * OSSL_DISPATCH element in a type safe manner.
28 *
29 * Names:
30 * for any function base name 'foo' (uppercase form 'FOO'), we will have
31 * the following:
79c44b4e 32 * - a macro for the identity with the name OSSL_FUNC_'FOO' or derivatives
4c2883a9
RL
33 * thereof (to be specified further down)
34 * - a function signature typedef with the name OSSL_'foo'_fn
35 * - a function pointer extractor function with the name OSSL_'foo'
36 */
37
b60cba3c
RS
38/*
39 * Helper macro to create the function signature typedef and the extractor
40 * |type| is the return-type of the function, |name| is the name of the
41 * function to fetch, and |args| is a parenthesized list of parameters
42 * for the function (that is, it is |name|'s function signature).
43 */
4c2883a9
RL
44#define OSSL_CORE_MAKE_FUNC(type,name,args) \
45 typedef type (OSSL_##name##_fn)args; \
46 static ossl_inline \
47 OSSL_##name##_fn *OSSL_get_##name(const OSSL_DISPATCH *opf) \
48 { \
49 return (OSSL_##name##_fn *)opf->function; \
50 }
51
52/*
53 * Core function identities, for the two OSSL_DISPATCH tables being passed
54 * in the OSSL_provider_init call.
55 *
56 * 0 serves as a marker for the end of the OSSL_DISPATCH array, and must
57 * therefore NEVER be used as a function identity.
58 */
59/* Functions provided by the Core to the provider, reserved numbers 1-1023 */
dca97d00 60# define OSSL_FUNC_CORE_GETTABLE_PARAMS 1
26175013 61OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
d40b42ab 62 core_gettable_params,(const OSSL_CORE_HANDLE *prov))
4c2883a9 63# define OSSL_FUNC_CORE_GET_PARAMS 2
d40b42ab 64OSSL_CORE_MAKE_FUNC(int,core_get_params,(const OSSL_CORE_HANDLE *prov,
4e7991b4 65 OSSL_PARAM params[]))
da747958 66# define OSSL_FUNC_CORE_THREAD_START 3
d40b42ab 67OSSL_CORE_MAKE_FUNC(int,core_thread_start,(const OSSL_CORE_HANDLE *prov,
da747958 68 OSSL_thread_stop_handler_fn handfn))
49c64346 69# define OSSL_FUNC_CORE_GET_LIBRARY_CONTEXT 4
d40b42ab
MC
70OSSL_CORE_MAKE_FUNC(OPENSSL_CORE_CTX *,core_get_library_context,
71 (const OSSL_CORE_HANDLE *prov))
49c64346 72# define OSSL_FUNC_CORE_NEW_ERROR 5
d40b42ab 73OSSL_CORE_MAKE_FUNC(void,core_new_error,(const OSSL_CORE_HANDLE *prov))
49c64346
RL
74# define OSSL_FUNC_CORE_SET_ERROR_DEBUG 6
75OSSL_CORE_MAKE_FUNC(void,core_set_error_debug,
d40b42ab 76 (const OSSL_CORE_HANDLE *prov,
49c64346
RL
77 const char *file, int line, const char *func))
78# define OSSL_FUNC_CORE_VSET_ERROR 7
79OSSL_CORE_MAKE_FUNC(void,core_vset_error,
d40b42ab 80 (const OSSL_CORE_HANDLE *prov,
49c64346 81 uint32_t reason, const char *fmt, va_list args))
7b131de2 82# define OSSL_FUNC_CORE_SET_ERROR_MARK 8
d40b42ab 83OSSL_CORE_MAKE_FUNC(int, core_set_error_mark, (const OSSL_CORE_HANDLE *prov))
7b131de2
RL
84# define OSSL_FUNC_CORE_CLEAR_LAST_ERROR_MARK 9
85OSSL_CORE_MAKE_FUNC(int, core_clear_last_error_mark,
d40b42ab 86 (const OSSL_CORE_HANDLE *prov))
d16d0b71 87# define OSSL_FUNC_CORE_POP_ERROR_TO_MARK 10
d40b42ab 88OSSL_CORE_MAKE_FUNC(int, core_pop_error_to_mark, (const OSSL_CORE_HANDLE *prov))
4c2883a9 89
b60cba3c 90/* Memory allocation, freeing, clearing. */
7b131de2 91#define OSSL_FUNC_CRYPTO_MALLOC 20
b60cba3c
RS
92OSSL_CORE_MAKE_FUNC(void *,
93 CRYPTO_malloc, (size_t num, const char *file, int line))
7b131de2 94#define OSSL_FUNC_CRYPTO_ZALLOC 21
b60cba3c
RS
95OSSL_CORE_MAKE_FUNC(void *,
96 CRYPTO_zalloc, (size_t num, const char *file, int line))
7b131de2 97#define OSSL_FUNC_CRYPTO_FREE 22
b60cba3c
RS
98OSSL_CORE_MAKE_FUNC(void,
99 CRYPTO_free, (void *ptr, const char *file, int line))
7b131de2 100#define OSSL_FUNC_CRYPTO_CLEAR_FREE 23
b60cba3c
RS
101OSSL_CORE_MAKE_FUNC(void,
102 CRYPTO_clear_free, (void *ptr, size_t num, const char *file, int line))
7b131de2 103#define OSSL_FUNC_CRYPTO_REALLOC 24
b60cba3c
RS
104OSSL_CORE_MAKE_FUNC(void *,
105 CRYPTO_realloc, (void *addr, size_t num, const char *file, int line))
7b131de2 106#define OSSL_FUNC_CRYPTO_CLEAR_REALLOC 25
b60cba3c 107OSSL_CORE_MAKE_FUNC(void *,
784883fc
SL
108 CRYPTO_clear_realloc, (void *addr, size_t old_num, size_t num,
109 const char *file, int line))
7b131de2 110#define OSSL_FUNC_CRYPTO_SECURE_MALLOC 26
b60cba3c
RS
111OSSL_CORE_MAKE_FUNC(void *,
112 CRYPTO_secure_malloc, (size_t num, const char *file, int line))
7b131de2 113#define OSSL_FUNC_CRYPTO_SECURE_ZALLOC 27
b60cba3c
RS
114OSSL_CORE_MAKE_FUNC(void *,
115 CRYPTO_secure_zalloc, (size_t num, const char *file, int line))
7b131de2 116#define OSSL_FUNC_CRYPTO_SECURE_FREE 28
b60cba3c
RS
117OSSL_CORE_MAKE_FUNC(void,
118 CRYPTO_secure_free, (void *ptr, const char *file, int line))
7b131de2 119#define OSSL_FUNC_CRYPTO_SECURE_CLEAR_FREE 29
b60cba3c 120OSSL_CORE_MAKE_FUNC(void,
784883fc
SL
121 CRYPTO_secure_clear_free, (void *ptr, size_t num, const char *file,
122 int line))
7b131de2 123#define OSSL_FUNC_CRYPTO_SECURE_ALLOCATED 30
b60cba3c
RS
124OSSL_CORE_MAKE_FUNC(int,
125 CRYPTO_secure_allocated, (const void *ptr))
7b131de2 126#define OSSL_FUNC_OPENSSL_CLEANSE 31
b60cba3c
RS
127OSSL_CORE_MAKE_FUNC(void,
128 OPENSSL_cleanse, (void *ptr, size_t len))
b60cba3c 129
25e60144 130/* Bio functions provided by the core */
7b131de2
RL
131#define OSSL_FUNC_BIO_NEW_FILE 40
132#define OSSL_FUNC_BIO_NEW_MEMBUF 41
133#define OSSL_FUNC_BIO_READ_EX 42
d40b42ab
MC
134#define OSSL_FUNC_BIO_WRITE_EX 43
135#define OSSL_FUNC_BIO_FREE 44
136#define OSSL_FUNC_BIO_VPRINTF 45
137#define OSSL_FUNC_BIO_VSNPRINTF 46
138
139OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_file, (const char *filename,
140 const char *mode))
141OSSL_CORE_MAKE_FUNC(OSSL_CORE_BIO *, BIO_new_membuf, (const void *buf, int len))
142OSSL_CORE_MAKE_FUNC(int, BIO_read_ex, (OSSL_CORE_BIO *bio, void *data,
143 size_t data_len, size_t *bytes_read))
144OSSL_CORE_MAKE_FUNC(int, BIO_write_ex, (OSSL_CORE_BIO *bio, const void *data,
145 size_t data_len, size_t *written))
146OSSL_CORE_MAKE_FUNC(int, BIO_free, (OSSL_CORE_BIO *bio))
147OSSL_CORE_MAKE_FUNC(int, BIO_vprintf, (OSSL_CORE_BIO *bio, const char *format,
63665fff 148 va_list args))
d16d0b71
SL
149OSSL_CORE_MAKE_FUNC(int, BIO_vsnprintf,
150 (char *buf, size_t n, const char *fmt, va_list args))
25e60144 151
7b131de2 152#define OSSL_FUNC_SELF_TEST_CB 100
d40b42ab 153OSSL_CORE_MAKE_FUNC(void, self_test_cb, (OPENSSL_CORE_CTX *ctx, OSSL_CALLBACK **cb,
36fc5fc6
SL
154 void **cbarg))
155
4c2883a9 156/* Functions provided by the provider to the Core, reserved numbers 1024-1535 */
72bfc958 157# define OSSL_FUNC_PROVIDER_TEARDOWN 1024
a39eb840 158OSSL_CORE_MAKE_FUNC(void,provider_teardown,(void *provctx))
72bfc958 159# define OSSL_FUNC_PROVIDER_GETTABLE_PARAMS 1025
26175013 160OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
dca97d00 161 provider_gettable_params,(void *provctx))
72bfc958 162# define OSSL_FUNC_PROVIDER_GET_PARAMS 1026
a39eb840 163OSSL_CORE_MAKE_FUNC(int,provider_get_params,(void *provctx,
4e7991b4 164 OSSL_PARAM params[]))
72bfc958 165# define OSSL_FUNC_PROVIDER_QUERY_OPERATION 1027
099bd339 166OSSL_CORE_MAKE_FUNC(const OSSL_ALGORITHM *,provider_query_operation,
b0f3c594 167 (void *provctx, int operation_id, int *no_store))
6ebc2f56
RL
168# define OSSL_FUNC_PROVIDER_GET_REASON_STRINGS 1028
169OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,provider_get_reason_strings,
170 (void *provctx))
72bfc958
MC
171# define OSSL_FUNC_PROVIDER_GET_CAPABILITIES 1029
172OSSL_CORE_MAKE_FUNC(int, provider_get_capabilities, (void *provctx,
173 const char *capability, OSSL_CALLBACK *cb, void *arg))
4c2883a9 174
784883fc 175/* Operations */
3653d0c2 176
2893111f 177# define OSSL_OP_DIGEST 1
784883fc
SL
178# define OSSL_OP_CIPHER 2 /* Symmetric Ciphers */
179# define OSSL_OP_MAC 3
ad1700c7 180# define OSSL_OP_KDF 4
15dfa092 181# define OSSL_OP_RAND 5
784883fc
SL
182# define OSSL_OP_KEYMGMT 10
183# define OSSL_OP_KEYEXCH 11
dfcb5d29 184# define OSSL_OP_SIGNATURE 12
2c938e2e 185# define OSSL_OP_ASYM_CIPHER 13
0d003c52
RL
186/* New section for non-EVP operations */
187# define OSSL_OP_SERIALIZER 20
784883fc 188/* Highest known operation number */
0d003c52 189# define OSSL_OP__HIGHEST 20
784883fc
SL
190
191/* Digests */
2893111f
RL
192
193# define OSSL_FUNC_DIGEST_NEWCTX 1
194# define OSSL_FUNC_DIGEST_INIT 2
195# define OSSL_FUNC_DIGEST_UPDATE 3
196# define OSSL_FUNC_DIGEST_FINAL 4
197# define OSSL_FUNC_DIGEST_DIGEST 5
198# define OSSL_FUNC_DIGEST_FREECTX 6
199# define OSSL_FUNC_DIGEST_DUPCTX 7
200# define OSSL_FUNC_DIGEST_GET_PARAMS 8
92d9d0ae
RL
201# define OSSL_FUNC_DIGEST_SET_CTX_PARAMS 9
202# define OSSL_FUNC_DIGEST_GET_CTX_PARAMS 10
ae3ff60e
RL
203# define OSSL_FUNC_DIGEST_GETTABLE_PARAMS 11
204# define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS 12
205# define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS 13
df05f2ce 206
a39eb840
RL
207OSSL_CORE_MAKE_FUNC(void *, OP_digest_newctx, (void *provctx))
208OSSL_CORE_MAKE_FUNC(int, OP_digest_init, (void *dctx))
3653d0c2 209OSSL_CORE_MAKE_FUNC(int, OP_digest_update,
a39eb840 210 (void *dctx, const unsigned char *in, size_t inl))
3653d0c2 211OSSL_CORE_MAKE_FUNC(int, OP_digest_final,
a39eb840
RL
212 (void *dctx,
213 unsigned char *out, size_t *outl, size_t outsz))
3653d0c2 214OSSL_CORE_MAKE_FUNC(int, OP_digest_digest,
a39eb840 215 (void *provctx, const unsigned char *in, size_t inl,
8ccf2ffb 216 unsigned char *out, size_t *outl, size_t outsz))
df05f2ce 217
a39eb840
RL
218OSSL_CORE_MAKE_FUNC(void, OP_digest_freectx, (void *dctx))
219OSSL_CORE_MAKE_FUNC(void *, OP_digest_dupctx, (void *dctx))
d5e5e2ff 220
2893111f 221OSSL_CORE_MAKE_FUNC(int, OP_digest_get_params, (OSSL_PARAM params[]))
92d9d0ae 222OSSL_CORE_MAKE_FUNC(int, OP_digest_set_ctx_params,
2893111f 223 (void *vctx, const OSSL_PARAM params[]))
92d9d0ae 224OSSL_CORE_MAKE_FUNC(int, OP_digest_get_ctx_params,
2893111f 225 (void *vctx, OSSL_PARAM params[]))
ae3ff60e
RL
226OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_digest_gettable_params, (void))
227OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_digest_settable_ctx_params, (void))
228OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_digest_gettable_ctx_params, (void))
df05f2ce
MC
229
230/* Symmetric Ciphers */
231
df05f2ce
MC
232# define OSSL_FUNC_CIPHER_NEWCTX 1
233# define OSSL_FUNC_CIPHER_ENCRYPT_INIT 2
234# define OSSL_FUNC_CIPHER_DECRYPT_INIT 3
235# define OSSL_FUNC_CIPHER_UPDATE 4
236# define OSSL_FUNC_CIPHER_FINAL 5
718b133a
MC
237# define OSSL_FUNC_CIPHER_CIPHER 6
238# define OSSL_FUNC_CIPHER_FREECTX 7
239# define OSSL_FUNC_CIPHER_DUPCTX 8
80942379 240# define OSSL_FUNC_CIPHER_GET_PARAMS 9
92d9d0ae
RL
241# define OSSL_FUNC_CIPHER_GET_CTX_PARAMS 10
242# define OSSL_FUNC_CIPHER_SET_CTX_PARAMS 11
ae3ff60e
RL
243# define OSSL_FUNC_CIPHER_GETTABLE_PARAMS 12
244# define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS 13
245# define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS 14
df05f2ce 246
a39eb840
RL
247OSSL_CORE_MAKE_FUNC(void *, OP_cipher_newctx, (void *provctx))
248OSSL_CORE_MAKE_FUNC(int, OP_cipher_encrypt_init, (void *cctx,
df05f2ce 249 const unsigned char *key,
344cfa34
MC
250 size_t keylen,
251 const unsigned char *iv,
252 size_t ivlen))
a39eb840 253OSSL_CORE_MAKE_FUNC(int, OP_cipher_decrypt_init, (void *cctx,
df05f2ce 254 const unsigned char *key,
344cfa34
MC
255 size_t keylen,
256 const unsigned char *iv,
257 size_t ivlen))
df05f2ce 258OSSL_CORE_MAKE_FUNC(int, OP_cipher_update,
a39eb840
RL
259 (void *cctx,
260 unsigned char *out, size_t *outl, size_t outsize,
df05f2ce
MC
261 const unsigned char *in, size_t inl))
262OSSL_CORE_MAKE_FUNC(int, OP_cipher_final,
a39eb840
RL
263 (void *cctx,
264 unsigned char *out, size_t *outl, size_t outsize))
df05f2ce 265OSSL_CORE_MAKE_FUNC(int, OP_cipher_cipher,
a39eb840 266 (void *cctx,
f79858ac
RL
267 unsigned char *out, size_t *outl, size_t outsize,
268 const unsigned char *in, size_t inl))
a39eb840
RL
269OSSL_CORE_MAKE_FUNC(void, OP_cipher_freectx, (void *cctx))
270OSSL_CORE_MAKE_FUNC(void *, OP_cipher_dupctx, (void *cctx))
4e7991b4 271OSSL_CORE_MAKE_FUNC(int, OP_cipher_get_params, (OSSL_PARAM params[]))
92d9d0ae 272OSSL_CORE_MAKE_FUNC(int, OP_cipher_get_ctx_params, (void *cctx,
4e7991b4 273 OSSL_PARAM params[]))
92d9d0ae 274OSSL_CORE_MAKE_FUNC(int, OP_cipher_set_ctx_params, (void *cctx,
718b133a 275 const OSSL_PARAM params[]))
784883fc
SL
276OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_cipher_gettable_params, (void))
277OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_cipher_settable_ctx_params, (void))
278OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_cipher_gettable_ctx_params, (void))
df05f2ce 279
e74bd290
RL
280/* MACs */
281
e74bd290
RL
282# define OSSL_FUNC_MAC_NEWCTX 1
283# define OSSL_FUNC_MAC_DUPCTX 2
284# define OSSL_FUNC_MAC_FREECTX 3
285# define OSSL_FUNC_MAC_INIT 4
286# define OSSL_FUNC_MAC_UPDATE 5
287# define OSSL_FUNC_MAC_FINAL 6
784883fc
SL
288# define OSSL_FUNC_MAC_GET_PARAMS 7
289# define OSSL_FUNC_MAC_GET_CTX_PARAMS 8
290# define OSSL_FUNC_MAC_SET_CTX_PARAMS 9
291# define OSSL_FUNC_MAC_GETTABLE_PARAMS 10
292# define OSSL_FUNC_MAC_GETTABLE_CTX_PARAMS 11
293# define OSSL_FUNC_MAC_SETTABLE_CTX_PARAMS 12
e74bd290
RL
294
295OSSL_CORE_MAKE_FUNC(void *, OP_mac_newctx, (void *provctx))
296OSSL_CORE_MAKE_FUNC(void *, OP_mac_dupctx, (void *src))
297OSSL_CORE_MAKE_FUNC(void, OP_mac_freectx, (void *mctx))
298OSSL_CORE_MAKE_FUNC(size_t, OP_mac_size, (void *mctx))
299OSSL_CORE_MAKE_FUNC(int, OP_mac_init, (void *mctx))
300OSSL_CORE_MAKE_FUNC(int, OP_mac_update,
301 (void *mctx, const unsigned char *in, size_t inl))
302OSSL_CORE_MAKE_FUNC(int, OP_mac_final,
303 (void *mctx,
304 unsigned char *out, size_t *outl, size_t outsize))
305OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_mac_gettable_params, (void))
306OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_mac_gettable_ctx_params, (void))
307OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_mac_settable_ctx_params, (void))
308OSSL_CORE_MAKE_FUNC(int, OP_mac_get_params, (OSSL_PARAM params[]))
92d9d0ae 309OSSL_CORE_MAKE_FUNC(int, OP_mac_get_ctx_params,
e74bd290 310 (void *mctx, OSSL_PARAM params[]))
92d9d0ae 311OSSL_CORE_MAKE_FUNC(int, OP_mac_set_ctx_params,
e74bd290
RL
312 (void *mctx, const OSSL_PARAM params[]))
313
2f755701 314/* KDFs and PRFs */
2f755701
P
315
316# define OSSL_FUNC_KDF_NEWCTX 1
317# define OSSL_FUNC_KDF_DUPCTX 2
318# define OSSL_FUNC_KDF_FREECTX 3
319# define OSSL_FUNC_KDF_RESET 4
320# define OSSL_FUNC_KDF_DERIVE 5
321# define OSSL_FUNC_KDF_GETTABLE_PARAMS 6
322# define OSSL_FUNC_KDF_GETTABLE_CTX_PARAMS 7
323# define OSSL_FUNC_KDF_SETTABLE_CTX_PARAMS 8
324# define OSSL_FUNC_KDF_GET_PARAMS 9
325# define OSSL_FUNC_KDF_GET_CTX_PARAMS 10
326# define OSSL_FUNC_KDF_SET_CTX_PARAMS 11
327
328OSSL_CORE_MAKE_FUNC(void *, OP_kdf_newctx, (void *provctx))
329OSSL_CORE_MAKE_FUNC(void *, OP_kdf_dupctx, (void *src))
330OSSL_CORE_MAKE_FUNC(void, OP_kdf_freectx, (void *kctx))
331OSSL_CORE_MAKE_FUNC(void, OP_kdf_reset, (void *kctx))
332OSSL_CORE_MAKE_FUNC(int, OP_kdf_derive, (void *kctx, unsigned char *key,
333 size_t keylen))
334OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_kdf_gettable_params, (void))
335OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_kdf_gettable_ctx_params, (void))
336OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_kdf_settable_ctx_params, (void))
337OSSL_CORE_MAKE_FUNC(int, OP_kdf_get_params, (OSSL_PARAM params[]))
338OSSL_CORE_MAKE_FUNC(int, OP_kdf_get_ctx_params,
339 (void *kctx, OSSL_PARAM params[]))
340OSSL_CORE_MAKE_FUNC(int, OP_kdf_set_ctx_params,
341 (void *kctx, const OSSL_PARAM params[]))
342
15dfa092
P
343/* RAND */
344
345# define OSSL_FUNC_RAND_NEWCTX 1
346# define OSSL_FUNC_RAND_FREECTX 2
347# define OSSL_FUNC_RAND_INSTANTIATE 3
348# define OSSL_FUNC_RAND_UNINSTANTIATE 4
349# define OSSL_FUNC_RAND_GENERATE 5
350# define OSSL_FUNC_RAND_RESEED 6
351# define OSSL_FUNC_RAND_NONCE 7
352# define OSSL_FUNC_RAND_ENABLE_LOCKING 8
353# define OSSL_FUNC_RAND_LOCK 9
354# define OSSL_FUNC_RAND_UNLOCK 10
355# define OSSL_FUNC_RAND_GETTABLE_PARAMS 11
356# define OSSL_FUNC_RAND_GETTABLE_CTX_PARAMS 12
357# define OSSL_FUNC_RAND_SETTABLE_CTX_PARAMS 13
358# define OSSL_FUNC_RAND_GET_PARAMS 14
359# define OSSL_FUNC_RAND_GET_CTX_PARAMS 15
360# define OSSL_FUNC_RAND_SET_CTX_PARAMS 16
361# define OSSL_FUNC_RAND_SET_CALLBACKS 17
362
363OSSL_CORE_MAKE_FUNC(void *, OP_rand_newctx,
364 (void *provctx, int secure, unsigned int df, void *parent,
365 const OSSL_DISPATCH *parent_calls))
366OSSL_CORE_MAKE_FUNC(void, OP_rand_freectx, (void *vctx))
367OSSL_CORE_MAKE_FUNC(int, OP_rand_instantiate,
368 (void *vdrbg, int strength, int prediction_resistance,
369 const unsigned char *pstr, size_t pstr_len))
370OSSL_CORE_MAKE_FUNC(int, OP_rand_uninstantiate, (void *vdrbg))
371OSSL_CORE_MAKE_FUNC(int, OP_rand_generate,
372 (void *vctx, unsigned char *out, size_t outlen,
373 int strength, int prediction_resistance,
374 const unsigned char *addin, size_t addin_len))
375OSSL_CORE_MAKE_FUNC(int, OP_rand_reseed,
376 (void *vctx, int prediction_resistance,
377 const unsigned char *addin, size_t addin_len))
378OSSL_CORE_MAKE_FUNC(int, OP_rand_nonce,
379 (void *vctx, unsigned char *out, size_t outlen))
380OSSL_CORE_MAKE_FUNC(int, OP_rand_set_callbacks,
381 (void *vctx,
382 OSSL_CALLBACK *get_entropy, OSSL_CALLBACK *cleanup_entropy,
383 OSSL_CALLBACK *get_nonce, OSSL_CALLBACK *cleanup_nonce))
384OSSL_CORE_MAKE_FUNC(int, OP_rand_enable_locking, (void *vctx))
385OSSL_CORE_MAKE_FUNC(int, OP_rand_lock, (void *vctx))
386OSSL_CORE_MAKE_FUNC(void, OP_rand_unlock, (void *vctx))
387OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_rand_gettable_params, (void))
388OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_rand_gettable_ctx_params, (void))
389OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_rand_settable_ctx_params, (void))
390OSSL_CORE_MAKE_FUNC(int, OP_rand_get_params, (OSSL_PARAM params[]))
391OSSL_CORE_MAKE_FUNC(int, OP_rand_get_ctx_params,
392 (void *vctx, OSSL_PARAM params[]))
393OSSL_CORE_MAKE_FUNC(int, OP_rand_set_ctx_params,
394 (void *vctx, const OSSL_PARAM params[]))
395
a94a3e0d
RL
396/*-
397 * Key management
398 *
b305452f
RL
399 * The Key Management takes care of provider side key objects, and includes
400 * all current functionality to create them, destroy them, set parameters
401 * and key material, etc, essentially everything that manipulates the keys
402 * themselves and their parameters.
a94a3e0d 403 *
b305452f
RL
404 * The key objects are commonly refered to as |keydata|, and it MUST be able
405 * to contain parameters if the key has any, the public key and the private
406 * key. All parts are optional, but their presence determines what can be
407 * done with the key object in terms of encryption, signature, and so on.
408 * The assumption from libcrypto is that the key object contains any of the
409 * following data combinations:
410 *
411 * - parameters only
412 * - public key only
413 * - public key + private key
414 * - parameters + public key
415 * - parameters + public key + private key
416 *
417 * What "parameters", "public key" and "private key" means in detail is left
418 * to the implementation. In the case of DH and DSA, they would typically
419 * include domain parameters, while for certain variants of RSA, they would
420 * typically include PSS or OAEP parameters.
421 *
422 * Key objects are created with OP_keymgmt_new() and destroyed with
423 * Op_keymgmt_free(). Key objects can have data filled in with
424 * OP_keymgmt_import().
425 *
426 * Three functions are made available to check what selection of data is
427 * present in a key object: OP_keymgmt_has_parameters(),
428 * OP_keymgmt_has_public_key(), and OP_keymgmt_has_private_key(),
a94a3e0d
RL
429 */
430
b305452f
RL
431/* Key data subset selection - individual bits */
432# define OSSL_KEYMGMT_SELECT_PRIVATE_KEY 0x01
433# define OSSL_KEYMGMT_SELECT_PUBLIC_KEY 0x02
434# define OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS 0x04
435# define OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS 0x80
436
437/* Key data subset selection - combinations */
438# define OSSL_KEYMGMT_SELECT_ALL_PARAMETERS \
439 ( OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS \
440 | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS)
441# define OSSL_KEYMGMT_SELECT_KEYPAIR \
442 ( OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY )
443# define OSSL_KEYMGMT_SELECT_ALL \
444 ( OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS )
445
1a5632e0 446/* Basic key object creation */
b305452f 447# define OSSL_FUNC_KEYMGMT_NEW 1
b305452f 448OSSL_CORE_MAKE_FUNC(void *, OP_keymgmt_new, (void *provctx))
1a5632e0
RL
449
450/* Generation, a more complex constructor */
2b9add69
RL
451# define OSSL_FUNC_KEYMGMT_GEN_INIT 2
452# define OSSL_FUNC_KEYMGMT_GEN_SET_TEMPLATE 3
453# define OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS 4
454# define OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS 5
5e77b79a
SL
455# define OSSL_FUNC_KEYMGMT_GEN 6
456# define OSSL_FUNC_KEYMGMT_GEN_CLEANUP 7
1a5632e0
RL
457OSSL_CORE_MAKE_FUNC(void *, OP_keymgmt_gen_init,
458 (void *provctx, int selection))
459OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_gen_set_template,
460 (void *genctx, void *templ))
461OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_gen_set_params,
462 (void *genctx, const OSSL_PARAM params[]))
463OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
464 OP_keymgmt_gen_settable_params, (void *provctx))
2b9add69
RL
465OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_gen_get_params,
466 (void *genctx, OSSL_PARAM params[]))
467OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *,
468 OP_keymgmt_gen_gettable_params, (void *provctx))
1a5632e0
RL
469OSSL_CORE_MAKE_FUNC(void *, OP_keymgmt_gen,
470 (void *genctx, OSSL_CALLBACK *cb, void *cbarg))
471OSSL_CORE_MAKE_FUNC(void, OP_keymgmt_gen_cleanup, (void *genctx))
472
473/* Basic key object destruction */
2b9add69 474# define OSSL_FUNC_KEYMGMT_FREE 10
b305452f
RL
475OSSL_CORE_MAKE_FUNC(void, OP_keymgmt_free, (void *keydata))
476
477/* Key object information, with discovery */
2b9add69
RL
478#define OSSL_FUNC_KEYMGMT_GET_PARAMS 11
479#define OSSL_FUNC_KEYMGMT_GETTABLE_PARAMS 12
b305452f
RL
480OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_get_params,
481 (void *keydata, OSSL_PARAM params[]))
482OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keymgmt_gettable_params, (void))
483
2b9add69
RL
484#define OSSL_FUNC_KEYMGMT_SET_PARAMS 13
485#define OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS 14
4fe54d67
NT
486OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_set_params,
487 (void *keydata, const OSSL_PARAM params[]))
488OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keymgmt_settable_params, (void))
489
b305452f
RL
490/* Key checks - discovery of supported operations */
491# define OSSL_FUNC_KEYMGMT_QUERY_OPERATION_NAME 20
492OSSL_CORE_MAKE_FUNC(const char *, OP_keymgmt_query_operation_name,
e62a45b6
RL
493 (int operation_id))
494
b305452f
RL
495/* Key checks - key data content checks */
496# define OSSL_FUNC_KEYMGMT_HAS 21
497OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_has, (void *keydata, int selection))
498
499/* Key checks - validation */
500# define OSSL_FUNC_KEYMGMT_VALIDATE 22
501OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_validate, (void *keydata, int selection))
502
bee5d6cd
RL
503/* Key checks - matching */
504# define OSSL_FUNC_KEYMGMT_MATCH 23
505OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_match,
506 (const void *keydata1, const void *keydata2,
507 int selection))
508
13697f1c 509/* Import and export functions, with discovery */
b305452f
RL
510# define OSSL_FUNC_KEYMGMT_IMPORT 40
511# define OSSL_FUNC_KEYMGMT_IMPORT_TYPES 41
512# define OSSL_FUNC_KEYMGMT_EXPORT 42
513# define OSSL_FUNC_KEYMGMT_EXPORT_TYPES 43
514OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_import,
515 (void *keydata, int selection, const OSSL_PARAM params[]))
516OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keymgmt_import_types,
517 (int selection))
518OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_export,
519 (void *keydata, int selection,
520 OSSL_CALLBACK *param_cb, void *cbarg))
521OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keymgmt_export_types,
522 (int selection))
12603de6 523
13697f1c
RL
524/* Copy function, only works for matching keymgmt */
525# define OSSL_FUNC_KEYMGMT_COPY 44
526OSSL_CORE_MAKE_FUNC(int, OP_keymgmt_copy,
527 ( void *keydata_to, const void *keydata_from,
528 int selection))
529
ff64702b
MC
530/* Key Exchange */
531
ff64702b
MC
532# define OSSL_FUNC_KEYEXCH_NEWCTX 1
533# define OSSL_FUNC_KEYEXCH_INIT 2
534# define OSSL_FUNC_KEYEXCH_DERIVE 3
535# define OSSL_FUNC_KEYEXCH_SET_PEER 4
536# define OSSL_FUNC_KEYEXCH_FREECTX 5
537# define OSSL_FUNC_KEYEXCH_DUPCTX 6
9c45222d
MC
538# define OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS 7
539# define OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS 8
4fe54d67
NT
540# define OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS 9
541# define OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS 10
ff64702b
MC
542
543OSSL_CORE_MAKE_FUNC(void *, OP_keyexch_newctx, (void *provctx))
8b84b075 544OSSL_CORE_MAKE_FUNC(int, OP_keyexch_init, (void *ctx, void *provkey))
59972370
MC
545OSSL_CORE_MAKE_FUNC(int, OP_keyexch_derive, (void *ctx, unsigned char *secret,
546 size_t *secretlen, size_t outlen))
8b84b075 547OSSL_CORE_MAKE_FUNC(int, OP_keyexch_set_peer, (void *ctx, void *provkey))
ff64702b
MC
548OSSL_CORE_MAKE_FUNC(void, OP_keyexch_freectx, (void *ctx))
549OSSL_CORE_MAKE_FUNC(void *, OP_keyexch_dupctx, (void *ctx))
9c45222d
MC
550OSSL_CORE_MAKE_FUNC(int, OP_keyexch_set_ctx_params, (void *ctx,
551 const OSSL_PARAM params[]))
552OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keyexch_settable_ctx_params,
553 (void))
4fe54d67
NT
554OSSL_CORE_MAKE_FUNC(int, OP_keyexch_get_ctx_params, (void *ctx,
555 OSSL_PARAM params[]))
556OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_keyexch_gettable_ctx_params,
557 (void))
ff64702b 558
dfcb5d29
MC
559/* Signature */
560
561# define OSSL_FUNC_SIGNATURE_NEWCTX 1
562# define OSSL_FUNC_SIGNATURE_SIGN_INIT 2
563# define OSSL_FUNC_SIGNATURE_SIGN 3
390acbeb
MC
564# define OSSL_FUNC_SIGNATURE_VERIFY_INIT 4
565# define OSSL_FUNC_SIGNATURE_VERIFY 5
566# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER_INIT 6
567# define OSSL_FUNC_SIGNATURE_VERIFY_RECOVER 7
d8c98d79
MC
568# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_INIT 8
569# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_UPDATE 9
570# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN_FINAL 10
eea1e780
MC
571# define OSSL_FUNC_SIGNATURE_DIGEST_SIGN 11
572# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_INIT 12
573# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_UPDATE 13
574# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY_FINAL 14
575# define OSSL_FUNC_SIGNATURE_DIGEST_VERIFY 15
576# define OSSL_FUNC_SIGNATURE_FREECTX 16
577# define OSSL_FUNC_SIGNATURE_DUPCTX 17
578# define OSSL_FUNC_SIGNATURE_GET_CTX_PARAMS 18
579# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_PARAMS 19
580# define OSSL_FUNC_SIGNATURE_SET_CTX_PARAMS 20
581# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_PARAMS 21
582# define OSSL_FUNC_SIGNATURE_GET_CTX_MD_PARAMS 22
583# define OSSL_FUNC_SIGNATURE_GETTABLE_CTX_MD_PARAMS 23
584# define OSSL_FUNC_SIGNATURE_SET_CTX_MD_PARAMS 24
585# define OSSL_FUNC_SIGNATURE_SETTABLE_CTX_MD_PARAMS 25
dfcb5d29 586
2c6094ba
RL
587OSSL_CORE_MAKE_FUNC(void *, OP_signature_newctx, (void *provctx,
588 const char *propq))
dfcb5d29
MC
589OSSL_CORE_MAKE_FUNC(int, OP_signature_sign_init, (void *ctx, void *provkey))
590OSSL_CORE_MAKE_FUNC(int, OP_signature_sign, (void *ctx, unsigned char *sig,
591 size_t *siglen, size_t sigsize,
592 const unsigned char *tbs,
593 size_t tbslen))
390acbeb
MC
594OSSL_CORE_MAKE_FUNC(int, OP_signature_verify_init, (void *ctx, void *provkey))
595OSSL_CORE_MAKE_FUNC(int, OP_signature_verify, (void *ctx,
596 const unsigned char *sig,
597 size_t siglen,
598 const unsigned char *tbs,
599 size_t tbslen))
600OSSL_CORE_MAKE_FUNC(int, OP_signature_verify_recover_init, (void *ctx,
601 void *provkey))
602OSSL_CORE_MAKE_FUNC(int, OP_signature_verify_recover, (void *ctx,
603 unsigned char *rout,
604 size_t *routlen,
605 size_t routsize,
606 const unsigned char *sig,
607 size_t siglen))
d8c98d79 608OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign_init,
2c6094ba 609 (void *ctx, const char *mdname, void *provkey))
d8c98d79
MC
610OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign_update,
611 (void *ctx, const unsigned char *data, size_t datalen))
612OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign_final,
613 (void *ctx, unsigned char *sig, size_t *siglen,
614 size_t sigsize))
eea1e780
MC
615OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_sign,
616 (void *ctx, unsigned char *sigret, size_t *siglen,
617 size_t sigsize, const unsigned char *tbs, size_t tbslen))
d8c98d79 618OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify_init,
2c6094ba 619 (void *ctx, const char *mdname, void *provkey))
d8c98d79
MC
620OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify_update,
621 (void *ctx, const unsigned char *data, size_t datalen))
622OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify_final,
623 (void *ctx, const unsigned char *sig, size_t siglen))
eea1e780
MC
624OSSL_CORE_MAKE_FUNC(int, OP_signature_digest_verify,
625 (void *ctx, const unsigned char *sig, size_t siglen,
626 const unsigned char *tbs, size_t tbslen))
dfcb5d29
MC
627OSSL_CORE_MAKE_FUNC(void, OP_signature_freectx, (void *ctx))
628OSSL_CORE_MAKE_FUNC(void *, OP_signature_dupctx, (void *ctx))
9c45222d
MC
629OSSL_CORE_MAKE_FUNC(int, OP_signature_get_ctx_params,
630 (void *ctx, OSSL_PARAM params[]))
631OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_signature_gettable_ctx_params,
632 (void))
633OSSL_CORE_MAKE_FUNC(int, OP_signature_set_ctx_params,
634 (void *ctx, const OSSL_PARAM params[]))
635OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_signature_settable_ctx_params,
636 (void))
d8c98d79
MC
637OSSL_CORE_MAKE_FUNC(int, OP_signature_get_ctx_md_params,
638 (void *ctx, OSSL_PARAM params[]))
639OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_signature_gettable_ctx_md_params,
640 (void *ctx))
641OSSL_CORE_MAKE_FUNC(int, OP_signature_set_ctx_md_params,
642 (void *ctx, const OSSL_PARAM params[]))
643OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_signature_settable_ctx_md_params,
644 (void *ctx))
dfcb5d29 645
2c938e2e
MC
646
647/* Asymmetric Ciphers */
648
649# define OSSL_FUNC_ASYM_CIPHER_NEWCTX 1
650# define OSSL_FUNC_ASYM_CIPHER_ENCRYPT_INIT 2
651# define OSSL_FUNC_ASYM_CIPHER_ENCRYPT 3
652# define OSSL_FUNC_ASYM_CIPHER_DECRYPT_INIT 4
653# define OSSL_FUNC_ASYM_CIPHER_DECRYPT 5
654# define OSSL_FUNC_ASYM_CIPHER_FREECTX 6
655# define OSSL_FUNC_ASYM_CIPHER_DUPCTX 7
656# define OSSL_FUNC_ASYM_CIPHER_GET_CTX_PARAMS 8
657# define OSSL_FUNC_ASYM_CIPHER_GETTABLE_CTX_PARAMS 9
658# define OSSL_FUNC_ASYM_CIPHER_SET_CTX_PARAMS 10
659# define OSSL_FUNC_ASYM_CIPHER_SETTABLE_CTX_PARAMS 11
660
661OSSL_CORE_MAKE_FUNC(void *, OP_asym_cipher_newctx, (void *provctx))
662OSSL_CORE_MAKE_FUNC(int, OP_asym_cipher_encrypt_init, (void *ctx, void *provkey))
663OSSL_CORE_MAKE_FUNC(int, OP_asym_cipher_encrypt, (void *ctx, unsigned char *out,
664 size_t *outlen,
665 size_t outsize,
666 const unsigned char *in,
667 size_t inlen))
668OSSL_CORE_MAKE_FUNC(int, OP_asym_cipher_decrypt_init, (void *ctx, void *provkey))
669OSSL_CORE_MAKE_FUNC(int, OP_asym_cipher_decrypt, (void *ctx, unsigned char *out,
670 size_t *outlen,
671 size_t outsize,
672 const unsigned char *in,
673 size_t inlen))
674OSSL_CORE_MAKE_FUNC(void, OP_asym_cipher_freectx, (void *ctx))
675OSSL_CORE_MAKE_FUNC(void *, OP_asym_cipher_dupctx, (void *ctx))
676OSSL_CORE_MAKE_FUNC(int, OP_asym_cipher_get_ctx_params,
677 (void *ctx, OSSL_PARAM params[]))
678OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_asym_cipher_gettable_ctx_params,
679 (void))
680OSSL_CORE_MAKE_FUNC(int, OP_asym_cipher_set_ctx_params,
681 (void *ctx, const OSSL_PARAM params[]))
682OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_asym_cipher_settable_ctx_params,
683 (void))
684
0d003c52
RL
685/* Serializers */
686# define OSSL_FUNC_SERIALIZER_NEWCTX 1
687# define OSSL_FUNC_SERIALIZER_FREECTX 2
688# define OSSL_FUNC_SERIALIZER_SET_CTX_PARAMS 3
689# define OSSL_FUNC_SERIALIZER_SETTABLE_CTX_PARAMS 4
690# define OSSL_FUNC_SERIALIZER_SERIALIZE_DATA 10
691# define OSSL_FUNC_SERIALIZER_SERIALIZE_OBJECT 11
692OSSL_CORE_MAKE_FUNC(void *, OP_serializer_newctx, (void *provctx))
693OSSL_CORE_MAKE_FUNC(void, OP_serializer_freectx, (void *ctx))
694OSSL_CORE_MAKE_FUNC(int, OP_serializer_set_ctx_params,
695 (void *ctx, const OSSL_PARAM params[]))
696OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_serializer_settable_ctx_params,
697 (void))
698
699OSSL_CORE_MAKE_FUNC(int, OP_serializer_serialize_data,
d40b42ab 700 (void *ctx, const OSSL_PARAM[], OSSL_CORE_BIO *out,
0d003c52
RL
701 OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg))
702OSSL_CORE_MAKE_FUNC(int, OP_serializer_serialize_object,
d40b42ab 703 (void *ctx, void *obj, OSSL_CORE_BIO *out,
0d003c52
RL
704 OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg))
705
4c2883a9
RL
706# ifdef __cplusplus
707}
708# endif
709
710#endif