summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dh/dh_lib.c
diff options
context:
space:
mode:
authorbeck <>2023-07-08 15:29:04 +0000
committerbeck <>2023-07-08 15:29:04 +0000
commitfb3005d44347523e79c18cf8f224d6044f34af04 (patch)
tree858373c845c6ed391d9bfd53f8c02d9ae33c3430 /src/lib/libcrypto/dh/dh_lib.c
parent11219faca0a481767f00bb6d2d523c4c847b6299 (diff)
downloadopenbsd-fb3005d44347523e79c18cf8f224d6044f34af04.tar.gz
openbsd-fb3005d44347523e79c18cf8f224d6044f34af04.tar.bz2
openbsd-fb3005d44347523e79c18cf8f224d6044f34af04.zip
Hide symbols in dh
ok tb@
Diffstat (limited to 'src/lib/libcrypto/dh/dh_lib.c')
-rw-r--r--src/lib/libcrypto/dh/dh_lib.c30
1 files changed, 29 insertions, 1 deletions
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);