Coverage Report

Created: 2025-06-13 06:58

/src/openssl32/providers/implementations/exchange/dh_exch.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2019-2023 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
/*
11
 * DH low level APIs are deprecated for public use, but still ok for
12
 * internal use.
13
 */
14
#include "internal/deprecated.h"
15
16
#include <string.h>
17
#include <openssl/crypto.h>
18
#include <openssl/core_dispatch.h>
19
#include <openssl/core_names.h>
20
#include <openssl/dh.h>
21
#include <openssl/err.h>
22
#include <openssl/proverr.h>
23
#include <openssl/params.h>
24
#include "prov/providercommon.h"
25
#include "prov/implementations.h"
26
#include "prov/provider_ctx.h"
27
#include "prov/securitycheck.h"
28
#include "crypto/dh.h"
29
30
static OSSL_FUNC_keyexch_newctx_fn dh_newctx;
31
static OSSL_FUNC_keyexch_init_fn dh_init;
32
static OSSL_FUNC_keyexch_set_peer_fn dh_set_peer;
33
static OSSL_FUNC_keyexch_derive_fn dh_derive;
34
static OSSL_FUNC_keyexch_freectx_fn dh_freectx;
35
static OSSL_FUNC_keyexch_dupctx_fn dh_dupctx;
36
static OSSL_FUNC_keyexch_set_ctx_params_fn dh_set_ctx_params;
37
static OSSL_FUNC_keyexch_settable_ctx_params_fn dh_settable_ctx_params;
38
static OSSL_FUNC_keyexch_get_ctx_params_fn dh_get_ctx_params;
39
static OSSL_FUNC_keyexch_gettable_ctx_params_fn dh_gettable_ctx_params;
40
41
/*
42
 * This type is only really used to handle some legacy related functionality.
43
 * If you need to use other KDF's (such as SSKDF) just use PROV_DH_KDF_NONE
44
 * here and then create and run a KDF after the key is derived.
45
 * Note that X942 has 2 variants of key derivation:
46
 *   (1) DH_KDF_X9_42_ASN1 - which contains an ANS1 encoded object that has
47
 *   the counter embedded in it.
48
 *   (2) DH_KDF_X941_CONCAT - which is the same as ECDH_X963_KDF (which can be
49
 *       done by creating a "X963KDF".
50
 */
51
enum kdf_type {
52
    PROV_DH_KDF_NONE = 0,
53
    PROV_DH_KDF_X9_42_ASN1
54
};
55
56
/*
57
 * What's passed as an actual key is defined by the KEYMGMT interface.
58
 * We happen to know that our KEYMGMT simply passes DH structures, so
59
 * we use that here too.
60
 */
61
62
typedef struct {
63
    OSSL_LIB_CTX *libctx;
64
    DH *dh;
65
    DH *dhpeer;
66
    unsigned int pad : 1;
67
68
    /* DH KDF */
69
    /* KDF (if any) to use for DH */
70
    enum kdf_type kdf_type;
71
    /* Message digest to use for key derivation */
72
    EVP_MD *kdf_md;
73
    /* User key material */
74
    unsigned char *kdf_ukm;
75
    size_t kdf_ukmlen;
76
    /* KDF output length */
77
    size_t kdf_outlen;
78
    char *kdf_cekalg;
79
} PROV_DH_CTX;
80
81
static void *dh_newctx(void *provctx)
82
3.76k
{
83
3.76k
    PROV_DH_CTX *pdhctx;
84
85
3.76k
    if (!ossl_prov_is_running())
86
0
        return NULL;
87
88
3.76k
    pdhctx = OPENSSL_zalloc(sizeof(PROV_DH_CTX));
89
3.76k
    if (pdhctx == NULL)
90
0
        return NULL;
91
3.76k
    pdhctx->libctx = PROV_LIBCTX_OF(provctx);
92
3.76k
    pdhctx->kdf_type = PROV_DH_KDF_NONE;
93
3.76k
    return pdhctx;
94
3.76k
}
95
96
static int dh_init(void *vpdhctx, void *vdh, const OSSL_PARAM params[])
97
2.78k
{
98
2.78k
    PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx;
99
100
2.78k
    if (!ossl_prov_is_running()
101
2.78k
            || pdhctx == NULL
102
2.78k
            || vdh == NULL
103
2.78k
            || !DH_up_ref(vdh))
104
0
        return 0;
105
2.78k
    DH_free(pdhctx->dh);
106
2.78k
    pdhctx->dh = vdh;
107
2.78k
    pdhctx->kdf_type = PROV_DH_KDF_NONE;
108
2.78k
    return dh_set_ctx_params(pdhctx, params)
109
2.78k
           && ossl_dh_check_key(pdhctx->libctx, vdh);
110
2.78k
}
111
112
/* The 2 parties must share the same domain parameters */
113
static int dh_match_params(DH *priv, DH *peer)
114
3.43k
{
115
3.43k
    int ret;
116
3.43k
    FFC_PARAMS *dhparams_priv = ossl_dh_get0_params(priv);
117
3.43k
    FFC_PARAMS *dhparams_peer = ossl_dh_get0_params(peer);
118
119
3.43k
    ret = dhparams_priv != NULL
120
3.43k
          && dhparams_peer != NULL
121
3.43k
          && ossl_ffc_params_cmp(dhparams_priv, dhparams_peer, 1);
122
3.43k
    if (!ret)
123
3.43k
        ERR_raise(ERR_LIB_PROV, PROV_R_MISMATCHING_DOMAIN_PARAMETERS);
124
3.43k
    return ret;
125
3.43k
}
126
127
static int dh_set_peer(void *vpdhctx, void *vdh)
128
3.43k
{
129
3.43k
    PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx;
130
131
3.43k
    if (!ossl_prov_is_running()
132
3.43k
            || pdhctx == NULL
133
3.43k
            || vdh == NULL
134
3.43k
            || !dh_match_params(vdh, pdhctx->dh)
135
3.43k
            || !DH_up_ref(vdh))
136
0
        return 0;
137
3.43k
    DH_free(pdhctx->dhpeer);
138
3.43k
    pdhctx->dhpeer = vdh;
139
3.43k
    return 1;
140
3.43k
}
141
142
static int dh_plain_derive(void *vpdhctx,
143
                           unsigned char *secret, size_t *secretlen,
144
                           size_t outlen, unsigned int pad)
145
6.86k
{
146
6.86k
    PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx;
147
6.86k
    int ret;
148
6.86k
    size_t dhsize;
149
6.86k
    const BIGNUM *pub_key = NULL;
150
151
6.86k
    if (pdhctx->dh == NULL || pdhctx->dhpeer == NULL) {
152
0
        ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_KEY);
153
0
        return 0;
154
0
    }
155
156
6.86k
    dhsize = (size_t)DH_size(pdhctx->dh);
157
6.86k
    if (secret == NULL) {
158
3.43k
        *secretlen = dhsize;
159
3.43k
        return 1;
160
3.43k
    }
161
3.43k
    if (outlen < dhsize) {
162
0
        ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
163
0
        return 0;
164
0
    }
165
166
3.43k
    DH_get0_key(pdhctx->dhpeer, &pub_key, NULL);
167
3.43k
    if (pad)
168
177
        ret = DH_compute_key_padded(secret, pub_key, pdhctx->dh);
169
3.25k
    else
170
3.25k
        ret = DH_compute_key(secret, pub_key, pdhctx->dh);
171
3.43k
    if (ret <= 0)
172
0
        return 0;
173
174
3.43k
    *secretlen = ret;
175
3.43k
    return 1;
176
3.43k
}
177
178
static int dh_X9_42_kdf_derive(void *vpdhctx, unsigned char *secret,
179
                               size_t *secretlen, size_t outlen)
