summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbeck <>2023-07-08 15:29:04 +0000
committerbeck <>2023-07-08 15:29:04 +0000
commitfb3005d44347523e79c18cf8f224d6044f34af04 (patch)
tree858373c845c6ed391d9bfd53f8c02d9ae33c3430
parent11219faca0a481767f00bb6d2d523c4c847b6299 (diff)
downloadopenbsd-fb3005d44347523e79c18cf8f224d6044f34af04.tar.gz
openbsd-fb3005d44347523e79c18cf8f224d6044f34af04.tar.bz2
openbsd-fb3005d44347523e79c18cf8f224d6044f34af04.zip
Hide symbols in dh
ok tb@
-rw-r--r--src/lib/libcrypto/Symbols.namespace45
-rw-r--r--src/lib/libcrypto/dh/dh_ameth.c4
-rw-r--r--src/lib/libcrypto/dh/dh_asn1.c9
-rw-r--r--src/lib/libcrypto/dh/dh_check.c4
-rw-r--r--src/lib/libcrypto/dh/dh_err.c3
-rw-r--r--src/lib/libcrypto/dh/dh_gen.c4
-rw-r--r--src/lib/libcrypto/dh/dh_key.c5
-rw-r--r--src/lib/libcrypto/dh/dh_lib.c30
-rw-r--r--src/lib/libcrypto/hidden/openssl/dh.h74
9 files changed, 171 insertions, 7 deletions
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace
index 4770e8f9d2..60d6195fac 100644
--- a/src/lib/libcrypto/Symbols.namespace
+++ b/src/lib/libcrypto/Symbols.namespace
@@ -2706,3 +2706,48 @@ _libre_X25519
2706_libre_ED25519_keypair 2706_libre_ED25519_keypair
2707_libre_ED25519_sign 2707_libre_ED25519_sign
2708_libre_ED25519_verify 2708_libre_ED25519_verify
2709_libre_d2i_DHparams_bio
2710_libre_i2d_DHparams_bio
2711_libre_d2i_DHparams_fp
2712_libre_i2d_DHparams_fp
2713_libre_DHparams_dup
2714_libre_DH_OpenSSL
2715_libre_DH_set_default_method
2716_libre_DH_get_default_method
2717_libre_DH_set_method
2718_libre_DH_new_method
2719_libre_DH_new
2720_libre_DH_free
2721_libre_DH_up_ref
2722_libre_DH_size
2723_libre_DH_bits
2724_libre_DH_get_ex_new_index
2725_libre_DH_set_ex_data
2726_libre_DH_get_ex_data
2727_libre_DH_security_bits
2728_libre_DH_get0_engine
2729_libre_DH_get0_pqg
2730_libre_DH_set0_pqg
2731_libre_DH_get0_key
2732_libre_DH_set0_key
2733_libre_DH_get0_p
2734_libre_DH_get0_q
2735_libre_DH_get0_g
2736_libre_DH_get0_priv_key
2737_libre_DH_get0_pub_key
2738_libre_DH_clear_flags
2739_libre_DH_test_flags
2740_libre_DH_set_flags
2741_libre_DH_get_length
2742_libre_DH_set_length
2743_libre_DH_generate_parameters
2744_libre_DH_generate_parameters_ex
2745_libre_DH_check
2746_libre_DH_check_pub_key
2747_libre_DH_generate_key
2748_libre_DH_compute_key
2749_libre_d2i_DHparams
2750_libre_i2d_DHparams
2751_libre_DHparams_print_fp
2752_libre_DHparams_print
2753_libre_ERR_load_DH_strings
diff --git a/src/lib/libcrypto/dh/dh_ameth.c b/src/lib/libcrypto/dh/dh_ameth.c
index 61d3d14397..cc594cfd38 100644
--- a/src/lib/libcrypto/dh/dh_ameth.c
+++ b/src/lib/libcrypto/dh/dh_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_ameth.c,v 1.29 2023/07/07 06:59:18 tb Exp $ */ 1/* $OpenBSD: dh_ameth.c,v 1.30 2023/07/08 15:29:03 beck Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -448,6 +448,7 @@ DHparams_print(BIO *bp, const DH *x)
448{ 448{
449 return do_dh_print(bp, x, 4, NULL, 0); 449 return do_dh_print(bp, x, 4, NULL, 0);
450} 450}
451LCRYPTO_ALIAS(DHparams_print);
451 452
452int 453int
453DHparams_print_fp(FILE *fp, const DH *x) 454DHparams_print_fp(FILE *fp, const DH *x)
@@ -466,6 +467,7 @@ DHparams_print_fp(FILE *fp, const DH *x)
466 467
467 return ret; 468 return ret;
468} 469}
470LCRYPTO_ALIAS(DHparams_print_fp);
469 471
470static int 472static int
471dh_pkey_public_check(const EVP_PKEY *pkey) 473dh_pkey_public_check(const EVP_PKEY *pkey)
diff --git a/src/lib/libcrypto/dh/dh_asn1.c b/src/lib/libcrypto/dh/dh_asn1.c
index 10184f0b2d..2e0b054d34 100644
--- a/src/lib/libcrypto/dh/dh_asn1.c
+++ b/src/lib/libcrypto/dh/dh_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_asn1.c,v 1.11 2022/01/07 09:27:13 tb Exp $ */ 1/* $OpenBSD: dh_asn1.c,v 1.12 2023/07/08 15:29:03 beck Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -131,39 +131,46 @@ d2i_DHparams(DH **a, const unsigned char **in, long len)
131 return (DH *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, 131 return (DH *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
132 &DHparams_it); 132 &DHparams_it);
133} 133}
134LCRYPTO_ALIAS(d2i_DHparams);
134 135
135int 136int
136i2d_DHparams(const DH *a, unsigned char **out) 137i2d_DHparams(const DH *a, unsigned char **out)
137{ 138{
138 return ASN1_item_i2d((ASN1_VALUE *)a, out, &DHparams_it); 139 return ASN1_item_i2d((ASN1_VALUE *)a, out, &DHparams_it);
139} 140}
141LCRYPTO_ALIAS(i2d_DHparams);
140 142
141DH * 143DH *
142d2i_DHparams_bio(BIO *bp, DH **a) 144d2i_DHparams_bio(BIO *bp, DH **a)
143{ 145{
144 return ASN1_item_d2i_bio(&DHparams_it, bp, a); 146 return ASN1_item_d2i_bio(&DHparams_it, bp, a);
145} 147}
148LCRYPTO_ALIAS(d2i_DHparams_bio);
146 149
147int 150int
148i2d_DHparams_bio(BIO *bp, DH *a) 151i2d_DHparams_bio(BIO *bp, DH *a)
149{ 152{
150 return ASN1_item_i2d_bio(&DHparams_it, bp, a); 153 return ASN1_item_i2d_bio(&DHparams_it, bp, a);
151} 154}
155LCRYPTO_ALIAS(i2d_DHparams_bio);
152 156
153DH * 157DH *
154d2i_DHparams_fp(FILE *fp, DH **a) 158d2i_DHparams_fp(FILE *fp, DH **a)
155{ 159{
156 return ASN1_item_d2i_fp(&DHparams_it, fp, a); 160 return ASN1_item_d2i_fp(&DHparams_it, fp, a);
157} 161}
162LCRYPTO_ALIAS(d2i_DHparams_fp);
158 163
159int 164int
160i2d_DHparams_fp(FILE *fp, DH *a) 165i2d_DHparams_fp(FILE *fp, DH *a)
161{ 166{
162 return ASN1_item_i2d_fp(&DHparams_it, fp, a); 167 return ASN1_item_i2d_fp(&DHparams_it, fp, a);
163} 168}
169LCRYPTO_ALIAS(i2d_DHparams_fp);
164 170
165DH * 171DH *
166DHparams_dup(DH *dh) 172DHparams_dup(DH *dh)
167{ 173{
168 return ASN1_item_dup(&DHparams_it, dh); 174 return ASN1_item_dup(&DHparams_it, dh);
169} 175}
176LCRYPTO_ALIAS(DHparams_dup);
diff --git a/src/lib/libcrypto/dh/dh_check.c b/src/lib/libcrypto/dh/dh_check.c
index 9bbbd55b30..f3d89f620a 100644
--- a/src/lib/libcrypto/dh/dh_check.c
+++ b/src/lib/libcrypto/dh/dh_check.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_check.c,v 1.26 2022/11/26 16:08:51 tb Exp $ */ 1/* $OpenBSD: dh_check.c,v 1.27 2023/07/08 15:29:03 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -227,6 +227,7 @@ DH_check(const DH *dh, int *flags)
227 BN_CTX_free(ctx); 227 BN_CTX_free(ctx);
228 return ok; 228 return ok;
229} 229}
230LCRYPTO_ALIAS(DH_check);
230 231
231int 232int
232DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key) 233DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key)
@@ -299,3 +300,4 @@ DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *flags)
299 300
300 return ok; 301 return ok;
301} 302}
303LCRYPTO_ALIAS(DH_check_pub_key);
diff --git a/src/lib/libcrypto/dh/dh_err.c b/src/lib/libcrypto/dh/dh_err.c
index db66d68e3b..f5dda2898d 100644
--- a/src/lib/libcrypto/dh/dh_err.c
+++ b/src/lib/libcrypto/dh/dh_err.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_err.c,v 1.18 2022/07/12 14:42:49 kn Exp $ */ 1/* $OpenBSD: dh_err.c,v 1.19 2023/07/08 15:29:03 beck Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -111,3 +111,4 @@ void ERR_load_DH_strings(void)
111 } 111 }
112#endif 112#endif
113 } 113 }
114LCRYPTO_ALIAS(ERR_load_DH_strings);
diff --git a/src/lib/libcrypto/dh/dh_gen.c b/src/lib/libcrypto/dh/dh_gen.c
index d51d10d2ab..3ffa5d80f1 100644
--- a/src/lib/libcrypto/dh/dh_gen.c
+++ b/src/lib/libcrypto/dh/dh_gen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_gen.c,v 1.20 2023/04/13 15:18:29 tb Exp $ */ 1/* $OpenBSD: dh_gen.c,v 1.21 2023/07/08 15:29:03 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -75,6 +75,7 @@ DH_generate_parameters_ex(DH *ret, int prime_len, int generator, BN_GENCB *cb)
75 return ret->meth->generate_params(ret, prime_len, generator, cb); 75 return ret->meth->generate_params(ret, prime_len, generator, cb);
76 return dh_builtin_genparams(ret, prime_len, generator, cb); 76 return dh_builtin_genparams(ret, prime_len, generator, cb);
77} 77}
78LCRYPTO_ALIAS(DH_generate_parameters_ex);
78 79
79/* 80/*
80 * We generate DH parameters as follows: 81 * We generate DH parameters as follows:
@@ -193,3 +194,4 @@ DH_generate_parameters(int prime_len, int generator,
193 DH_free(ret); 194 DH_free(ret);
194 return NULL; 195 return NULL;
195} 196}
197LCRYPTO_ALIAS(DH_generate_parameters);
diff --git a/src/lib/libcrypto/dh/dh_key.c b/src/lib/libcrypto/dh/dh_key.c
index 89ae5f0fdc..a4bd689483 100644
--- a/src/lib/libcrypto/dh/dh_key.c
+++ b/src/lib/libcrypto/dh/dh_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_key.c,v 1.38 2022/11/26 16:08:51 tb Exp $ */ 1/* $OpenBSD: dh_key.c,v 1.39 2023/07/08 15:29:03 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -77,12 +77,14 @@ DH_generate_key(DH *dh)
77{ 77{
78 return dh->meth->generate_key(dh); 78 return dh->meth->generate_key(dh);
79} 79}
80LCRYPTO_ALIAS(DH_generate_key);
80 81
81int 82int
82DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) 83DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
83{ 84{
84 return dh->meth->compute_key(key, pub_key, dh); 85 return dh->meth->compute_key(key, pub_key, dh);
85} 86}
87LCRYPTO_ALIAS(DH_compute_key);
86 88
87static DH_METHOD dh_ossl = { 89static DH_METHOD dh_ossl = {
88 .name = "OpenSSL DH Method", 90 .name = "OpenSSL DH Method",
@@ -98,6 +100,7 @@ DH_OpenSSL(void)
98{ 100{
99 return &dh_ossl; 101 return &dh_ossl;
100} 102}
103LCRYPTO_ALIAS(DH_OpenSSL);
101 104
102static int 105static int
103generate_key(DH *dh) 106generate_key(DH *dh)
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c
index e5cb46485d..987f0b1f7a 100644
--- a/src/lib/libcrypto/dh/dh_lib.c
+++ b/src/lib/libcrypto/dh/dh_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_lib.c,v 1.38 2023/03/07 09:27:10 jsing Exp $ */ 1/* $OpenBSD: dh_lib.c,v 1.39 2023/07/08 15:29:03 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -78,6 +78,7 @@ DH_set_default_method(const DH_METHOD *meth)
78{ 78{
79 default_DH_method = meth; 79 default_DH_method = meth;
80} 80}
81LCRYPTO_ALIAS(DH_set_default_method);
81 82
82const DH_METHOD * 83const DH_METHOD *
83DH_get_default_method(void) 84DH_get_default_method(void)
@@ -86,6 +87,7 @@ DH_get_default_method(void)
86 default_DH_method = DH_OpenSSL(); 87 default_DH_method = DH_OpenSSL();
87 return default_DH_method; 88 return default_DH_method;
88} 89}
90LCRYPTO_ALIAS(DH_get_default_method);
89 91
90int 92int
91DH_set_method(DH *dh, const DH_METHOD *meth) 93DH_set_method(DH *dh, const DH_METHOD *meth)
@@ -108,12 +110,14 @@ DH_set_method(DH *dh, const DH_METHOD *meth)
108 meth->init(dh); 110 meth->init(dh);
109 return 1; 111 return 1;
110} 112}
113LCRYPTO_ALIAS(DH_set_method);
111 114
112DH * 115DH *
113DH_new(void) 116DH_new(void)
114{ 117{
115 return DH_new_method(NULL); 118 return DH_new_method(NULL);
116} 119}
120LCRYPTO_ALIAS(DH_new);
117 121
118DH * 122DH *
119DH_new_method(ENGINE *engine) 123DH_new_method(ENGINE *engine)
@@ -174,6 +178,7 @@ DH_new_method(ENGINE *engine)
174 } 178 }
175 return ret; 179 return ret;
176} 180}
181LCRYPTO_ALIAS(DH_new_method);
177 182
178void 183void
179DH_free(DH *r) 184DH_free(DH *r)
@@ -204,6 +209,7 @@ DH_free(DH *r)
204 BN_free(r->priv_key); 209 BN_free(r->priv_key);
205 free(r); 210 free(r);
206} 211}
212LCRYPTO_ALIAS(DH_free);
207 213
208int 214int
209DH_up_ref(DH *r) 215DH_up_ref(DH *r)
@@ -212,6 +218,7 @@ DH_up_ref(DH *r)
212 218
213 return i > 1 ? 1 : 0; 219 return i > 1 ? 1 : 0;
214} 220}
221LCRYPTO_ALIAS(DH_up_ref);
215 222
216int 223int
217DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 224DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
@@ -220,30 +227,35 @@ DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
220 return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DH, argl, argp, new_func, 227 return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DH, argl, argp, new_func,
221 dup_func, free_func); 228 dup_func, free_func);
222} 229}
230LCRYPTO_ALIAS(DH_get_ex_new_index);
223 231
224int 232int
225DH_set_ex_data(DH *d, int idx, void *arg) 233DH_set_ex_data(DH *d, int idx, void *arg)
226{ 234{
227 return CRYPTO_set_ex_data(&d->ex_data, idx, arg); 235 return CRYPTO_set_ex_data(&d->ex_data, idx, arg);
228} 236}
237LCRYPTO_ALIAS(DH_set_ex_data);
229 238
230void * 239void *
231DH_get_ex_data(DH *d, int idx) 240DH_get_ex_data(DH *d, int idx)
232{ 241{
233 return CRYPTO_get_ex_data(&d->ex_data, idx); 242 return CRYPTO_get_ex_data(&d->ex_data, idx);
234} 243}
244LCRYPTO_ALIAS(DH_get_ex_data);
235 245
236int 246int
237DH_size(const DH *dh) 247DH_size(const DH *dh)
238{ 248{
239 return BN_num_bytes(dh->p); 249 return BN_num_bytes(dh->p);
240} 250}
251LCRYPTO_ALIAS(DH_size);
241 252
242int 253int
243DH_bits(const DH *dh) 254DH_bits(const DH *dh)
244{ 255{
245 return BN_num_bits(dh->p); 256 return BN_num_bits(dh->p);
246} 257}
258LCRYPTO_ALIAS(DH_bits);
247 259
248int 260int
249DH_security_bits(const DH *dh) 261DH_security_bits(const DH *dh)
@@ -257,12 +269,14 @@ DH_security_bits(const DH *dh)
257 269
258 return BN_security_bits(BN_num_bits(dh->p), N); 270 return BN_security_bits(BN_num_bits(dh->p), N);
259} 271}
272LCRYPTO_ALIAS(DH_security_bits);
260 273
261ENGINE * 274ENGINE *
262DH_get0_engine(DH *dh) 275DH_get0_engine(DH *dh)
263{ 276{
264 return dh->engine; 277 return dh->engine;
265} 278}
279LCRYPTO_ALIAS(DH_get0_engine);
266 280
267void 281void
268DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) 282DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
@@ -274,6 +288,7 @@ DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
274 if (g != NULL) 288 if (g != NULL)
275 *g = dh->g; 289 *g = dh->g;
276} 290}
291LCRYPTO_ALIAS(DH_get0_pqg);
277 292
278int 293int
279DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) 294DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g)
@@ -297,6 +312,7 @@ DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g)
297 312
298 return 1; 313 return 1;
299} 314}
315LCRYPTO_ALIAS(DH_set0_pqg);
300 316
301void 317void
302DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) 318DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key)
@@ -306,6 +322,7 @@ DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key)
306 if (priv_key != NULL) 322 if (priv_key != NULL)
307 *priv_key = dh->priv_key; 323 *priv_key = dh->priv_key;
308} 324}
325LCRYPTO_ALIAS(DH_get0_key);
309 326
310int 327int
311DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) 328DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key)
@@ -321,60 +338,70 @@ DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key)
321 338
322 return 1; 339 return 1;
323} 340}
341LCRYPTO_ALIAS(DH_set0_key);
324 342
325const BIGNUM * 343const BIGNUM *
326DH_get0_p(const DH *dh) 344DH_get0_p(const DH *dh)
327{ 345{
328 return dh->p; 346 return dh->p;
329} 347}
348LCRYPTO_ALIAS(DH_get0_p);
330 349
331const BIGNUM * 350const BIGNUM *
332DH_get0_q(const DH *dh) 351DH_get0_q(const DH *dh)
333{ 352{
334 return dh->q; 353 return dh->q;
335} 354}
355LCRYPTO_ALIAS(DH_get0_q);
336 356
337const BIGNUM * 357const BIGNUM *
338DH_get0_g(const DH *dh) 358DH_get0_g(const DH *dh)
339{ 359{
340 return dh->g; 360 return dh->g;
341} 361}
362LCRYPTO_ALIAS(DH_get0_g);
342 363
343const BIGNUM * 364const BIGNUM *
344DH_get0_priv_key(const DH *dh) 365DH_get0_priv_key(const DH *dh)
345{ 366{
346 return dh->priv_key; 367 return dh->priv_key;
347} 368}
369LCRYPTO_ALIAS(DH_get0_priv_key);
348 370
349const BIGNUM * 371const BIGNUM *
350DH_get0_pub_key(const DH *dh) 372DH_get0_pub_key(const DH *dh)
351{ 373{
352 return dh->pub_key; 374 return dh->pub_key;
353} 375}
376LCRYPTO_ALIAS(DH_get0_pub_key);
354 377
355void 378void
356DH_clear_flags(DH *dh, int flags) 379DH_clear_flags(DH *dh, int flags)
357{ 380{
358 dh->flags &= ~flags; 381 dh->flags &= ~flags;
359} 382}
383LCRYPTO_ALIAS(DH_clear_flags);
360 384
361int 385int
362DH_test_flags(const DH *dh, int flags) 386DH_test_flags(const DH *dh, int flags)
363{ 387{
364 return dh->flags & flags; 388 return dh->flags & flags;
365} 389}
390LCRYPTO_ALIAS(DH_test_flags);
366 391
367void 392void
368DH_set_flags(DH *dh, int flags) 393DH_set_flags(DH *dh, int flags)
369{ 394{
370 dh->flags |= flags; 395 dh->flags |= flags;
371} 396}
397LCRYPTO_ALIAS(DH_set_flags);
372 398
373long 399long
374DH_get_length(const DH *dh) 400DH_get_length(const DH *dh)
375{ 401{
376 return dh->length; 402 return dh->length;
377} 403}
404LCRYPTO_ALIAS(DH_get_length);
378 405
379int 406int
380DH_set_length(DH *dh, long length) 407DH_set_length(DH *dh, long length)
@@ -385,3 +412,4 @@ DH_set_length(DH *dh, long length)
385 dh->length = length; 412 dh->length = length;
386 return 1; 413 return 1;
387} 414}
415LCRYPTO_ALIAS(DH_set_length);
diff --git a/src/lib/libcrypto/hidden/openssl/dh.h b/src/lib/libcrypto/hidden/openssl/dh.h
new file mode 100644
index 0000000000..7e6d578151
--- /dev/null
+++ b/src/lib/libcrypto/hidden/openssl/dh.h
@@ -0,0 +1,74 @@
1/* $OpenBSD: dh.h,v 1.1 2023/07/08 15:29:04 beck Exp $ */
2/*
3 * Copyright (c) 2023 Bob Beck <beck@openbsd.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef _LIBCRYPTO_DH_H
19#define _LIBCRYPTO_DH_H
20
21#ifndef _MSC_VER
22#include_next <openssl/dh.h>
23#else
24#include "../include/openssl/dh.h"
25#endif
26#include "crypto_namespace.h"
27
28LCRYPTO_USED(d2i_DHparams_bio);
29LCRYPTO_USED(i2d_DHparams_bio);
30LCRYPTO_USED(d2i_DHparams_fp);
31LCRYPTO_USED(i2d_DHparams_fp);
32LCRYPTO_USED(DHparams_dup);
33LCRYPTO_USED(DH_OpenSSL);
34LCRYPTO_USED(DH_set_default_method);
35LCRYPTO_USED(DH_get_default_method);
36LCRYPTO_USED(DH_set_method);
37LCRYPTO_USED(DH_new_method);
38LCRYPTO_USED(DH_new);
39LCRYPTO_USED(DH_free);
40LCRYPTO_USED(DH_up_ref);
41LCRYPTO_USED(DH_size);
42LCRYPTO_USED(DH_bits);
43LCRYPTO_USED(DH_get_ex_new_index);
44LCRYPTO_USED(DH_set_ex_data);
45LCRYPTO_USED(DH_get_ex_data);
46LCRYPTO_USED(DH_security_bits);
47LCRYPTO_USED(DH_get0_engine);
48LCRYPTO_USED(DH_get0_pqg);
49LCRYPTO_USED(DH_set0_pqg);
50LCRYPTO_USED(DH_get0_key);
51LCRYPTO_USED(DH_set0_key);
52LCRYPTO_USED(DH_get0_p);
53LCRYPTO_USED(DH_get0_q);
54LCRYPTO_USED(DH_get0_g);
55LCRYPTO_USED(DH_get0_priv_key);
56LCRYPTO_USED(DH_get0_pub_key);
57LCRYPTO_USED(DH_clear_flags);
58LCRYPTO_USED(DH_test_flags);
59LCRYPTO_USED(DH_set_flags);
60LCRYPTO_USED(DH_get_length);
61LCRYPTO_USED(DH_set_length);
62LCRYPTO_USED(DH_generate_parameters);
63LCRYPTO_USED(DH_generate_parameters_ex);
64LCRYPTO_USED(DH_check);
65LCRYPTO_USED(DH_check_pub_key);
66LCRYPTO_USED(DH_generate_key);
67LCRYPTO_USED(DH_compute_key);
68LCRYPTO_USED(d2i_DHparams);
69LCRYPTO_USED(i2d_DHparams);
70LCRYPTO_USED(DHparams_print_fp);
71LCRYPTO_USED(DHparams_print);
72LCRYPTO_USED(ERR_load_DH_strings);
73
74#endif /* _LIBCRYPTO_DH_H */