From 18adabd97858ed28289c9dc31e8042c515840be4 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 21 Dec 2016 15:49:29 +0000 Subject: Explicitly export a list of symbols from libcrypto. Move the "internal" BN functions from bn.h to bn_lcl.h and stop exporting the bn_* symbols. These are documented as only being intended for internal use, so why they were placed in a public header is beyond me... This hides 363 previously exported symbols, most of which exist in headers that are not installed and were never intended to be public. This also removes a few crusty old things that should have died long ago (like _ossl_old_des_read_pw). But don't worry... there are still 3451 symbols exported from the library. With input and testing from inoguchi@. ok beck@ inoguchi@ --- src/lib/libcrypto/ec/ec_lcl.h | 11 +++++++++-- src/lib/libcrypto/ec/ecp_nistz256_table.h | 6 +++++- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto/ec') diff --git a/src/lib/libcrypto/ec/ec_lcl.h b/src/lib/libcrypto/ec/ec_lcl.h index d11aaed8cb..e1c91e67ab 100644 --- a/src/lib/libcrypto/ec/ec_lcl.h +++ b/src/lib/libcrypto/ec/ec_lcl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_lcl.h,v 1.6 2016/11/04 17:33:19 miod Exp $ */ +/* $OpenBSD: ec_lcl.h,v 1.7 2016/12/21 15:49:29 jsing Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -69,19 +69,23 @@ * */ - #include #include #include #include +__BEGIN_HIDDEN_DECLS + #if defined(__SUNPRO_C) # if __SUNPRO_C >= 0x520 # pragma error_messages (off,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE) # endif #endif +#define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words))) +BIGNUM *bn_expand2(BIGNUM *a, int words); + /* Use default functions for poin2oct, oct2point and compressed coordinates */ #define EC_FLAGS_DEFAULT_OCT 0x1 @@ -447,4 +451,7 @@ void ec_GFp_nistp_points_make_affine_internal(size_t num, void *point_array, void (*felem_inv)(void *out, const void *in), void (*felem_contract)(void *out, const void *in)); void ec_GFp_nistp_recode_scalar_bits(unsigned char *sign, unsigned char *digit, unsigned char in); + #endif + +__END_HIDDEN_DECLS diff --git a/src/lib/libcrypto/ec/ecp_nistz256_table.h b/src/lib/libcrypto/ec/ecp_nistz256_table.h index 61f32a8a5a..6aa74edf35 100644 --- a/src/lib/libcrypto/ec/ecp_nistz256_table.h +++ b/src/lib/libcrypto/ec/ecp_nistz256_table.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ecp_nistz256_table.h,v 1.1 2016/11/04 17:33:19 miod Exp $ */ +/* $OpenBSD: ecp_nistz256_table.h,v 1.2 2016/12/21 15:49:29 jsing Exp $ */ /* Copyright (c) 2015, Intel Inc. * * Permission to use, copy, modify, and/or distribute this software for any @@ -25,6 +25,8 @@ * in order to increase the chances of using a large page but that appears to * lead to invalid ELF files being produced. */ +__BEGIN_HIDDEN_DECLS + #if defined(__GNUC__) __attribute((aligned(4096))) #elif defined(_MSC_VER) @@ -9551,3 +9553,5 @@ ecp_nistz256_precomputed TOBN(0xd6baef61, 0x3f714aa1), TOBN(0xf51865ad, 0xeb78795e), TOBN(0xd3e21fce, 0xe6a9d694), TOBN(0x82ceb1dd, 0x8a37b527)} }; + +__END_HIDDEN_DECLS -- cgit v1.2.3-55-g6feb