180
0
{
181
0
    PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx;
182
0
    unsigned char *stmp = NULL;
183
0
    size_t stmplen;
184
0
    int ret = 0;
185
186
0
    if (secret == NULL) {
187
0
        *secretlen = pdhctx->kdf_outlen;
188
0
        return 1;
189
0
    }
190
191
0
    if (pdhctx->kdf_outlen > outlen) {
192
0
        ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
193
0
        return 0;
194
0
    }
195
0
    if (!dh_plain_derive(pdhctx, NULL, &stmplen, 0, 1))
196
0
        return 0;
197
0
    if ((stmp = OPENSSL_secure_malloc(stmplen)) == NULL)
198
0
        return 0;
199
0
    if (!dh_plain_derive(pdhctx, stmp, &stmplen, stmplen, 1))
200
0
        goto err;
201
202
    /* Do KDF stuff */
203
0
    if (pdhctx->kdf_type == PROV_DH_KDF_X9_42_ASN1) {
204
0
        if (!ossl_dh_kdf_X9_42_asn1(secret, pdhctx->kdf_outlen,
205
0
                                    stmp, stmplen,
206
0
                                    pdhctx->kdf_cekalg,
207
0
                                    pdhctx->kdf_ukm,
208
0
                                    pdhctx->kdf_ukmlen,
209
0
                                    pdhctx->kdf_md,
210
0
                                    pdhctx->libctx, NULL))
211
0
            goto err;
212
0
    }
213
0
    *secretlen = pdhctx->kdf_outlen;
214
0
    ret = 1;
215
0
err:
216
0
    OPENSSL_secure_clear_free(stmp, stmplen);
217
0
    return ret;
218
0
}
219
220
static int dh_derive(void *vpdhctx, unsigned char *secret,
221
                     size_t *psecretlen, size_t outlen)
