From: beck Date: Sat, 8 Jul 2023 15:29:03 +0000 (+0000) Subject: Hide symbols in dh X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d6d0b2f33c509ffa37804da3ebac9d6b3c0c3818;p=openbsd Hide symbols in dh ok tb@ --- diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index 4770e8f9d29..60d6195fac9 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -2706,3 +2706,48 @@ _libre_X25519 _libre_ED25519_keypair _libre_ED25519_sign _libre_ED25519_verify +_libre_d2i_DHparams_bio +_libre_i2d_DHparams_bio +_libre_d2i_DHparams_fp +_libre_i2d_DHparams_fp +_libre_DHparams_dup +_libre_DH_OpenSSL +_libre_DH_set_default_method +_libre_DH_get_default_method +_libre_DH_set_method +_libre_DH_new_method +_libre_DH_new +_libre_DH_free +_libre_DH_up_ref +_libre_DH_size +_libre_DH_bits +_libre_DH_get_ex_new_index +_libre_DH_set_ex_data +_libre_DH_get_ex_data +_libre_DH_security_bits +_libre_DH_get0_engine +_libre_DH_get0_pqg +_libre_DH_set0_pqg +_libre_DH_get0_key +_libre_DH_set0_key +_libre_DH_get0_p +_libre_DH_get0_q +_libre_DH_get0_g +_libre_DH_get0_priv_key +_libre_DH_get0_pub_key +_libre_DH_clear_flags +_libre_DH_test_flags +_libre_DH_set_flags +_libre_DH_get_length +_libre_DH_set_length +_libre_DH_generate_parameters +_libre_DH_generate_parameters_ex +_libre_DH_check +_libre_DH_check_pub_key +_libre_DH_generate_key +_libre_DH_compute_key +_libre_d2i_DHparams +_libre_i2d_DHparams +_libre_DHparams_print_fp +_libre_DHparams_print +_libre_ERR_load_DH_strings diff --git a/lib/libcrypto/dh/dh_ameth.c b/lib/libcrypto/dh/dh_ameth.c index 61d3d143972..cc594cfd38e 100644 --- a/lib/libcrypto/dh/dh_ameth.c +++ b/lib/libcrypto/dh/dh_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_ameth.c,v 1.29 2023/07/07 06:59:18 tb Exp $ */ +/* $OpenBSD: dh_ameth.c,v 1.30 2023/07/08 15:29:03 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -448,6 +448,7 @@ DHparams_print(BIO *bp, const DH *x) { return do_dh_print(bp, x, 4, NULL, 0); } +LCRYPTO_ALIAS(DHparams_print); int DHparams_print_fp(FILE *fp, const DH *x) @@ -466,6 +467,7 @@ DHparams_print_fp(FILE *fp, const DH *x) return ret; } +LCRYPTO_ALIAS(DHparams_print_fp); static int dh_pkey_public_check(const EVP_PKEY *pkey) diff --git a/lib/libcrypto/dh/dh_asn1.c b/lib/libcrypto/dh/dh_asn1.c index 10184f0b2d9..2e0b054d345 100644 --- a/lib/libcrypto/dh/dh_asn1.c +++ b/lib/libcrypto/dh/dh_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_asn1.c,v 1.11 2022/01/07 09:27:13 tb Exp $ */ +/* $OpenBSD: dh_asn1.c,v 1.12 2023/07/08 15:29:03 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -131,39 +131,46 @@ d2i_DHparams(DH **a, const unsigned char **in, long len) return (DH *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &DHparams_it); } +LCRYPTO_ALIAS(d2i_DHparams); int i2d_DHparams(const DH *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &DHparams_it); } +LCRYPTO_ALIAS(i2d_DHparams); DH * d2i_DHparams_bio(BIO *bp, DH **a) { return ASN1_item_d2i_bio(&DHparams_it, bp, a); } +LCRYPTO_ALIAS(d2i_DHparams_bio); int i2d_DHparams_bio(BIO *bp, DH *a) { return ASN1_item_i2d_bio(&DHparams_it, bp, a); } +LCRYPTO_ALIAS(i2d_DHparams_bio); DH * d2i_DHparams_fp(FILE *fp, DH **a) { return ASN1_item_d2i_fp(&DHparams_it, fp, a); } +LCRYPTO_ALIAS(d2i_DHparams_fp); int i2d_DHparams_fp(FILE *fp, DH *a) { return ASN1_item_i2d_fp(&DHparams_it, fp, a); } +LCRYPTO_ALIAS(i2d_DHparams_fp); DH * DHparams_dup(DH *dh) { return ASN1_item_dup(&DHparams_it, dh); } +LCRYPTO_ALIAS(DHparams_dup); diff --git a/lib/libcrypto/dh/dh_check.c b/lib/libcrypto/dh/dh_check.c index 9bbbd55b301..f3d89f620af 100644 --- a/lib/libcrypto/dh/dh_check.c +++ b/lib/libcrypto/dh/dh_check.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_check.c,v 1.26 2022/11/26 16:08:51 tb Exp $ */ +/* $OpenBSD: dh_check.c,v 1.27 2023/07/08 15:29:03 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -227,6 +227,7 @@ DH_check(const DH *dh, int *flags) BN_CTX_free(ctx); return ok; } +LCRYPTO_ALIAS(DH_check); int 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) return ok; } +LCRYPTO_ALIAS(DH_check_pub_key); diff --git a/lib/libcrypto/dh/dh_err.c b/lib/libcrypto/dh/dh_err.c index db66d68e3bb..f5dda2898d9 100644 --- a/lib/libcrypto/dh/dh_err.c +++ b/lib/libcrypto/dh/dh_err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_err.c,v 1.18 2022/07/12 14:42:49 kn Exp $ */ +/* $OpenBSD: dh_err.c,v 1.19 2023/07/08 15:29:03 beck Exp $ */ /* ==================================================================== * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. * @@ -111,3 +111,4 @@ void ERR_load_DH_strings(void) } #endif } +LCRYPTO_ALIAS(ERR_load_DH_strings); diff --git a/lib/libcrypto/dh/dh_gen.c b/lib/libcrypto/dh/dh_gen.c index d51d10d2abd..3ffa5d80f17 100644 --- a/lib/libcrypto/dh/dh_gen.c +++ b/lib/libcrypto/dh/dh_gen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_gen.c,v 1.20 2023/04/13 15:18:29 tb Exp $ */ +/* $OpenBSD: dh_gen.c,v 1.21 2023/07/08 15:29:03 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -75,6 +75,7 @@ DH_generate_parameters_ex(DH *ret, int prime_len, int generator, BN_GENCB *cb) return ret->meth->generate_params(ret, prime_len, generator, cb); return dh_builtin_genparams(ret, prime_len, generator, cb); } +LCRYPTO_ALIAS(DH_generate_parameters_ex); /* * We generate DH parameters as follows: @@ -193,3 +194,4 @@ DH_generate_parameters(int prime_len, int generator, DH_free(ret); return NULL; } +LCRYPTO_ALIAS(DH_generate_parameters); diff --git a/lib/libcrypto/dh/dh_key.c b/lib/libcrypto/dh/dh_key.c index 89ae5f0fdc4..a4bd6894836 100644 --- a/lib/libcrypto/dh/dh_key.c +++ b/lib/libcrypto/dh/dh_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_key.c,v 1.38 2022/11/26 16:08:51 tb Exp $ */ +/* $OpenBSD: dh_key.c,v 1.39 2023/07/08 15:29:03 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -77,12 +77,14 @@ DH_generate_key(DH *dh) { return dh->meth->generate_key(dh); } +LCRYPTO_ALIAS(DH_generate_key); int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) { return dh->meth->compute_key(key, pub_key, dh); } +LCRYPTO_ALIAS(DH_compute_key); static DH_METHOD dh_ossl = { .name = "OpenSSL DH Method", @@ -98,6 +100,7 @@ DH_OpenSSL(void) { return &dh_ossl; } +LCRYPTO_ALIAS(DH_OpenSSL); static int generate_key(DH *dh) diff --git a/lib/libcrypto/dh/dh_lib.c b/lib/libcrypto/dh/dh_lib.c index e5cb46485de..987f0b1f7ab 100644 --- a/lib/libcrypto/dh/dh_lib.c +++ b/lib/libcrypto/dh/dh_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dh_lib.c,v 1.38 2023/03/07 09:27:10 jsing Exp $ */ +/* $OpenBSD: dh_lib.c,v 1.39 2023/07/08 15:29:03 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -78,6 +78,7 @@ DH_set_default_method(const DH_METHOD *meth) { default_DH_method = meth; } +LCRYPTO_ALIAS(DH_set_default_method); const DH_METHOD * DH_get_default_method(void) @@ -86,6 +87,7 @@ DH_get_default_method(void) default_DH_method = DH_OpenSSL(); return default_DH_method; } +LCRYPTO_ALIAS(DH_get_default_method); int DH_set_method(DH *dh, const DH_METHOD *meth) @@ -108,12 +110,14 @@ DH_set_method(DH *dh, const DH_METHOD *meth) meth->init(dh); return 1; } +LCRYPTO_ALIAS(DH_set_method); DH * DH_new(void) { return DH_new_method(NULL); } +LCRYPTO_ALIAS(DH_new); DH * DH_new_method(ENGINE *engine) @@ -174,6 +178,7 @@ DH_new_method(ENGINE *engine) } return ret; } +LCRYPTO_ALIAS(DH_new_method); void DH_free(DH *r) @@ -204,6 +209,7 @@ DH_free(DH *r) BN_free(r->priv_key); free(r); } +LCRYPTO_ALIAS(DH_free); int DH_up_ref(DH *r) @@ -212,6 +218,7 @@ DH_up_ref(DH *r) return i > 1 ? 1 : 0; } +LCRYPTO_ALIAS(DH_up_ref); int 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, return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DH, argl, argp, new_func, dup_func, free_func); } +LCRYPTO_ALIAS(DH_get_ex_new_index); int DH_set_ex_data(DH *d, int idx, void *arg) { return CRYPTO_set_ex_data(&d->ex_data, idx, arg); } +LCRYPTO_ALIAS(DH_set_ex_data); void * DH_get_ex_data(DH *d, int idx) { return CRYPTO_get_ex_data(&d->ex_data, idx); } +LCRYPTO_ALIAS(DH_get_ex_data); int DH_size(const DH *dh) { return BN_num_bytes(dh->p); } +LCRYPTO_ALIAS(DH_size); int DH_bits(const DH *dh) { return BN_num_bits(dh->p); } +LCRYPTO_ALIAS(DH_bits); int DH_security_bits(const DH *dh) @@ -257,12 +269,14 @@ DH_security_bits(const DH *dh) return BN_security_bits(BN_num_bits(dh->p), N); } +LCRYPTO_ALIAS(DH_security_bits); ENGINE * DH_get0_engine(DH *dh) { return dh->engine; } +LCRYPTO_ALIAS(DH_get0_engine); void 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) if (g != NULL) *g = dh->g; } +LCRYPTO_ALIAS(DH_get0_pqg); int 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) return 1; } +LCRYPTO_ALIAS(DH_set0_pqg); void 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) if (priv_key != NULL) *priv_key = dh->priv_key; } +LCRYPTO_ALIAS(DH_get0_key); int 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) return 1; } +LCRYPTO_ALIAS(DH_set0_key); const BIGNUM * DH_get0_p(const DH *dh) { return dh->p; } +LCRYPTO_ALIAS(DH_get0_p); const BIGNUM * DH_get0_q(const DH *dh) { return dh->q; } +LCRYPTO_ALIAS(DH_get0_q); const BIGNUM * DH_get0_g(const DH *dh) { return dh->g; } +LCRYPTO_ALIAS(DH_get0_g); const BIGNUM * DH_get0_priv_key(const DH *dh) { return dh->priv_key; } +LCRYPTO_ALIAS(DH_get0_priv_key); const BIGNUM * DH_get0_pub_key(const DH *dh) { return dh->pub_key; } +LCRYPTO_ALIAS(DH_get0_pub_key); void DH_clear_flags(DH *dh, int flags) { dh->flags &= ~flags; } +LCRYPTO_ALIAS(DH_clear_flags); int DH_test_flags(const DH *dh, int flags) { return dh->flags & flags; } +LCRYPTO_ALIAS(DH_test_flags); void DH_set_flags(DH *dh, int flags) { dh->flags |= flags; } +LCRYPTO_ALIAS(DH_set_flags); long DH_get_length(const DH *dh) { return dh->length; } +LCRYPTO_ALIAS(DH_get_length); int DH_set_length(DH *dh, long length) @@ -385,3 +412,4 @@ DH_set_length(DH *dh, long length) dh->length = length; return 1; } +LCRYPTO_ALIAS(DH_set_length); diff --git a/lib/libcrypto/hidden/openssl/dh.h b/lib/libcrypto/hidden/openssl/dh.h new file mode 100644 index 00000000000..7e6d578151a --- /dev/null +++ b/lib/libcrypto/hidden/openssl/dh.h @@ -0,0 +1,74 @@ +/* $OpenBSD: dh.h,v 1.1 2023/07/08 15:29:04 beck Exp $ */ +/* + * Copyright (c) 2023 Bob Beck + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBCRYPTO_DH_H +#define _LIBCRYPTO_DH_H + +#ifndef _MSC_VER +#include_next +#else +#include "../include/openssl/dh.h" +#endif +#include "crypto_namespace.h" + +LCRYPTO_USED(d2i_DHparams_bio); +LCRYPTO_USED(i2d_DHparams_bio); +LCRYPTO_USED(d2i_DHparams_fp); +LCRYPTO_USED(i2d_DHparams_fp); +LCRYPTO_USED(DHparams_dup); +LCRYPTO_USED(DH_OpenSSL); +LCRYPTO_USED(DH_set_default_method); +LCRYPTO_USED(DH_get_default_method); +LCRYPTO_USED(DH_set_method); +LCRYPTO_USED(DH_new_method); +LCRYPTO_USED(DH_new); +LCRYPTO_USED(DH_free); +LCRYPTO_USED(DH_up_ref); +LCRYPTO_USED(DH_size); +LCRYPTO_USED(DH_bits); +LCRYPTO_USED(DH_get_ex_new_index); +LCRYPTO_USED(DH_set_ex_data); +LCRYPTO_USED(DH_get_ex_data); +LCRYPTO_USED(DH_security_bits); +LCRYPTO_USED(DH_get0_engine); +LCRYPTO_USED(DH_get0_pqg); +LCRYPTO_USED(DH_set0_pqg); +LCRYPTO_USED(DH_get0_key); +LCRYPTO_USED(DH_set0_key); +LCRYPTO_USED(DH_get0_p); +LCRYPTO_USED(DH_get0_q); +LCRYPTO_USED(DH_get0_g); +LCRYPTO_USED(DH_get0_priv_key); +LCRYPTO_USED(DH_get0_pub_key); +LCRYPTO_USED(DH_clear_flags); +LCRYPTO_USED(DH_test_flags); +LCRYPTO_USED(DH_set_flags); +LCRYPTO_USED(DH_get_length); +LCRYPTO_USED(DH_set_length); +LCRYPTO_USED(DH_generate_parameters); +LCRYPTO_USED(DH_generate_parameters_ex); +LCRYPTO_USED(DH_check); +LCRYPTO_USED(DH_check_pub_key); +LCRYPTO_USED(DH_generate_key); +LCRYPTO_USED(DH_compute_key); +LCRYPTO_USED(d2i_DHparams); +LCRYPTO_USED(i2d_DHparams); +LCRYPTO_USED(DHparams_print_fp); +LCRYPTO_USED(DHparams_print); +LCRYPTO_USED(ERR_load_DH_strings); + +#endif /* _LIBCRYPTO_DH_H */