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 | |
parent | 11219faca0a481767f00bb6d2d523c4c847b6299 (diff) | |
download | openbsd-fb3005d44347523e79c18cf8f224d6044f34af04.tar.gz openbsd-fb3005d44347523e79c18cf8f224d6044f34af04.tar.bz2 openbsd-fb3005d44347523e79c18cf8f224d6044f34af04.zip |
Hide symbols in dh
ok tb@
-rw-r--r-- | src/lib/libcrypto/Symbols.namespace | 45 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_ameth.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_asn1.c | 9 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_check.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_err.c | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_gen.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_key.c | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_lib.c | 30 | ||||
-rw-r--r-- | src/lib/libcrypto/hidden/openssl/dh.h | 74 |
9 files changed, 171 insertions, 7 deletions
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace index 4770e8f9d2..60d6195fac 100644 --- a/src/lib/libcrypto/Symbols.namespace +++ b/src/lib/libcrypto/Symbols.namespace | |||
@@ -2706,3 +2706,48 @@ _libre_X25519 | |||
2706 | _libre_ED25519_keypair | 2706 | _libre_ED25519_keypair |
2707 | _libre_ED25519_sign | 2707 | _libre_ED25519_sign |
2708 | _libre_ED25519_verify | 2708 | _libre_ED25519_verify |
2709 | _libre_d2i_DHparams_bio | ||
2710 | _libre_i2d_DHparams_bio | ||
2711 | _libre_d2i_DHparams_fp | ||
2712 | _libre_i2d_DHparams_fp | ||
2713 | _libre_DHparams_dup | ||
2714 | _libre_DH_OpenSSL | ||
2715 | _libre_DH_set_default_method | ||
2716 | _libre_DH_get_default_method | ||
2717 | _libre_DH_set_method | ||
2718 | _libre_DH_new_method | ||
2719 | _libre_DH_new | ||
2720 | _libre_DH_free | ||
2721 | _libre_DH_up_ref | ||
2722 | _libre_DH_size | ||
2723 | _libre_DH_bits | ||
2724 | _libre_DH_get_ex_new_index | ||
2725 | _libre_DH_set_ex_data | ||
2726 | _libre_DH_get_ex_data | ||
2727 | _libre_DH_security_bits | ||
2728 | _libre_DH_get0_engine | ||
2729 | _libre_DH_get0_pqg | ||
2730 | _libre_DH_set0_pqg | ||
2731 | _libre_DH_get0_key | ||
2732 | _libre_DH_set0_key | ||
2733 | _libre_DH_get0_p | ||
2734 | _libre_DH_get0_q | ||
2735 | _libre_DH_get0_g | ||
2736 | _libre_DH_get0_priv_key | ||
2737 | _libre_DH_get0_pub_key | ||
2738 | _libre_DH_clear_flags | ||
2739 | _libre_DH_test_flags | ||
2740 | _libre_DH_set_flags | ||
2741 | _libre_DH_get_length | ||
2742 | _libre_DH_set_length | ||
2743 | _libre_DH_generate_parameters | ||
2744 | _libre_DH_generate_parameters_ex | ||
2745 | _libre_DH_check | ||
2746 | _libre_DH_check_pub_key | ||
2747 | _libre_DH_generate_key | ||
2748 | _libre_DH_compute_key | ||
2749 | _libre_d2i_DHparams | ||
2750 | _libre_i2d_DHparams | ||
2751 | _libre_DHparams_print_fp | ||
2752 | _libre_DHparams_print | ||
2753 | _libre_ERR_load_DH_strings | ||
diff --git a/src/lib/libcrypto/dh/dh_ameth.c b/src/lib/libcrypto/dh/dh_ameth.c index 61d3d14397..cc594cfd38 100644 --- a/src/lib/libcrypto/dh/dh_ameth.c +++ b/src/lib/libcrypto/dh/dh_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_ameth.c,v 1.29 2023/07/07 06:59:18 tb Exp $ */ | 1 | /* $OpenBSD: dh_ameth.c,v 1.30 2023/07/08 15:29:03 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -448,6 +448,7 @@ DHparams_print(BIO *bp, const DH *x) | |||
448 | { | 448 | { |
449 | return do_dh_print(bp, x, 4, NULL, 0); | 449 | return do_dh_print(bp, x, 4, NULL, 0); |
450 | } | 450 | } |
451 | LCRYPTO_ALIAS(DHparams_print); | ||
451 | 452 | ||
452 | int | 453 | int |
453 | DHparams_print_fp(FILE *fp, const DH *x) | 454 | DHparams_print_fp(FILE *fp, const DH *x) |
@@ -466,6 +467,7 @@ DHparams_print_fp(FILE *fp, const DH *x) | |||
466 | 467 | ||
467 | return ret; | 468 | return ret; |
468 | } | 469 | } |
470 | LCRYPTO_ALIAS(DHparams_print_fp); | ||
469 | 471 | ||
470 | static int | 472 | static int |
471 | dh_pkey_public_check(const EVP_PKEY *pkey) | 473 | dh_pkey_public_check(const EVP_PKEY *pkey) |
diff --git a/src/lib/libcrypto/dh/dh_asn1.c b/src/lib/libcrypto/dh/dh_asn1.c index 10184f0b2d..2e0b054d34 100644 --- a/src/lib/libcrypto/dh/dh_asn1.c +++ b/src/lib/libcrypto/dh/dh_asn1.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_asn1.c,v 1.11 2022/01/07 09:27:13 tb Exp $ */ | 1 | /* $OpenBSD: dh_asn1.c,v 1.12 2023/07/08 15:29:03 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -131,39 +131,46 @@ d2i_DHparams(DH **a, const unsigned char **in, long len) | |||
131 | return (DH *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, | 131 | return (DH *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, |
132 | &DHparams_it); | 132 | &DHparams_it); |
133 | } | 133 | } |
134 | LCRYPTO_ALIAS(d2i_DHparams); | ||
134 | 135 | ||
135 | int | 136 | int |
136 | i2d_DHparams(const DH *a, unsigned char **out) | 137 | i2d_DHparams(const DH *a, unsigned char **out) |
137 | { | 138 | { |
138 | return ASN1_item_i2d((ASN1_VALUE *)a, out, &DHparams_it); | 139 | return ASN1_item_i2d((ASN1_VALUE *)a, out, &DHparams_it); |
139 | } | 140 | } |
141 | LCRYPTO_ALIAS(i2d_DHparams); | ||
140 | 142 | ||
141 | DH * | 143 | DH * |
142 | d2i_DHparams_bio(BIO *bp, DH **a) | 144 | d2i_DHparams_bio(BIO *bp, DH **a) |
143 | { | 145 | { |
144 | return ASN1_item_d2i_bio(&DHparams_it, bp, a); | 146 | return ASN1_item_d2i_bio(&DHparams_it, bp, a); |
145 | } | 147 | } |
148 | LCRYPTO_ALIAS(d2i_DHparams_bio); | ||
146 | 149 | ||
147 | int | 150 | int |
148 | i2d_DHparams_bio(BIO *bp, DH *a) | 151 | i2d_DHparams_bio(BIO *bp, DH *a) |
149 | { | 152 | { |
150 | return ASN1_item_i2d_bio(&DHparams_it, bp, a); | 153 | return ASN1_item_i2d_bio(&DHparams_it, bp, a); |
151 | } | 154 | } |
155 | LCRYPTO_ALIAS(i2d_DHparams_bio); | ||
152 | 156 | ||
153 | DH * | 157 | DH * |
154 | d2i_DHparams_fp(FILE *fp, DH **a) | 158 | d2i_DHparams_fp(FILE *fp, DH **a) |
155 | { | 159 | { |
156 | return ASN1_item_d2i_fp(&DHparams_it, fp, a); | 160 | return ASN1_item_d2i_fp(&DHparams_it, fp, a); |
157 | } | 161 | } |
162 | LCRYPTO_ALIAS(d2i_DHparams_fp); | ||
158 | 163 | ||
159 | int | 164 | int |
160 | i2d_DHparams_fp(FILE *fp, DH *a) | 165 | i2d_DHparams_fp(FILE *fp, DH *a) |
161 | { | 166 | { |
162 | return ASN1_item_i2d_fp(&DHparams_it, fp, a); | 167 | return ASN1_item_i2d_fp(&DHparams_it, fp, a); |
163 | } | 168 | } |
169 | LCRYPTO_ALIAS(i2d_DHparams_fp); | ||
164 | 170 | ||
165 | DH * | 171 | DH * |
166 | DHparams_dup(DH *dh) | 172 | DHparams_dup(DH *dh) |
167 | { | 173 | { |
168 | return ASN1_item_dup(&DHparams_it, dh); | 174 | return ASN1_item_dup(&DHparams_it, dh); |
169 | } | 175 | } |
176 | LCRYPTO_ALIAS(DHparams_dup); | ||
diff --git a/src/lib/libcrypto/dh/dh_check.c b/src/lib/libcrypto/dh/dh_check.c index 9bbbd55b30..f3d89f620a 100644 --- a/src/lib/libcrypto/dh/dh_check.c +++ b/src/lib/libcrypto/dh/dh_check.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_check.c,v 1.26 2022/11/26 16:08:51 tb Exp $ */ | 1 | /* $OpenBSD: dh_check.c,v 1.27 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 | * |
@@ -227,6 +227,7 @@ DH_check(const DH *dh, int *flags) | |||
227 | BN_CTX_free(ctx); | 227 | BN_CTX_free(ctx); |
228 | return ok; | 228 | return ok; |
229 | } | 229 | } |
230 | LCRYPTO_ALIAS(DH_check); | ||
230 | 231 | ||
231 | int | 232 | int |
232 | DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key) | 233 | DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key) |
@@ -299,3 +300,4 @@ DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *flags) | |||
299 | 300 | ||
300 | return ok; | 301 | return ok; |
301 | } | 302 | } |
303 | LCRYPTO_ALIAS(DH_check_pub_key); | ||
diff --git a/src/lib/libcrypto/dh/dh_err.c b/src/lib/libcrypto/dh/dh_err.c index db66d68e3b..f5dda2898d 100644 --- a/src/lib/libcrypto/dh/dh_err.c +++ b/src/lib/libcrypto/dh/dh_err.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_err.c,v 1.18 2022/07/12 14:42:49 kn Exp $ */ | 1 | /* $OpenBSD: dh_err.c,v 1.19 2023/07/08 15:29:03 beck Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -111,3 +111,4 @@ void ERR_load_DH_strings(void) | |||
111 | } | 111 | } |
112 | #endif | 112 | #endif |
113 | } | 113 | } |
114 | LCRYPTO_ALIAS(ERR_load_DH_strings); | ||
diff --git a/src/lib/libcrypto/dh/dh_gen.c b/src/lib/libcrypto/dh/dh_gen.c index d51d10d2ab..3ffa5d80f1 100644 --- a/src/lib/libcrypto/dh/dh_gen.c +++ b/src/lib/libcrypto/dh/dh_gen.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_gen.c,v 1.20 2023/04/13 15:18:29 tb Exp $ */ | 1 | /* $OpenBSD: dh_gen.c,v 1.21 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 | * |
@@ -75,6 +75,7 @@ DH_generate_parameters_ex(DH *ret, int prime_len, int generator, BN_GENCB *cb) | |||
75 | return ret->meth->generate_params(ret, prime_len, generator, cb); | 75 | return ret->meth->generate_params(ret, prime_len, generator, cb); |
76 | return dh_builtin_genparams(ret, prime_len, generator, cb); | 76 | return dh_builtin_genparams(ret, prime_len, generator, cb); |
77 | } | 77 | } |
78 | LCRYPTO_ALIAS(DH_generate_parameters_ex); | ||
78 | 79 | ||
79 | /* | 80 | /* |
80 | * We generate DH parameters as follows: | 81 | * We generate DH parameters as follows: |
@@ -193,3 +194,4 @@ DH_generate_parameters(int prime_len, int generator, | |||
193 | DH_free(ret); | 194 | DH_free(ret); |
194 | return NULL; | 195 | return NULL; |
195 | } | 196 | } |
197 | LCRYPTO_ALIAS(DH_generate_parameters); | ||
diff --git a/src/lib/libcrypto/dh/dh_key.c b/src/lib/libcrypto/dh/dh_key.c index 89ae5f0fdc..a4bd689483 100644 --- a/src/lib/libcrypto/dh/dh_key.c +++ b/src/lib/libcrypto/dh/dh_key.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_key.c,v 1.38 2022/11/26 16:08:51 tb Exp $ */ | 1 | /* $OpenBSD: dh_key.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 | * |
@@ -77,12 +77,14 @@ DH_generate_key(DH *dh) | |||
77 | { | 77 | { |
78 | return dh->meth->generate_key(dh); | 78 | return dh->meth->generate_key(dh); |
79 | } | 79 | } |
80 | LCRYPTO_ALIAS(DH_generate_key); | ||
80 | 81 | ||
81 | int | 82 | int |
82 | DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) | 83 | DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) |
83 | { | 84 | { |
84 | return dh->meth->compute_key(key, pub_key, dh); | 85 | return dh->meth->compute_key(key, pub_key, dh); |
85 | } | 86 | } |
87 | LCRYPTO_ALIAS(DH_compute_key); | ||
86 | 88 | ||
87 | static DH_METHOD dh_ossl = { | 89 | static DH_METHOD dh_ossl = { |
88 | .name = "OpenSSL DH Method", | 90 | .name = "OpenSSL DH Method", |
@@ -98,6 +100,7 @@ DH_OpenSSL(void) | |||
98 | { | 100 | { |
99 | return &dh_ossl; | 101 | return &dh_ossl; |
100 | } | 102 | } |
103 | LCRYPTO_ALIAS(DH_OpenSSL); | ||
101 | 104 | ||
102 | static int | 105 | static int |
103 | generate_key(DH *dh) | 106 | generate_key(DH *dh) |
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); | ||
diff --git a/src/lib/libcrypto/hidden/openssl/dh.h b/src/lib/libcrypto/hidden/openssl/dh.h new file mode 100644 index 0000000000..7e6d578151 --- /dev/null +++ b/src/lib/libcrypto/hidden/openssl/dh.h | |||
@@ -0,0 +1,74 @@ | |||
1 | /* $OpenBSD: dh.h,v 1.1 2023/07/08 15:29:04 beck Exp $ */ | ||
2 | /* | ||
3 | * Copyright (c) 2023 Bob Beck <beck@openbsd.org> | ||
4 | * | ||
5 | * Permission to use, copy, modify, and distribute this software for any | ||
6 | * purpose with or without fee is hereby granted, provided that the above | ||
7 | * copyright notice and this permission notice appear in all copies. | ||
8 | * | ||
9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | */ | ||
17 | |||
18 | #ifndef _LIBCRYPTO_DH_H | ||
19 | #define _LIBCRYPTO_DH_H | ||
20 | |||
21 | #ifndef _MSC_VER | ||
22 | #include_next <openssl/dh.h> | ||
23 | #else | ||
24 | #include "../include/openssl/dh.h" | ||
25 | #endif | ||
26 | #include "crypto_namespace.h" | ||
27 | |||
28 | LCRYPTO_USED(d2i_DHparams_bio); | ||
29 | LCRYPTO_USED(i2d_DHparams_bio); | ||
30 | LCRYPTO_USED(d2i_DHparams_fp); | ||
31 | LCRYPTO_USED(i2d_DHparams_fp); | ||
32 | LCRYPTO_USED(DHparams_dup); | ||
33 | LCRYPTO_USED(DH_OpenSSL); | ||
34 | LCRYPTO_USED(DH_set_default_method); | ||
35 | LCRYPTO_USED(DH_get_default_method); | ||
36 | LCRYPTO_USED(DH_set_method); | ||
37 | LCRYPTO_USED(DH_new_method); | ||
38 | LCRYPTO_USED(DH_new); | ||
39 | LCRYPTO_USED(DH_free); | ||
40 | LCRYPTO_USED(DH_up_ref); | ||
41 | LCRYPTO_USED(DH_size); | ||
42 | LCRYPTO_USED(DH_bits); | ||
43 | LCRYPTO_USED(DH_get_ex_new_index); | ||
44 | LCRYPTO_USED(DH_set_ex_data); | ||
45 | LCRYPTO_USED(DH_get_ex_data); | ||
46 | LCRYPTO_USED(DH_security_bits); | ||
47 | LCRYPTO_USED(DH_get0_engine); | ||
48 | LCRYPTO_USED(DH_get0_pqg); | ||
49 | LCRYPTO_USED(DH_set0_pqg); | ||
50 | LCRYPTO_USED(DH_get0_key); | ||
51 | LCRYPTO_USED(DH_set0_key); | ||
52 | LCRYPTO_USED(DH_get0_p); | ||
53 | LCRYPTO_USED(DH_get0_q); | ||
54 | LCRYPTO_USED(DH_get0_g); | ||
55 | LCRYPTO_USED(DH_get0_priv_key); | ||
56 | LCRYPTO_USED(DH_get0_pub_key); | ||
57 | LCRYPTO_USED(DH_clear_flags); | ||
58 | LCRYPTO_USED(DH_test_flags); | ||
59 | LCRYPTO_USED(DH_set_flags); | ||
60 | LCRYPTO_USED(DH_get_length); | ||
61 | LCRYPTO_USED(DH_set_length); | ||
62 | LCRYPTO_USED(DH_generate_parameters); | ||
63 | LCRYPTO_USED(DH_generate_parameters_ex); | ||
64 | LCRYPTO_USED(DH_check); | ||
65 | LCRYPTO_USED(DH_check_pub_key); | ||
66 | LCRYPTO_USED(DH_generate_key); | ||
67 | LCRYPTO_USED(DH_compute_key); | ||
68 | LCRYPTO_USED(d2i_DHparams); | ||
69 | LCRYPTO_USED(i2d_DHparams); | ||
70 | LCRYPTO_USED(DHparams_print_fp); | ||
71 | LCRYPTO_USED(DHparams_print); | ||
72 | LCRYPTO_USED(ERR_load_DH_strings); | ||
73 | |||
74 | #endif /* _LIBCRYPTO_DH_H */ | ||