222
6.86k
{
223
6.86k
    PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx;
224
225
6.86k
    if (!ossl_prov_is_running())
226
0
        return 0;
227
228
6.86k
    switch (pdhctx->kdf_type) {
229
6.86k
        case PROV_DH_KDF_NONE:
230
6.86k
            return dh_plain_derive(pdhctx, secret, psecretlen, outlen,
231
6.86k
                                   pdhctx->pad);
232
0
        case PROV_DH_KDF_X9_42_ASN1:
233
0
            return dh_X9_42_kdf_derive(pdhctx, secret, psecretlen, outlen);
234
0
        default:
235
0
            break;
236
6.86k
    }
237
0
    return 0;
238
6.86k
}
239
240
static void dh_freectx(void *vpdhctx)
241
3.76k
{
242
3.76k
    PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx;
243
244
3.76k
    OPENSSL_free(pdhctx->kdf_cekalg);
245
3.76k
    DH_free(pdhctx->dh);
246
3.76k
    DH_free(pdhctx->dhpeer);
247
3.76k
    EVP_MD_free(pdhctx->kdf_md);
248
3.76k
    OPENSSL_clear_free(pdhctx->kdf_ukm, pdhctx->kdf_ukmlen);
249
250
3.76k
    OPENSSL_free(pdhctx);
251
3.76k
}
252
253
static void *dh_dupctx(void *vpdhctx)
254
0
{
255
0
    PROV_DH_CTX *srcctx = (PROV_DH_CTX *)vpdhctx;
256
0
    PROV_DH_CTX *dstctx;
257
258
0
    if (!ossl_prov_is_running())
259
0
        return NULL;
260
261
0
    dstctx = OPENSSL_zalloc(sizeof(*srcctx));
262
0
    if (dstctx == NULL)
263
0
        return NULL;
264
265
0
    *dstctx = *srcctx;
266
0
    dstctx->dh = NULL;
267
0
    dstctx->dhpeer = NULL;
268
0
    dstctx->kdf_md = NULL;
269
0
    dstctx->kdf_ukm = NULL;
270
0
    dstctx->kdf_cekalg = NULL;
271
272
0
    if (srcctx->dh != NULL && !DH_up_ref(srcctx->dh))
273
0
        goto err;
274
0
    else
275
0
        dstctx->dh = srcctx->dh;
276
277
0
    if (srcctx->dhpeer != NULL && !DH_up_ref(srcctx->dhpeer))
278
0
        goto err;
279
0
    else
280
0
        dstctx->dhpeer = srcctx->dhpeer;
281
282
0
    if (srcctx->kdf_md != NULL && !EVP_MD_up_ref(srcctx->kdf_md))
283
0
        goto err;
284
0
    else
285
0
        dstctx->kdf_md = srcctx->kdf_md;
286
287
    /* Duplicate UKM data if present */
288
0
    if (srcctx->kdf_ukm != NULL && srcctx->kdf_ukmlen > 0) {
289
0
        dstctx->kdf_ukm = OPENSSL_memdup(srcctx->kdf_ukm,
290
0
                                         srcctx->kdf_ukmlen);
291
0
        if (dstctx->kdf_ukm == NULL)
292
0
            goto err;
293
0
    }
294
295
0
    if (srcctx->kdf_cekalg != NULL) {
296
0
        dstctx->kdf_cekalg = OPENSSL_strdup(srcctx->kdf_cekalg);
297
0
        if (dstctx->kdf_cekalg == NULL)
298
0
            goto err;
299
0
    }
300
301
0
    return dstctx;
302
0
err:
303
0
    dh_freectx(dstctx);
304
0
    return NULL;
305
0
}
306
307
static int dh_set_ctx_params(void *vpdhctx, const OSSL_PARAM params[])
308
1.88k
{
309
1.88k
    PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx;
310
1.88k
    const OSSL_PARAM *p;
311
1.88k
    unsigned int pad;
312
1.88k
    char name[80] = { '\0' }; /* should be big enough */
313
1.88k
    char *str = NULL;
314
315
1.88k
    if (pdhctx == NULL)
316
0
        return 0;
317
1.88k
    if (params == NULL)
318
1.88k
        return 1;
319
320
0
    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_TYPE);
321
0
    if (p != NULL) {
322
0
        str = name;
323
0
        if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(name)))
324
0
            return 0;
325
326
0
        if (name[0] == '\0')
327
0
            pdhctx->kdf_type = PROV_DH_KDF_NONE;
328
0
        else if (strcmp(name, OSSL_KDF_NAME_X942KDF_ASN1) == 0)
329
0
            pdhctx->kdf_type = PROV_DH_KDF_X9_42_ASN1;
330
0
        else
331
0
            return 0;
332
0
    }
333
0
    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_DIGEST);
334
0
    if (p != NULL) {
335
0
        char mdprops[80] = { '\0' }; /* should be big enough */
336
337
0
        str = name;
338
0
        if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(name)))
339
0
            return 0;
340
341
0
        str = mdprops;
342
0
        p = OSSL_PARAM_locate_const(params,
343
0
                                    OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS);
344
345
0
        if (p != NULL) {
346
0
            if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(mdprops)))
347
0
                return 0;
348
0
        }
349
350
0
        EVP_MD_free(pdhctx->kdf_md);
351
0
        pdhctx->kdf_md = EVP_MD_fetch(pdhctx->libctx, name, mdprops);
352
0
        if (pdhctx->kdf_md == NULL)
353
0
            return 0;
354
0
        if (!ossl_digest_is_allowed(pdhctx->libctx, pdhctx->kdf_md)) {
355
0
            EVP_MD_free(pdhctx->kdf_md);
356
0
            pdhctx->kdf_md = NULL;
357
0
            return 0;
358
0
        }
359
0
    }
360
361
0
    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_OUTLEN);
