diff options
author | beck <> | 2023-07-08 12:26:45 +0000 |
---|---|---|
committer | beck <> | 2023-07-08 12:26:45 +0000 |
commit | 2c1948ab61cef09c8a7c3306a9b8f7c311bb5c82 (patch) | |
tree | 1d31a132992bcce24a664d524c511ad61b072eee /src/lib/libcrypto/rsa/rsa_lib.c | |
parent | 1b57bced238de7c542c37916bff7853a1c0a6b40 (diff) | |
download | openbsd-2c1948ab61cef09c8a7c3306a9b8f7c311bb5c82.tar.gz openbsd-2c1948ab61cef09c8a7c3306a9b8f7c311bb5c82.tar.bz2 openbsd-2c1948ab61cef09c8a7c3306a9b8f7c311bb5c82.zip |
Hide symbols in rsa
ok tb@
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_lib.c')
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_lib.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_lib.c b/src/lib/libcrypto/rsa/rsa_lib.c index 9656252d77..8831253b9f 100644 --- a/src/lib/libcrypto/rsa/rsa_lib.c +++ b/src/lib/libcrypto/rsa/rsa_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_lib.c,v 1.46 2023/03/11 21:14:26 tb Exp $ */ | 1 | /* $OpenBSD: rsa_lib.c,v 1.47 2023/07/08 12:26:45 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 | * |
@@ -83,12 +83,14 @@ RSA_new(void) | |||
83 | 83 | ||
84 | return r; | 84 | return r; |
85 | } | 85 | } |
86 | LCRYPTO_ALIAS(RSA_new); | ||
86 | 87 | ||
87 | void | 88 | void |
88 | RSA_set_default_method(const RSA_METHOD *meth) | 89 | RSA_set_default_method(const RSA_METHOD *meth) |
89 | { | 90 | { |
90 | default_RSA_meth = meth; | 91 | default_RSA_meth = meth; |
91 | } | 92 | } |
93 | LCRYPTO_ALIAS(RSA_set_default_method); | ||
92 | 94 | ||
93 | const RSA_METHOD * | 95 | const RSA_METHOD * |
94 | RSA_get_default_method(void) | 96 | RSA_get_default_method(void) |
@@ -98,12 +100,14 @@ RSA_get_default_method(void) | |||
98 | 100 | ||
99 | return default_RSA_meth; | 101 | return default_RSA_meth; |
100 | } | 102 | } |
103 | LCRYPTO_ALIAS(RSA_get_default_method); | ||
101 | 104 | ||
102 | const RSA_METHOD * | 105 | const RSA_METHOD * |
103 | RSA_get_method(const RSA *rsa) | 106 | RSA_get_method(const RSA *rsa) |
104 | { | 107 | { |
105 | return rsa->meth; | 108 | return rsa->meth; |
106 | } | 109 | } |
110 | LCRYPTO_ALIAS(RSA_get_method); | ||
107 | 111 | ||
108 | int | 112 | int |
109 | RSA_set_method(RSA *rsa, const RSA_METHOD *meth) | 113 | RSA_set_method(RSA *rsa, const RSA_METHOD *meth) |
@@ -126,6 +130,7 @@ RSA_set_method(RSA *rsa, const RSA_METHOD *meth) | |||
126 | meth->init(rsa); | 130 | meth->init(rsa); |
127 | return 1; | 131 | return 1; |
128 | } | 132 | } |
133 | LCRYPTO_ALIAS(RSA_set_method); | ||
129 | 134 | ||
130 | RSA * | 135 | RSA * |
131 | RSA_new_method(ENGINE *engine) | 136 | RSA_new_method(ENGINE *engine) |
@@ -179,6 +184,7 @@ RSA_new_method(ENGINE *engine) | |||
179 | 184 | ||
180 | return NULL; | 185 | return NULL; |
181 | } | 186 | } |
187 | LCRYPTO_ALIAS(RSA_new_method); | ||
182 | 188 | ||
183 | void | 189 | void |
184 | RSA_free(RSA *r) | 190 | RSA_free(RSA *r) |
@@ -213,6 +219,7 @@ RSA_free(RSA *r) | |||
213 | RSA_PSS_PARAMS_free(r->pss); | 219 | RSA_PSS_PARAMS_free(r->pss); |
214 | free(r); | 220 | free(r); |
215 | } | 221 | } |
222 | LCRYPTO_ALIAS(RSA_free); | ||
216 | 223 | ||
217 | int | 224 | int |
218 | RSA_up_ref(RSA *r) | 225 | RSA_up_ref(RSA *r) |
@@ -220,6 +227,7 @@ RSA_up_ref(RSA *r) | |||
220 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_RSA); | 227 | int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_RSA); |
221 | return i > 1 ? 1 : 0; | 228 | return i > 1 ? 1 : 0; |
222 | } | 229 | } |
230 | LCRYPTO_ALIAS(RSA_up_ref); | ||
223 | 231 | ||
224 | int | 232 | int |
225 | RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 233 | RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
@@ -228,24 +236,28 @@ RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | |||
228 | return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, argl, argp, | 236 | return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_RSA, argl, argp, |
229 | new_func, dup_func, free_func); | 237 | new_func, dup_func, free_func); |
230 | } | 238 | } |
239 | LCRYPTO_ALIAS(RSA_get_ex_new_index); | ||
231 | 240 | ||
232 | int | 241 | int |
233 | RSA_set_ex_data(RSA *r, int idx, void *arg) | 242 | RSA_set_ex_data(RSA *r, int idx, void *arg) |
234 | { | 243 | { |
235 | return CRYPTO_set_ex_data(&r->ex_data, idx, arg); | 244 | return CRYPTO_set_ex_data(&r->ex_data, idx, arg); |
236 | } | 245 | } |
246 | LCRYPTO_ALIAS(RSA_set_ex_data); | ||
237 | 247 | ||
238 | void * | 248 | void * |
239 | RSA_get_ex_data(const RSA *r, int idx) | 249 | RSA_get_ex_data(const RSA *r, int idx) |
240 | { | 250 | { |
241 | return CRYPTO_get_ex_data(&r->ex_data, idx); | 251 | return CRYPTO_get_ex_data(&r->ex_data, idx); |
242 | } | 252 | } |
253 | LCRYPTO_ALIAS(RSA_get_ex_data); | ||
243 | 254 | ||
244 | int | 255 | int |
245 | RSA_security_bits(const RSA *rsa) | 256 | RSA_security_bits(const RSA *rsa) |
246 | { | 257 | { |
247 | return BN_security_bits(RSA_bits(rsa), -1); | 258 | return BN_security_bits(RSA_bits(rsa), -1); |
248 | } | 259 | } |
260 | LCRYPTO_ALIAS(RSA_security_bits); | ||
249 | 261 | ||
250 | void | 262 | void |
251 | RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) | 263 | RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) |
@@ -257,6 +269,7 @@ RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) | |||
257 | if (d != NULL) | 269 | if (d != NULL) |
258 | *d = r->d; | 270 | *d = r->d; |
259 | } | 271 | } |
272 | LCRYPTO_ALIAS(RSA_get0_key); | ||
260 | 273 | ||
261 | int | 274 | int |
262 | RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) | 275 | RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) |
@@ -279,6 +292,7 @@ RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) | |||
279 | 292 | ||
280 | return 1; | 293 | return 1; |
281 | } | 294 | } |
295 | LCRYPTO_ALIAS(RSA_set0_key); | ||
282 | 296 | ||
283 | void | 297 | void |
284 | RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, | 298 | RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, |
@@ -291,6 +305,7 @@ RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, | |||
291 | if (iqmp != NULL) | 305 | if (iqmp != NULL) |
292 | *iqmp = r->iqmp; | 306 | *iqmp = r->iqmp; |
293 | } | 307 | } |
308 | LCRYPTO_ALIAS(RSA_get0_crt_params); | ||
294 | 309 | ||
295 | int | 310 | int |
296 | RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) | 311 | RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) |
@@ -315,6 +330,7 @@ RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) | |||
315 | 330 | ||
316 | return 1; | 331 | return 1; |
317 | } | 332 | } |
333 | LCRYPTO_ALIAS(RSA_set0_crt_params); | ||
318 | 334 | ||
319 | void | 335 | void |
320 | RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) | 336 | RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) |
@@ -324,6 +340,7 @@ RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) | |||
324 | if (q != NULL) | 340 | if (q != NULL) |
325 | *q = r->q; | 341 | *q = r->q; |
326 | } | 342 | } |
343 | LCRYPTO_ALIAS(RSA_get0_factors); | ||
327 | 344 | ||
328 | int | 345 | int |
329 | RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q) | 346 | RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q) |
@@ -342,78 +359,91 @@ RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q) | |||
342 | 359 | ||
343 | return 1; | 360 | return 1; |
344 | } | 361 | } |
362 | LCRYPTO_ALIAS(RSA_set0_factors); | ||
345 | 363 | ||
346 | const BIGNUM * | 364 | const BIGNUM * |
347 | RSA_get0_n(const RSA *r) | 365 | RSA_get0_n(const RSA *r) |
348 | { | 366 | { |
349 | return r->n; | 367 | return r->n; |
350 | } | 368 | } |
369 | LCRYPTO_ALIAS(RSA_get0_n); | ||
351 | 370 | ||
352 | const BIGNUM * | 371 | const BIGNUM * |
353 | RSA_get0_e(const RSA *r) | 372 | RSA_get0_e(const RSA *r) |
354 | { | 373 | { |
355 | return r->e; | 374 | return r->e; |
356 | } | 375 | } |
376 | LCRYPTO_ALIAS(RSA_get0_e); | ||
357 | 377 | ||
358 | const BIGNUM * | 378 | const BIGNUM * |
359 | RSA_get0_d(const RSA *r) | 379 | RSA_get0_d(const RSA *r) |
360 | { | 380 | { |
361 | return r->d; | 381 | return r->d; |
362 | } | 382 | } |
383 | LCRYPTO_ALIAS(RSA_get0_d); | ||
363 | 384 | ||
364 | const BIGNUM * | 385 | const BIGNUM * |
365 | RSA_get0_p(const RSA *r) | 386 | RSA_get0_p(const RSA *r) |
366 | { | 387 | { |
367 | return r->p; | 388 | return r->p; |
368 | } | 389 | } |
390 | LCRYPTO_ALIAS(RSA_get0_p); | ||
369 | 391 | ||
370 | const BIGNUM * | 392 | const BIGNUM * |
371 | RSA_get0_q(const RSA *r) | 393 | RSA_get0_q(const RSA *r) |
372 | { | 394 | { |
373 | return r->q; | 395 | return r->q; |
374 | } | 396 | } |
397 | LCRYPTO_ALIAS(RSA_get0_q); | ||
375 | 398 | ||
376 | const BIGNUM * | 399 | const BIGNUM * |
377 | RSA_get0_dmp1(const RSA *r) | 400 | RSA_get0_dmp1(const RSA *r) |
378 | { | 401 | { |
379 | return r->dmp1; | 402 | return r->dmp1; |
380 | } | 403 | } |
404 | LCRYPTO_ALIAS(RSA_get0_dmp1); | ||
381 | 405 | ||
382 | const BIGNUM * | 406 | const BIGNUM * |
383 | RSA_get0_dmq1(const RSA *r) | 407 | RSA_get0_dmq1(const RSA *r) |
384 | { | 408 | { |
385 | return r->dmq1; | 409 | return r->dmq1; |
386 | } | 410 | } |
411 | LCRYPTO_ALIAS(RSA_get0_dmq1); | ||
387 | 412 | ||
388 | const BIGNUM * | 413 | const BIGNUM * |
389 | RSA_get0_iqmp(const RSA *r) | 414 | RSA_get0_iqmp(const RSA *r) |
390 | { | 415 | { |
391 | return r->iqmp; | 416 | return r->iqmp; |
392 | } | 417 | } |
418 | LCRYPTO_ALIAS(RSA_get0_iqmp); | ||
393 | 419 | ||
394 | const RSA_PSS_PARAMS * | 420 | const RSA_PSS_PARAMS * |
395 | RSA_get0_pss_params(const RSA *r) | 421 | RSA_get0_pss_params(const RSA *r) |
396 | { | 422 | { |
397 | return r->pss; | 423 | return r->pss; |
398 | } | 424 | } |
425 | LCRYPTO_ALIAS(RSA_get0_pss_params); | ||
399 | 426 | ||
400 | void | 427 | void |
401 | RSA_clear_flags(RSA *r, int flags) | 428 | RSA_clear_flags(RSA *r, int flags) |
402 | { | 429 | { |
403 | r->flags &= ~flags; | 430 | r->flags &= ~flags; |
404 | } | 431 | } |
432 | LCRYPTO_ALIAS(RSA_clear_flags); | ||
405 | 433 | ||
406 | int | 434 | int |
407 | RSA_test_flags(const RSA *r, int flags) | 435 | RSA_test_flags(const RSA *r, int flags) |
408 | { | 436 | { |
409 | return r->flags & flags; | 437 | return r->flags & flags; |
410 | } | 438 | } |
439 | LCRYPTO_ALIAS(RSA_test_flags); | ||
411 | 440 | ||
412 | void | 441 | void |
413 | RSA_set_flags(RSA *r, int flags) | 442 | RSA_set_flags(RSA *r, int flags) |
414 | { | 443 | { |
415 | r->flags |= flags; | 444 | r->flags |= flags; |
416 | } | 445 | } |
446 | LCRYPTO_ALIAS(RSA_set_flags); | ||
417 | 447 | ||
418 | int | 448 | int |
419 | RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2) | 449 | RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2) |
@@ -426,3 +456,4 @@ RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2) | |||
426 | 456 | ||
427 | return EVP_PKEY_CTX_ctrl(ctx, -1, optype, cmd, p1, p2); | 457 | return EVP_PKEY_CTX_ctrl(ctx, -1, optype, cmd, p1, p2); |
428 | } | 458 | } |
459 | LCRYPTO_ALIAS(RSA_pkey_ctx_ctrl); | ||