diff options
| author | beck <> | 2023-07-08 14:28:15 +0000 |
|---|---|---|
| committer | beck <> | 2023-07-08 14:28:15 +0000 |
| commit | ed57ee23c30661b8054a17346a8e19be71fd9ede (patch) | |
| tree | 43b93595f2484c826f709140a37a783ee1ac35ab /src/lib/libcrypto/dsa/dsa_lib.c | |
| parent | c6aa49142862708d04aaaff82bcae7639bd212f6 (diff) | |
| download | openbsd-ed57ee23c30661b8054a17346a8e19be71fd9ede.tar.gz openbsd-ed57ee23c30661b8054a17346a8e19be71fd9ede.tar.bz2 openbsd-ed57ee23c30661b8054a17346a8e19be71fd9ede.zip | |
hide symbols in dsa
ok tb@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/dsa/dsa_lib.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_lib.c b/src/lib/libcrypto/dsa/dsa_lib.c index 6986f9ad6b..46a7dbcfbe 100644 --- a/src/lib/libcrypto/dsa/dsa_lib.c +++ b/src/lib/libcrypto/dsa/dsa_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: dsa_lib.c,v 1.42 2023/03/11 15:29:03 tb Exp $ */ | 1 | /* $OpenBSD: dsa_lib.c,v 1.43 2023/07/08 14:28:15 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 | * |
| @@ -84,6 +84,7 @@ DSA_set_default_method(const DSA_METHOD *meth) | |||
| 84 | { | 84 | { |
| 85 | default_DSA_method = meth; | 85 | default_DSA_method = meth; |
| 86 | } | 86 | } |
| 87 | LCRYPTO_ALIAS(DSA_set_default_method); | ||
| 87 | 88 | ||
| 88 | const DSA_METHOD * | 89 | const DSA_METHOD * |
| 89 | DSA_get_default_method(void) | 90 | DSA_get_default_method(void) |
| @@ -92,12 +93,14 @@ DSA_get_default_method(void) | |||
| 92 | default_DSA_method = DSA_OpenSSL(); | 93 | default_DSA_method = DSA_OpenSSL(); |
| 93 | return default_DSA_method; | 94 | return default_DSA_method; |
| 94 | } | 95 | } |
| 96 | LCRYPTO_ALIAS(DSA_get_default_method); | ||
| 95 | 97 | ||
| 96 | DSA * | 98 | DSA * |
| 97 | DSA_new(void) | 99 | DSA_new(void) |
| 98 | { | 100 | { |
| 99 | return DSA_new_method(NULL); | 101 | return DSA_new_method(NULL); |
| 100 | } | 102 | } |
| 103 | LCRYPTO_ALIAS(DSA_new); | ||
| 101 | 104 | ||
| 102 | int | 105 | int |
| 103 | DSA_set_method(DSA *dsa, const DSA_METHOD *meth) | 106 | DSA_set_method(DSA *dsa, const DSA_METHOD *meth) |
| @@ -119,6 +122,7 @@ DSA_set_method(DSA *dsa, const DSA_METHOD *meth) | |||
| 119 | meth->init(dsa); | 122 | meth->init(dsa); |
| 120 | return 1; | 123 | return 1; |
| 121 | } | 124 | } |
| 125 | LCRYPTO_ALIAS(DSA_set_method); | ||
| 122 | 126 | ||
| 123 | DSA * | 127 | DSA * |
| 124 | DSA_new_method(ENGINE *engine) | 128 | DSA_new_method(ENGINE *engine) |
| @@ -179,6 +183,7 @@ DSA_new_method(ENGINE *engine) | |||
| 179 | 183 | ||
| 180 | return ret; | 184 | return ret; |
| 181 | } | 185 | } |
| 186 | LCRYPTO_ALIAS(DSA_new_method); | ||
| 182 | 187 | ||
| 183 | void | 188 | void |
| 184 | DSA_free(DSA *r) | 189 | DSA_free(DSA *r) |
| @@ -209,6 +214,7 @@ DSA_free(DSA *r) | |||
| 209 | BN_free(r->r); | 214 | BN_free(r->r); |
| 210 | free(r); | 215 | free(r); |
| 211 | } | 216 | } |
| 217 | LCRYPTO_ALIAS(DSA_free); | ||
| 212 | 218 | ||
| 213 | int | 219 | int |
| 214 | DSA_up_ref(DSA *r) | 220 | DSA_up_ref(DSA *r) |
| @@ -216,6 +222,7 @@ DSA_up_ref(DSA *r) | |||
| 216 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DSA); | 222 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DSA); |
| 217 | return i > 1 ? 1 : 0; | 223 | return i > 1 ? 1 : 0; |
| 218 | } | 224 | } |
| 225 | LCRYPTO_ALIAS(DSA_up_ref); | ||
| 219 | 226 | ||
| 220 | int | 227 | int |
| 221 | DSA_size(const DSA *r) | 228 | DSA_size(const DSA *r) |
| @@ -231,6 +238,7 @@ DSA_size(const DSA *r) | |||
| 231 | 238 | ||
| 232 | return ret; | 239 | return ret; |
| 233 | } | 240 | } |
| 241 | LCRYPTO_ALIAS(DSA_size); | ||
| 234 | 242 | ||
| 235 | int | 243 | int |
| 236 | DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 244 | DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
| @@ -239,18 +247,21 @@ DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | |||
| 239 | return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DSA, argl, argp, | 247 | return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DSA, argl, argp, |
| 240 | new_func, dup_func, free_func); | 248 | new_func, dup_func, free_func); |
| 241 | } | 249 | } |
| 250 | LCRYPTO_ALIAS(DSA_get_ex_new_index); | ||
| 242 | 251 | ||
| 243 | int | 252 | int |
| 244 | DSA_set_ex_data(DSA *d, int idx, void *arg) | 253 | DSA_set_ex_data(DSA *d, int idx, void *arg) |
| 245 | { | 254 | { |
| 246 | return CRYPTO_set_ex_data(&d->ex_data, idx, arg); | 255 | return CRYPTO_set_ex_data(&d->ex_data, idx, arg); |
| 247 | } | 256 | } |
| 257 | LCRYPTO_ALIAS(DSA_set_ex_data); | ||
| 248 | 258 | ||
| 249 | void * | 259 | void * |
| 250 | DSA_get_ex_data(DSA *d, int idx) | 260 | DSA_get_ex_data(DSA *d, int idx) |
| 251 | { | 261 | { |
| 252 | return CRYPTO_get_ex_data(&d->ex_data, idx); | 262 | return CRYPTO_get_ex_data(&d->ex_data, idx); |
| 253 | } | 263 | } |
| 264 | LCRYPTO_ALIAS(DSA_get_ex_data); | ||
| 254 | 265 | ||
| 255 | int | 266 | int |
| 256 | DSA_security_bits(const DSA *d) | 267 | DSA_security_bits(const DSA *d) |
| @@ -260,6 +271,7 @@ DSA_security_bits(const DSA *d) | |||
| 260 | 271 | ||
| 261 | return BN_security_bits(BN_num_bits(d->p), BN_num_bits(d->q)); | 272 | return BN_security_bits(BN_num_bits(d->p), BN_num_bits(d->q)); |
| 262 | } | 273 | } |
| 274 | LCRYPTO_ALIAS(DSA_security_bits); | ||
| 263 | 275 | ||
| 264 | #ifndef OPENSSL_NO_DH | 276 | #ifndef OPENSSL_NO_DH |
| 265 | DH * | 277 | DH * |
| @@ -301,6 +313,7 @@ err: | |||
| 301 | DH_free(ret); | 313 | DH_free(ret); |
| 302 | return NULL; | 314 | return NULL; |
| 303 | } | 315 | } |
| 316 | LCRYPTO_ALIAS(DSA_dup_DH); | ||
| 304 | #endif | 317 | #endif |
| 305 | 318 | ||
| 306 | void | 319 | void |
| @@ -313,6 +326,7 @@ DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) | |||
| 313 | if (g != NULL) | 326 | if (g != NULL) |
| 314 | *g = d->g; | 327 | *g = d->g; |
| 315 | } | 328 | } |
| 329 | LCRYPTO_ALIAS(DSA_get0_pqg); | ||
| 316 | 330 | ||
| 317 | int | 331 | int |
| 318 | DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) | 332 | DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) |
| @@ -336,6 +350,7 @@ DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) | |||
| 336 | 350 | ||
| 337 | return 1; | 351 | return 1; |
| 338 | } | 352 | } |
| 353 | LCRYPTO_ALIAS(DSA_set0_pqg); | ||
| 339 | 354 | ||
| 340 | void | 355 | void |
| 341 | DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) | 356 | DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) |
| @@ -345,6 +360,7 @@ DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) | |||
| 345 | if (priv_key != NULL) | 360 | if (priv_key != NULL) |
| 346 | *priv_key = d->priv_key; | 361 | *priv_key = d->priv_key; |
| 347 | } | 362 | } |
| 363 | LCRYPTO_ALIAS(DSA_get0_key); | ||
| 348 | 364 | ||
| 349 | int | 365 | int |
| 350 | DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) | 366 | DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) |
| @@ -363,66 +379,77 @@ DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) | |||
| 363 | 379 | ||
| 364 | return 1; | 380 | return 1; |
| 365 | } | 381 | } |
| 382 | LCRYPTO_ALIAS(DSA_set0_key); | ||
| 366 | 383 | ||
| 367 | const BIGNUM * | 384 | const BIGNUM * |
| 368 | DSA_get0_p(const DSA *d) | 385 | DSA_get0_p(const DSA *d) |
| 369 | { | 386 | { |
| 370 | return d->p; | 387 | return d->p; |
| 371 | } | 388 | } |
| 389 | LCRYPTO_ALIAS(DSA_get0_p); | ||
| 372 | 390 | ||
| 373 | const BIGNUM * | 391 | const BIGNUM * |
| 374 | DSA_get0_q(const DSA *d) | 392 | DSA_get0_q(const DSA *d) |
| 375 | { | 393 | { |
| 376 | return d->q; | 394 | return d->q; |
| 377 | } | 395 | } |
| 396 | LCRYPTO_ALIAS(DSA_get0_q); | ||
| 378 | 397 | ||
| 379 | const BIGNUM * | 398 | const BIGNUM * |
| 380 | DSA_get0_g(const DSA *d) | 399 | DSA_get0_g(const DSA *d) |
| 381 | { | 400 | { |
| 382 | return d->g; | 401 | return d->g; |
| 383 | } | 402 | } |
| 403 | LCRYPTO_ALIAS(DSA_get0_g); | ||
| 384 | 404 | ||
| 385 | const BIGNUM * | 405 | const BIGNUM * |
| 386 | DSA_get0_pub_key(const DSA *d) | 406 | DSA_get0_pub_key(const DSA *d) |
| 387 | { | 407 | { |
| 388 | return d->pub_key; | 408 | return d->pub_key; |
| 389 | } | 409 | } |
| 410 | LCRYPTO_ALIAS(DSA_get0_pub_key); | ||
| 390 | 411 | ||
| 391 | const BIGNUM * | 412 | const BIGNUM * |
| 392 | DSA_get0_priv_key(const DSA *d) | 413 | DSA_get0_priv_key(const DSA *d) |
| 393 | { | 414 | { |
| 394 | return d->priv_key; | 415 | return d->priv_key; |
| 395 | } | 416 | } |
| 417 | LCRYPTO_ALIAS(DSA_get0_priv_key); | ||
| 396 | 418 | ||
| 397 | void | 419 | void |
| 398 | DSA_clear_flags(DSA *d, int flags) | 420 | DSA_clear_flags(DSA *d, int flags) |
| 399 | { | 421 | { |
| 400 | d->flags &= ~flags; | 422 | d->flags &= ~flags; |
| 401 | } | 423 | } |
| 424 | LCRYPTO_ALIAS(DSA_clear_flags); | ||
| 402 | 425 | ||
| 403 | int | 426 | int |
| 404 | DSA_test_flags(const DSA *d, int flags) | 427 | DSA_test_flags(const DSA *d, int flags) |
| 405 | { | 428 | { |
| 406 | return d->flags & flags; | 429 | return d->flags & flags; |
| 407 | } | 430 | } |
| 431 | LCRYPTO_ALIAS(DSA_test_flags); | ||
| 408 | 432 | ||
| 409 | void | 433 | void |
| 410 | DSA_set_flags(DSA *d, int flags) | 434 | DSA_set_flags(DSA *d, int flags) |
| 411 | { | 435 | { |
| 412 | d->flags |= flags; | 436 | d->flags |= flags; |
| 413 | } | 437 | } |
| 438 | LCRYPTO_ALIAS(DSA_set_flags); | ||
| 414 | 439 | ||
| 415 | ENGINE * | 440 | ENGINE * |
| 416 | DSA_get0_engine(DSA *d) | 441 | DSA_get0_engine(DSA *d) |
| 417 | { | 442 | { |
| 418 | return d->engine; | 443 | return d->engine; |
| 419 | } | 444 | } |
| 445 | LCRYPTO_ALIAS(DSA_get0_engine); | ||
| 420 | 446 | ||
| 421 | int | 447 | int |
| 422 | DSA_bits(const DSA *dsa) | 448 | DSA_bits(const DSA *dsa) |
| 423 | { | 449 | { |
| 424 | return BN_num_bits(dsa->p); | 450 | return BN_num_bits(dsa->p); |
| 425 | } | 451 | } |
| 452 | LCRYPTO_ALIAS(DSA_bits); | ||
| 426 | 453 | ||
| 427 | int | 454 | int |
| 428 | dsa_check_key(const DSA *dsa) | 455 | dsa_check_key(const DSA *dsa) |