362
0
    if (p != NULL) {
363
0
        size_t outlen;
364
365
0
        if (!OSSL_PARAM_get_size_t(p, &outlen))
366
0
            return 0;
367
0
        pdhctx->kdf_outlen = outlen;
368
0
    }
369
370
0
    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_KDF_UKM);
371
0
    if (p != NULL) {
372
0
        void *tmp_ukm = NULL;
373
0
        size_t tmp_ukmlen;
374
375
0
        OPENSSL_free(pdhctx->kdf_ukm);
376
0
        pdhctx->kdf_ukm = NULL;
377
0
        pdhctx->kdf_ukmlen = 0;
378
        /* ukm is an optional field so it can be NULL */
379
0
        if (p->data != NULL && p->data_size != 0) {
380
0
            if (!OSSL_PARAM_get_octet_string(p, &tmp_ukm, 0, &tmp_ukmlen))
381
0
                return 0;
382
0
            pdhctx->kdf_ukm = tmp_ukm;
383
0
            pdhctx->kdf_ukmlen = tmp_ukmlen;
384
0
        }
385
0
    }
386
387
0
    p = OSSL_PARAM_locate_const(params, OSSL_EXCHANGE_PARAM_PAD);
388
0
    if (p != NULL) {
389
0
        if (!OSSL_PARAM_get_uint(p, &pad))
390
0
            return 0;
391
0
        pdhctx->pad = pad ? 1 : 0;
392
0
    }
393
394
0
    p = OSSL_PARAM_locate_const(params, OSSL_KDF_PARAM_CEK_ALG);
395
0
    if (p != NULL) {
396
0
        str = name;
397
398
0
        OPENSSL_free(pdhctx->kdf_cekalg);
399
0
        pdhctx->kdf_cekalg = NULL;
400
0
        if (p->data != NULL && p->data_size != 0) {
401
0
            if (!OSSL_PARAM_get_utf8_string(p, &str, sizeof(name)))
402
0
                return 0;
403
0
            pdhctx->kdf_cekalg = OPENSSL_strdup(name);
404
0
            if (pdhctx->kdf_cekalg == NULL)
405
0
                return 0;
406
0
        }
407
0
    }
408
0
    return 1;
409
0
}
410
411
static const OSSL_PARAM known_settable_ctx_params[] = {
412
    OSSL_PARAM_int(OSSL_EXCHANGE_PARAM_PAD, NULL),
413
    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_TYPE, NULL, 0),
414
    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_DIGEST, NULL, 0),
415
    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS, NULL, 0),
416
    OSSL_PARAM_size_t(OSSL_EXCHANGE_PARAM_KDF_OUTLEN, NULL),
417
    OSSL_PARAM_octet_string(OSSL_EXCHANGE_PARAM_KDF_UKM, NULL, 0),
418
    OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_CEK_ALG, NULL, 0),
419
    OSSL_PARAM_END
420
};
421
422
static const OSSL_PARAM *dh_settable_ctx_params(ossl_unused void *vpdhctx,
423
                                                ossl_unused void *provctx)
424
182
{
425
182
    return known_settable_ctx_params;
426
182
}
427
428
static const OSSL_PARAM known_gettable_ctx_params[] = {
429
    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_TYPE, NULL, 0),
430
    OSSL_PARAM_utf8_string(OSSL_EXCHANGE_PARAM_KDF_DIGEST, NULL, 0),
431
    OSSL_PARAM_size_t(OSSL_EXCHANGE_PARAM_KDF_OUTLEN, NULL),
432
    OSSL_PARAM_DEFN(OSSL_EXCHANGE_PARAM_KDF_UKM, OSSL_PARAM_OCTET_PTR,
433
                    NULL, 0),
434
    OSSL_PARAM_utf8_string(OSSL_KDF_PARAM_CEK_ALG, NULL, 0),
435
    OSSL_PARAM_END
