summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rsa/rsa_lib.c
diff options
context:
space:
mode:
authorbeck <>2023-07-08 12:26:45 +0000
committerbeck <>2023-07-08 12:26:45 +0000
commit2c1948ab61cef09c8a7c3306a9b8f7c311bb5c82 (patch)
tree1d31a132992bcce24a664d524c511ad61b072eee /src/lib/libcrypto/rsa/rsa_lib.c
parent1b57bced238de7c542c37916bff7853a1c0a6b40 (diff)
downloadopenbsd-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.c33
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}
86LCRYPTO_ALIAS(RSA_new);
86 87
87void 88void
88RSA_set_default_method(const RSA_METHOD *meth) 89RSA_set_default_method(const RSA_METHOD *meth)
89{ 90{
90 default_RSA_meth = meth; 91 default_RSA_meth = meth;
91} 92}
93LCRYPTO_ALIAS(RSA_set_default_method);
92 94
93const RSA_METHOD * 95const RSA_METHOD *
94RSA_get_default_method(void) 96RSA_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}
103LCRYPTO_ALIAS(RSA_get_default_method);
101 104
102const RSA_METHOD * 105const RSA_METHOD *
103RSA_get_method(const RSA *rsa) 106RSA_get_method(const RSA *rsa)
104{ 107{
105 return rsa->meth; 108 return rsa->meth;
106} 109}
110LCRYPTO_ALIAS(RSA_get_method);
107 111
108int 112int
109RSA_set_method(RSA *rsa, const RSA_METHOD *meth) 113RSA_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}
133LCRYPTO_ALIAS(RSA_set_method);
129 134
130RSA * 135RSA *
131RSA_new_method(ENGINE *engine) 136RSA_new_method(ENGINE *engine)
@@ -179,6 +184,7 @@ RSA_new_method(ENGINE *engine)
179 184
180 return NULL; 185 return NULL;
181} 186}
187LCRYPTO_ALIAS(RSA_new_method);
182 188
183void 189void
184RSA_free(RSA *r) 190RSA_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}
222LCRYPTO_ALIAS(RSA_free);
216 223
217int 224int
218RSA_up_ref(RSA *r) 225RSA_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}
230LCRYPTO_ALIAS(RSA_up_ref);
223 231
224int 232int
225RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 233RSA_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}
239LCRYPTO_ALIAS(RSA_get_ex_new_index);
231 240
232int 241int
233RSA_set_ex_data(RSA *r, int idx, void *arg) 242RSA_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}
246LCRYPTO_ALIAS(RSA_set_ex_data);
237 247
238void * 248void *
239RSA_get_ex_data(const RSA *r, int idx) 249RSA_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}
253LCRYPTO_ALIAS(RSA_get_ex_data);
243 254
244int 255int
245RSA_security_bits(const RSA *rsa) 256RSA_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}
260LCRYPTO_ALIAS(RSA_security_bits);
249 261
250void 262void
251RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) 263RSA_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}
272LCRYPTO_ALIAS(RSA_get0_key);
260 273
261int 274int
262RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) 275RSA_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}
295LCRYPTO_ALIAS(RSA_set0_key);
282 296
283void 297void
284RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, 298RSA_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}
308LCRYPTO_ALIAS(RSA_get0_crt_params);
294 309
295int 310int
296RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) 311RSA_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}
333LCRYPTO_ALIAS(RSA_set0_crt_params);
318 334
319void 335void
320RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) 336RSA_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}
343LCRYPTO_ALIAS(RSA_get0_factors);
327 344
328int 345int
329RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q) 346RSA_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}
362LCRYPTO_ALIAS(RSA_set0_factors);
345 363
346const BIGNUM * 364const BIGNUM *
347RSA_get0_n(const RSA *r) 365RSA_get0_n(const RSA *r)
348{ 366{
349 return r->n; 367 return r->n;
350} 368}
369LCRYPTO_ALIAS(RSA_get0_n);
351 370
352const BIGNUM * 371const BIGNUM *
353RSA_get0_e(const RSA *r) 372RSA_get0_e(const RSA *r)
354{ 373{
355 return r->e; 374 return r->e;
356} 375}
376LCRYPTO_ALIAS(RSA_get0_e);
357 377
358const BIGNUM * 378const BIGNUM *
359RSA_get0_d(const RSA *r) 379RSA_get0_d(const RSA *r)
360{ 380{
361 return r->d; 381 return r->d;
362} 382}
383LCRYPTO_ALIAS(RSA_get0_d);
363 384
364const BIGNUM * 385const BIGNUM *
365RSA_get0_p(const RSA *r) 386RSA_get0_p(const RSA *r)
366{ 387{
367 return r->p; 388 return r->p;
368} 389}
390LCRYPTO_ALIAS(RSA_get0_p);
369 391
370const BIGNUM * 392const BIGNUM *
371RSA_get0_q(const RSA *r) 393RSA_get0_q(const RSA *r)
372{ 394{
373 return r->q; 395 return r->q;
374} 396}
397LCRYPTO_ALIAS(RSA_get0_q);
375 398
376const BIGNUM * 399const BIGNUM *
377RSA_get0_dmp1(const RSA *r) 400RSA_get0_dmp1(const RSA *r)
378{ 401{
379 return r->dmp1; 402 return r->dmp1;
380} 403}
404LCRYPTO_ALIAS(RSA_get0_dmp1);
381 405
382const BIGNUM * 406const BIGNUM *
383RSA_get0_dmq1(const RSA *r) 407RSA_get0_dmq1(const RSA *r)
384{ 408{
385 return r->dmq1; 409 return r->dmq1;
386} 410}
411LCRYPTO_ALIAS(RSA_get0_dmq1);
387 412
388const BIGNUM * 413const BIGNUM *
389RSA_get0_iqmp(const RSA *r) 414RSA_get0_iqmp(const RSA *r)
390{ 415{
391 return r->iqmp; 416 return r->iqmp;
392} 417}
418LCRYPTO_ALIAS(RSA_get0_iqmp);
393 419
394const RSA_PSS_PARAMS * 420const RSA_PSS_PARAMS *
395RSA_get0_pss_params(const RSA *r) 421RSA_get0_pss_params(const RSA *r)
396{ 422{
397 return r->pss; 423 return r->pss;
398} 424}
425LCRYPTO_ALIAS(RSA_get0_pss_params);
399 426
400void 427void
401RSA_clear_flags(RSA *r, int flags) 428RSA_clear_flags(RSA *r, int flags)
402{ 429{
403 r->flags &= ~flags; 430 r->flags &= ~flags;
404} 431}
432LCRYPTO_ALIAS(RSA_clear_flags);
405 433
406int 434int
407RSA_test_flags(const RSA *r, int flags) 435RSA_test_flags(const RSA *r, int flags)
408{ 436{
409 return r->flags & flags; 437 return r->flags & flags;
410} 438}
439LCRYPTO_ALIAS(RSA_test_flags);
411 440
412void 441void
413RSA_set_flags(RSA *r, int flags) 442RSA_set_flags(RSA *r, int flags)
414{ 443{
415 r->flags |= flags; 444 r->flags |= flags;
416} 445}
446LCRYPTO_ALIAS(RSA_set_flags);
417 447
418int 448int
419RSA_pkey_ctx_ctrl(EVP_PKEY_CTX *ctx, int optype, int cmd, int p1, void *p2) 449RSA_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}
459LCRYPTO_ALIAS(RSA_pkey_ctx_ctrl);