diff options
| author | beck <> | 2023-07-08 15:29:04 +0000 |
|---|---|---|
| committer | beck <> | 2023-07-08 15:29:04 +0000 |
| commit | fb3005d44347523e79c18cf8f224d6044f34af04 (patch) | |
| tree | 858373c845c6ed391d9bfd53f8c02d9ae33c3430 /src/lib/libcrypto/dh/dh_lib.c | |
| parent | 11219faca0a481767f00bb6d2d523c4c847b6299 (diff) | |
| download | openbsd-fb3005d44347523e79c18cf8f224d6044f34af04.tar.gz openbsd-fb3005d44347523e79c18cf8f224d6044f34af04.tar.bz2 openbsd-fb3005d44347523e79c18cf8f224d6044f34af04.zip | |
Hide symbols in dh
ok tb@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/dh/dh_lib.c | 30 |
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 | } |
| 81 | LCRYPTO_ALIAS(DH_set_default_method); | ||
| 81 | 82 | ||
| 82 | const DH_METHOD * | 83 | const DH_METHOD * |
| 83 | DH_get_default_method(void) | 84 | DH_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 | } |
| 90 | LCRYPTO_ALIAS(DH_get_default_method); | ||
| 89 | 91 | ||
| 90 | int | 92 | int |
| 91 | DH_set_method(DH *dh, const DH_METHOD *meth) | 93 | DH_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 | } |
| 113 | LCRYPTO_ALIAS(DH_set_method); | ||
| 111 | 114 | ||
| 112 | DH * | 115 | DH * |
| 113 | DH_new(void) | 116 | DH_new(void) |
| 114 | { | 117 | { |
| 115 | return DH_new_method(NULL); | 118 | return DH_new_method(NULL); |
| 116 | } | 119 | } |
| 120 | LCRYPTO_ALIAS(DH_new); | ||
| 117 | 121 | ||
| 118 | DH * | 122 | DH * |
| 119 | DH_new_method(ENGINE *engine) | 123 | DH_new_method(ENGINE *engine) |
| @@ -174,6 +178,7 @@ DH_new_method(ENGINE *engine) | |||
| 174 | } | 178 | } |
| 175 | return ret; | 179 | return ret; |
| 176 | } | 180 | } |
| 181 | LCRYPTO_ALIAS(DH_new_method); | ||
| 177 | 182 | ||
| 178 | void | 183 | void |
| 179 | DH_free(DH *r) | 184 | DH_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 | } |
| 212 | LCRYPTO_ALIAS(DH_free); | ||
| 207 | 213 | ||
| 208 | int | 214 | int |
| 209 | DH_up_ref(DH *r) | 215 | DH_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 | } |
| 221 | LCRYPTO_ALIAS(DH_up_ref); | ||
| 215 | 222 | ||
| 216 | int | 223 | int |
| 217 | DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 224 | DH_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 | } |
| 230 | LCRYPTO_ALIAS(DH_get_ex_new_index); | ||
| 223 | 231 | ||
| 224 | int | 232 | int |
| 225 | DH_set_ex_data(DH *d, int idx, void *arg) | 233 | DH_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 | } |
| 237 | LCRYPTO_ALIAS(DH_set_ex_data); | ||
| 229 | 238 | ||
| 230 | void * | 239 | void * |
| 231 | DH_get_ex_data(DH *d, int idx) | 240 | DH_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 | } |
| 244 | LCRYPTO_ALIAS(DH_get_ex_data); | ||
| 235 | 245 | ||
| 236 | int | 246 | int |
| 237 | DH_size(const DH *dh) | 247 | DH_size(const DH *dh) |
| 238 | { | 248 | { |
| 239 | return BN_num_bytes(dh->p); | 249 | return BN_num_bytes(dh->p); |
| 240 | } | 250 | } |
| 251 | LCRYPTO_ALIAS(DH_size); | ||
| 241 | 252 | ||
| 242 | int | 253 | int |
| 243 | DH_bits(const DH *dh) | 254 | DH_bits(const DH *dh) |
| 244 | { | 255 | { |
| 245 | return BN_num_bits(dh->p); | 256 | return BN_num_bits(dh->p); |
| 246 | } | 257 | } |
| 258 | LCRYPTO_ALIAS(DH_bits); | ||
| 247 | 259 | ||
| 248 | int | 260 | int |
| 249 | DH_security_bits(const DH *dh) | 261 | DH_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 | } |
| 272 | LCRYPTO_ALIAS(DH_security_bits); | ||
| 260 | 273 | ||
| 261 | ENGINE * | 274 | ENGINE * |
| 262 | DH_get0_engine(DH *dh) | 275 | DH_get0_engine(DH *dh) |
| 263 | { | 276 | { |
| 264 | return dh->engine; | 277 | return dh->engine; |
| 265 | } | 278 | } |
| 279 | LCRYPTO_ALIAS(DH_get0_engine); | ||
| 266 | 280 | ||
| 267 | void | 281 | void |
| 268 | DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) | 282 | DH_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 | } |
| 291 | LCRYPTO_ALIAS(DH_get0_pqg); | ||
| 277 | 292 | ||
| 278 | int | 293 | int |
| 279 | DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) | 294 | DH_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 | } |
| 315 | LCRYPTO_ALIAS(DH_set0_pqg); | ||
| 300 | 316 | ||
| 301 | void | 317 | void |
| 302 | DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) | 318 | DH_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 | } |
| 325 | LCRYPTO_ALIAS(DH_get0_key); | ||
| 309 | 326 | ||
| 310 | int | 327 | int |
| 311 | DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) | 328 | DH_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 | } |
| 341 | LCRYPTO_ALIAS(DH_set0_key); | ||
| 324 | 342 | ||
| 325 | const BIGNUM * | 343 | const BIGNUM * |
| 326 | DH_get0_p(const DH *dh) | 344 | DH_get0_p(const DH *dh) |
| 327 | { | 345 | { |
| 328 | return dh->p; | 346 | return dh->p; |
| 329 | } | 347 | } |
| 348 | LCRYPTO_ALIAS(DH_get0_p); | ||
| 330 | 349 | ||
| 331 | const BIGNUM * | 350 | const BIGNUM * |
| 332 | DH_get0_q(const DH *dh) | 351 | DH_get0_q(const DH *dh) |
| 333 | { | 352 | { |
| 334 | return dh->q; | 353 | return dh->q; |
| 335 | } | 354 | } |
| 355 | LCRYPTO_ALIAS(DH_get0_q); | ||
| 336 | 356 | ||
| 337 | const BIGNUM * | 357 | const BIGNUM * |
| 338 | DH_get0_g(const DH *dh) | 358 | DH_get0_g(const DH *dh) |
| 339 | { | 359 | { |
| 340 | return dh->g; | 360 | return dh->g; |
| 341 | } | 361 | } |
| 362 | LCRYPTO_ALIAS(DH_get0_g); | ||
| 342 | 363 | ||
| 343 | const BIGNUM * | 364 | const BIGNUM * |
| 344 | DH_get0_priv_key(const DH *dh) | 365 | DH_get0_priv_key(const DH *dh) |
| 345 | { | 366 | { |
| 346 | return dh->priv_key; | 367 | return dh->priv_key; |
| 347 | } | 368 | } |
| 369 | LCRYPTO_ALIAS(DH_get0_priv_key); | ||
| 348 | 370 | ||
| 349 | const BIGNUM * | 371 | const BIGNUM * |
| 350 | DH_get0_pub_key(const DH *dh) | 372 | DH_get0_pub_key(const DH *dh) |
| 351 | { | 373 | { |
| 352 | return dh->pub_key; | 374 | return dh->pub_key; |
| 353 | } | 375 | } |
| 376 | LCRYPTO_ALIAS(DH_get0_pub_key); | ||
| 354 | 377 | ||
| 355 | void | 378 | void |
| 356 | DH_clear_flags(DH *dh, int flags) | 379 | DH_clear_flags(DH *dh, int flags) |
| 357 | { | 380 | { |
| 358 | dh->flags &= ~flags; | 381 | dh->flags &= ~flags; |
| 359 | } | 382 | } |
| 383 | LCRYPTO_ALIAS(DH_clear_flags); | ||
| 360 | 384 | ||
| 361 | int | 385 | int |
| 362 | DH_test_flags(const DH *dh, int flags) | 386 | DH_test_flags(const DH *dh, int flags) |
| 363 | { | 387 | { |
| 364 | return dh->flags & flags; | 388 | return dh->flags & flags; |
| 365 | } | 389 | } |
| 390 | LCRYPTO_ALIAS(DH_test_flags); | ||
| 366 | 391 | ||
| 367 | void | 392 | void |
| 368 | DH_set_flags(DH *dh, int flags) | 393 | DH_set_flags(DH *dh, int flags) |
| 369 | { | 394 | { |
| 370 | dh->flags |= flags; | 395 | dh->flags |= flags; |
| 371 | } | 396 | } |
| 397 | LCRYPTO_ALIAS(DH_set_flags); | ||
| 372 | 398 | ||
| 373 | long | 399 | long |
| 374 | DH_get_length(const DH *dh) | 400 | DH_get_length(const DH *dh) |
| 375 | { | 401 | { |
| 376 | return dh->length; | 402 | return dh->length; |
| 377 | } | 403 | } |
| 404 | LCRYPTO_ALIAS(DH_get_length); | ||
| 378 | 405 | ||
| 379 | int | 406 | int |
| 380 | DH_set_length(DH *dh, long length) | 407 | DH_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 | } |
| 415 | LCRYPTO_ALIAS(DH_set_length); | ||