436
};
437
438
static const OSSL_PARAM *dh_gettable_ctx_params(ossl_unused void *vpdhctx,
439
                                                ossl_unused void *provctx)
440
0
{
441
0
    return known_gettable_ctx_params;
442
0
}
443
444
static int dh_get_ctx_params(void *vpdhctx, OSSL_PARAM params[])
445
0
{
446
0
    PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx;
447
0
    OSSL_PARAM *p;
448
449
0
    if (pdhctx == NULL)
450
0
        return 0;
451
452
0
    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_KDF_TYPE);
453
0
    if (p != NULL) {
454
0
        const char *kdf_type = NULL;
455
456
0
        switch (pdhctx->kdf_type) {
457
0
            case PROV_DH_KDF_NONE:
458
0
                kdf_type = "";
459
0
                break;
460
0
            case PROV_DH_KDF_X9_42_ASN1:
461
0
                kdf_type = OSSL_KDF_NAME_X942KDF_ASN1;
462
0
                break;
463
0
            default:
464
0
                return 0;
465
0
        }
466
467
0
        if (!OSSL_PARAM_set_utf8_string(p, kdf_type))
468
0
            return 0;
469
0
    }
470
471
0
    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_KDF_DIGEST);
472
0
    if (p != NULL
473
0
            && !OSSL_PARAM_set_utf8_string(p, pdhctx->kdf_md == NULL
474
0
                                           ? ""
475
0
                                           : EVP_MD_get0_name(pdhctx->kdf_md))) {
476
0
        return 0;
477
0
    }
478
479
0
    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_KDF_OUTLEN);
480
0
    if (p != NULL && !OSSL_PARAM_set_size_t(p, pdhctx->kdf_outlen))
481
0
        return 0;
482
483
0
    p = OSSL_PARAM_locate(params, OSSL_EXCHANGE_PARAM_KDF_UKM);
484
0
    if (p != NULL
485
0
        && !OSSL_PARAM_set_octet_ptr(p, pdhctx->kdf_ukm, pdhctx->kdf_ukmlen))
486
0
        return 0;
487
488
0
    p = OSSL_PARAM_locate(params, OSSL_KDF_PARAM_CEK_ALG);
489
0
    if (p != NULL
490
0
            && !OSSL_PARAM_set_utf8_string(p, pdhctx->kdf_cekalg == NULL
491
0
                                           ? "" :  pdhctx->kdf_cekalg))
492
0
        return 0;
493
494
0
    return 1;
495
0
}
496
497
const OSSL_DISPATCH ossl_dh_keyexch_functions[] = {
498
    { OSSL_FUNC_KEYEXCH_NEWCTX, (void (*)(void))dh_newctx },
499
    { OSSL_FUNC_KEYEXCH_INIT, (void (*)(void))dh_init },
500
    { OSSL_FUNC_KEYEXCH_DERIVE, (void (*)(void))dh_derive },
501
    { OSSL_FUNC_KEYEXCH_SET_PEER, (void (*)(void))dh_set_peer },
502
    { OSSL_FUNC_KEYEXCH_FREECTX, (void (*)(void))dh_freectx },
503
    { OSSL_FUNC_KEYEXCH_DUPCTX, (void (*)(void))dh_dupctx },
504
    { OSSL_FUNC_KEYEXCH_SET_CTX_PARAMS, (void (*)(void))dh_set_ctx_params },
505
    { OSSL_FUNC_KEYEXCH_SETTABLE_CTX_PARAMS,
506
      (void (*)(void))dh_settable_ctx_params },
507
    { OSSL_FUNC_KEYEXCH_GET_CTX_PARAMS, (void (*)(void))dh_get_ctx_params },
508
    { OSSL_FUNC_KEYEXCH_GETTABLE_CTX_PARAMS,
509
      (void (*)(void))dh_gettable_ctx_params },
510
    OSSL_DISPATCH_END
511
};