File 0005-libssl-Hide-library-private-symbols.patch of Package openssl.openSUSE_13.1_Update
From 89d5aecbc62842651cf22e48c405eb435feb0df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez@opensuse.org> Date: Wed, 24 Jul 2013 23:29:05 -0400 Subject: [PATCH 5/5] libssl: Hide library private symbols This patch only contains the libssl part (the easy one) patch to libcrypto will follow after it is complete and good enough. It hides all the library symbols that are not part of the public API/ABI when GCC 4 or later is used. --- ssl/kssl_lcl.h | 9 +++++++++ ssl/ssl_locl.h | 8 ++++++++ 2 files changed, 17 insertions(+) Index: openssl-1.0.1h/ssl/kssl_lcl.h =================================================================== --- openssl-1.0.1h.orig/ssl/kssl_lcl.h +++ openssl-1.0.1h/ssl/kssl_lcl.h @@ -61,6 +61,10 @@ #include <openssl/kssl.h> +#if defined(__GNUC__) && __GNUC__ >= 4 +#pragma GCC visibility push(hidden) +#endif + #ifndef OPENSSL_NO_KRB5 #ifdef __cplusplus @@ -84,4 +88,9 @@ int kssl_tgt_is_available(KSSL_CTX *kssl } #endif #endif /* OPENSSL_NO_KRB5 */ + +#if defined(__GNUC__) && __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + #endif /* KSSL_LCL_H */ Index: openssl-1.0.1h/ssl/ssl_locl.h =================================================================== --- openssl-1.0.1h.orig/ssl/ssl_locl.h +++ openssl-1.0.1h/ssl/ssl_locl.h @@ -165,6 +165,10 @@ #include <openssl/ssl.h> #include <openssl/symhacks.h> +#if defined(__GNUC__) && __GNUC__ >= 4 +#pragma GCC visibility push(hidden) +#endif + #ifdef OPENSSL_BUILD_SHLIBSSL # undef OPENSSL_EXTERN # define OPENSSL_EXTERN OPENSSL_EXPORT @@ -1174,4 +1178,8 @@ void tls_fips_digest_extra( const EVP_CIPHER_CTX *cipher_ctx, EVP_MD_CTX *mac_ctx, const unsigned char *data, size_t data_len, size_t orig_len); +#if defined(__GNUC__) && __GNUC__ >= 4 +#pragma GCC visibility pop +#endif + #endif Index: openssl-1.0.1h/test/Makefile =================================================================== --- openssl-1.0.1h.orig/test/Makefile +++ openssl-1.0.1h/test/Makefile @@ -75,7 +75,7 @@ EXE= $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_ $(RANDTEST)$(EXE_EXT) $(DHTEST)$(EXE_EXT) $(ENGINETEST)$(EXE_EXT) \ $(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \ $(EVPTEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT) $(SRPTEST)$(EXE_EXT) \ - $(ASN1TEST)$(EXE_EXT) $(HEARTBEATTEST)$(EXE_EXT) + $(ASN1TEST)$(EXE_EXT) # $(METHTEST)$(EXE_EXT) @@ -87,7 +87,7 @@ OBJ= $(BNTEST).o $(ECTEST).o $(ECDSATES $(MDC2TEST).o $(RMDTEST).o \ $(RANDTEST).o $(DHTEST).o $(ENGINETEST).o $(CASTTEST).o \ $(BFTEST).o $(SSLTEST).o $(DSATEST).o $(EXPTEST).o $(RSATEST).o \ - $(EVPTEST).o $(IGETEST).o $(JPAKETEST).o $(ASN1TEST).o $(HEARTBEATTEST).o + $(EVPTEST).o $(IGETEST).o $(JPAKETEST).o $(ASN1TEST).o SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ $(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \ @@ -140,7 +140,7 @@ alltests: \ test_enc test_x509 test_rsa test_crl test_sid \ test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ test_ss test_ca test_engine test_evp test_ssl test_tsa test_ige \ - test_jpake test_srp test_cms test_heartbeat + test_jpake test_srp test_cms test_evp: ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt