aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2016-11-05 08:44:35 -0500
committerkinichiro <kinichiro.inoguchi@gmail.com>2016-11-06 00:24:12 +0900
commit7770e4f2e4b85fd8bf3123b16a7b30fb22f9f68b (patch)
tree74f317ae0cc4e6292570330adfd1f13845cc08b3
parent348362416d79760320d9120bbc0b653fb2a2e838 (diff)
downloadportable-7770e4f2e4b85fd8bf3123b16a7b30fb22f9f68b.tar.gz
portable-7770e4f2e4b85fd8bf3123b16a7b30fb22f9f68b.tar.bz2
portable-7770e4f2e4b85fd8bf3123b16a7b30fb22f9f68b.zip
implement support for hiding symbols in libtls / libssl
-rw-r--r--ssl/Makefile.am3
-rw-r--r--ssl/ssl.def331
-rw-r--r--tests/Makefile.am4
-rw-r--r--tls/Makefile.am3
-rw-r--r--tls/tls.def34
-rwxr-xr-xupdate.sh8
6 files changed, 42 insertions, 341 deletions
diff --git a/ssl/Makefile.am b/ssl/Makefile.am
index 31a0a88..b210b92 100644
--- a/ssl/Makefile.am
+++ b/ssl/Makefile.am
@@ -5,8 +5,9 @@ lib_LTLIBRARIES = libssl.la
5EXTRA_DIST = VERSION 5EXTRA_DIST = VERSION
6EXTRA_DIST += CMakeLists.txt 6EXTRA_DIST += CMakeLists.txt
7EXTRA_DIST += ssl.def 7EXTRA_DIST += ssl.def
8EXTRA_DIST += ssl.sym
8 9
9libssl_la_LDFLAGS = -version-info @LIBSSL_VERSION@ -no-undefined 10libssl_la_LDFLAGS = -version-info @LIBSSL_VERSION@ -no-undefined -export-symbols $(top_srcdir)/ssl/ssl.sym
10libssl_la_LIBADD = $(abs_top_builddir)/crypto/libcrypto.la 11libssl_la_LIBADD = $(abs_top_builddir)/crypto/libcrypto.la
11 12
12libssl_la_SOURCES = bio_ssl.c 13libssl_la_SOURCES = bio_ssl.c
diff --git a/ssl/ssl.def b/ssl/ssl.def
index 64a8497..716e346 100644
--- a/ssl/ssl.def
+++ b/ssl/ssl.def
@@ -5,63 +5,31 @@ BIO_new_ssl
5BIO_new_ssl_connect 5BIO_new_ssl_connect
6BIO_ssl_copy_session_id 6BIO_ssl_copy_session_id
7BIO_ssl_shutdown 7BIO_ssl_shutdown
8CBB_add_asn1
9CBB_add_asn1_uint64
10CBB_add_bytes
11CBB_add_space
12CBB_add_u16
13CBB_add_u16_length_prefixed
14CBB_add_u24
15CBB_add_u24_length_prefixed
16CBB_add_u8
17CBB_add_u8_length_prefixed
18CBB_cleanup
19CBB_finish
20CBB_flush
21CBB_init
22CBB_init_fixed
23CBS_asn1_indefinite_to_definite
24CBS_contains_zero_byte
25CBS_data
26CBS_dup
27CBS_get_any_asn1_element
28CBS_get_asn1
29CBS_get_asn1_element
30CBS_get_asn1_uint64
31CBS_get_bytes
32CBS_get_optional_asn1
33CBS_get_optional_asn1_bool
34CBS_get_optional_asn1_octet_string
35CBS_get_optional_asn1_uint64
36CBS_get_u16
37CBS_get_u16_length_prefixed
38CBS_get_u24
39CBS_get_u24_length_prefixed
40CBS_get_u32
41CBS_get_u8
42CBS_get_u8_length_prefixed
43CBS_init
44CBS_len
45CBS_mem_equal
46CBS_offset
47CBS_peek_asn1_tag
48CBS_skip
49CBS_stow
50CBS_strdup
51CBS_write_bytes
52DTLSv1_client_method 8DTLSv1_client_method
53DTLSv1_client_method_data
54DTLSv1_enc_data
55DTLSv1_method 9DTLSv1_method
56DTLSv1_method_data
57DTLSv1_server_method 10DTLSv1_server_method
58DTLSv1_server_method_data 11SSLv23_client_method
59ERR_load_SSL_strings 12SSLv23_method
60OBJ_bsearch_ssl_cipher_id 13SSLv23_server_method
14TLS_client_method
15TLS_method
16TLS_server_method
17TLSv1_1_client_method
18TLSv1_1_method
19TLSv1_1_server_method
20TLSv1_2_client_method
21TLSv1_2_method
22TLSv1_2_server_method
23TLSv1_client_method
24TLSv1_method
25TLSv1_server_method
61PEM_read_SSL_SESSION 26PEM_read_SSL_SESSION
62PEM_read_bio_SSL_SESSION 27PEM_read_bio_SSL_SESSION
63PEM_write_SSL_SESSION 28PEM_write_SSL_SESSION
64PEM_write_bio_SSL_SESSION 29PEM_write_bio_SSL_SESSION
30d2i_SSL_SESSION
31i2d_SSL_SESSION
32ERR_load_SSL_strings
65SSL_CIPHER_description 33SSL_CIPHER_description
66SSL_CIPHER_get_bits 34SSL_CIPHER_get_bits
67SSL_CIPHER_get_by_id 35SSL_CIPHER_get_by_id
@@ -288,266 +256,3 @@ SSL_version
288SSL_version_str 256SSL_version_str
289SSL_want 257SSL_want
290SSL_write 258SSL_write
291SSLv23_client_method
292SSLv23_method
293SSLv23_server_method
294TLS_client_method
295TLS_client_method_data
296TLS_method
297TLS_method_data
298TLS_server_method
299TLS_server_method_data
300TLSv1_1_client_method
301TLSv1_1_client_method_data
302TLSv1_1_enc_data
303TLSv1_1_method
304TLSv1_1_method_data
305TLSv1_1_server_method
306TLSv1_1_server_method_data
307TLSv1_2_client_method
308TLSv1_2_client_method_data
309TLSv1_2_enc_data
310TLSv1_2_method
311TLSv1_2_method_data
312TLSv1_2_server_method
313TLSv1_2_server_method_data
314TLSv1_client_method
315TLSv1_client_method_data
316TLSv1_enc_data
317TLSv1_method
318TLSv1_method_data
319TLSv1_server_method
320TLSv1_server_method_data
321cbs_get_any_asn1_element_internal
322d2i_SSL_SESSION
323do_dtls1_write
324dtls1_accept
325dtls1_buffer_message
326dtls1_build_sequence_number
327dtls1_check_timeout_num
328dtls1_clear
329dtls1_clear_record_buffer
330dtls1_connect
331dtls1_ctrl
332dtls1_default_timeout
333dtls1_dispatch_alert
334dtls1_do_write
335dtls1_double_timeout
336dtls1_enc
337dtls1_free
338dtls1_get_ccs_header
339dtls1_get_cipher
340dtls1_get_message
341dtls1_get_message_header
342dtls1_get_queue_priority
343dtls1_get_record
344dtls1_get_timeout
345dtls1_handle_timeout
346dtls1_is_timer_expired
347dtls1_listen
348dtls1_min_mtu
349dtls1_new
350dtls1_output_cert_chain
351dtls1_read_bytes
352dtls1_read_failed
353dtls1_reset_seq_numbers
354dtls1_retransmit_buffered_messages
355dtls1_retransmit_message
356dtls1_send_change_cipher_spec
357dtls1_send_client_certificate
358dtls1_send_server_certificate
359dtls1_set_message_header
360dtls1_shutdown
361dtls1_start_timer
362dtls1_stop_timer
363dtls1_write_app_data_bytes
364dtls1_write_bytes
365i2d_SSL_SESSION
366pitem_free
367pitem_new
368pqueue_find
369pqueue_free
370pqueue_insert
371pqueue_iterator
372pqueue_new
373pqueue_next
374pqueue_peek
375pqueue_pop
376pqueue_size
377ssl23_accept
378ssl23_connect
379ssl23_default_timeout
380ssl23_get_client_hello
381ssl23_peek
382ssl23_read
383ssl23_read_bytes
384ssl23_write
385ssl23_write_bytes
386ssl3_accept
387ssl3_callback_ctrl
388ssl3_cbc_copy_mac
389ssl3_cbc_digest_record
390ssl3_cbc_record_digest_supported
391ssl3_check_cert_and_algorithm
392ssl3_check_finished
393ssl3_choose_cipher
394ssl3_cipher_get_value
395ssl3_ciphers
396ssl3_clear
397ssl3_client_hello
398ssl3_connect
399ssl3_ctrl
400ssl3_ctx_callback_ctrl
401ssl3_ctx_ctrl
402ssl3_dispatch_alert
403ssl3_do_change_cipher_spec
404ssl3_do_write
405ssl3_free
406ssl3_get_cert_status
407ssl3_get_cert_verify
408ssl3_get_certificate_request
409ssl3_get_cipher
410ssl3_get_cipher_by_char
411ssl3_get_cipher_by_id
412ssl3_get_cipher_by_value
413ssl3_get_client_certificate
414ssl3_get_client_hello
415ssl3_get_client_key_exchange
416ssl3_get_finished
417ssl3_get_key_exchange
418ssl3_get_message
419ssl3_get_new_session_ticket
420ssl3_get_next_proto
421ssl3_get_req_cert_type
422ssl3_get_server_certificate
423ssl3_get_server_done
424ssl3_get_server_hello
425ssl3_handshake_msg_finish
426ssl3_handshake_msg_hdr_len
427ssl3_handshake_msg_start
428ssl3_handshake_write
429ssl3_new
430ssl3_num_ciphers
431ssl3_output_cert_chain
432ssl3_peek
433ssl3_pending
434ssl3_put_cipher_by_char
435ssl3_read
436ssl3_read_bytes
437ssl3_read_n
438ssl3_release_read_buffer
439ssl3_release_write_buffer
440ssl3_renegotiate
441ssl3_renegotiate_check
442ssl3_send_alert
443ssl3_send_cert_status
444ssl3_send_certificate_request
445ssl3_send_change_cipher_spec
446ssl3_send_client_certificate
447ssl3_send_client_key_exchange
448ssl3_send_client_verify
449ssl3_send_finished
450ssl3_send_hello_request
451ssl3_send_newsession_ticket
452ssl3_send_next_proto
453ssl3_send_server_certificate
454ssl3_send_server_done
455ssl3_send_server_hello
456ssl3_send_server_key_exchange
457ssl3_setup_buffers
458ssl3_setup_init_buffer
459ssl3_setup_read_buffer
460ssl3_setup_write_buffer
461ssl3_shutdown
462ssl3_undef_enc_method
463ssl3_write
464ssl3_write_bytes
465ssl3_write_pending
466ssl_add_clienthello_renegotiate_ext
467ssl_add_clienthello_tlsext
468ssl_add_clienthello_use_srtp_ext
469ssl_add_serverhello_renegotiate_ext
470ssl_add_serverhello_tlsext
471ssl_add_serverhello_use_srtp_ext
472ssl_bytes_to_cipher_list
473ssl_cert_dup
474ssl_cert_free
475ssl_cert_inst
476ssl_cert_new
477ssl_cert_type
478ssl_check_clienthello_tlsext_early
479ssl_check_clienthello_tlsext_late
480ssl_check_serverhello_tlsext
481ssl_check_srvr_ecc_cert_and_alg
482ssl_cipher_get_evp
483ssl_cipher_get_evp_aead
484ssl_cipher_id_cmp
485ssl_cipher_list_to_bytes
486ssl_cipher_ptr_id_cmp
487ssl_clear_bad_session
488ssl_clear_cipher_ctx
489ssl_clear_hash_ctx
490ssl_create_cipher_list
491ssl_do_client_cert_cb
492ssl_free_wbio_buffer
493ssl_get_algorithm2
494ssl_get_auto_dh
495ssl_get_ciphers_by_id
496ssl_get_handshake_digest
497ssl_get_new_session
498ssl_get_prev_session
499ssl_get_server_send_cert
500ssl_get_server_send_pkey
501ssl_get_sign_pkey
502ssl_init_wbio_buffer
503ssl_load_ciphers
504ssl_max_server_version
505ssl_ok
506ssl_parse_clienthello_renegotiate_ext
507ssl_parse_clienthello_tlsext
508ssl_parse_clienthello_use_srtp_ext
509ssl_parse_serverhello_renegotiate_ext
510ssl_parse_serverhello_tlsext
511ssl_parse_serverhello_use_srtp_ext
512ssl_sess_cert_free
513ssl_sess_cert_new
514ssl_set_cert_masks
515ssl_undefined_const_function
516ssl_undefined_function
517ssl_undefined_void_function
518ssl_update_cache
519ssl_verify_alarm_type
520ssl_verify_cert_chain
521ssl_version_string
522tls12_get_hash
523tls12_get_req_sig_algs
524tls12_get_sigandhash
525tls12_get_sigid
526tls1_alert_code
527tls1_cbc_remove_padding
528tls1_cert_verify_mac
529tls1_change_cipher_state
530tls1_check_curve
531tls1_check_ec_server_key
532tls1_check_ec_tmp_key
533tls1_cleanup_key_block
534tls1_clear
535tls1_default_timeout
536tls1_digest_cached_records
537tls1_ec_curve_id2nid
538tls1_ec_nid2curve_id
539tls1_enc
540tls1_export_keying_material
541tls1_final_finish_mac
542tls1_finish_mac
543tls1_free
544tls1_free_digest_list
545tls1_generate_master_secret
546tls1_get_shared_curve
547tls1_init_finished_mac
548tls1_mac
549tls1_new
550tls1_process_sigalgs
551tls1_process_ticket
552tls1_record_sequence_increment
553tls1_setup_key_block
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 85720c2..5c575a8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -8,9 +8,9 @@ AM_CPPFLAGS += -I $(top_srcdir)/apps/openssl/compat
8AM_CPPFLAGS += -D_PATH_SSL_CA_FILE=\"$(top_srcdir)/apps/openssl/cert.pem\" 8AM_CPPFLAGS += -D_PATH_SSL_CA_FILE=\"$(top_srcdir)/apps/openssl/cert.pem\"
9 9
10LDADD = $(PLATFORM_LDADD) $(PROG_LDADD) 10LDADD = $(PLATFORM_LDADD) $(PROG_LDADD)
11LDADD += $(abs_top_builddir)/ssl/libssl.la 11LDADD += $(abs_top_builddir)/tls/.libs/libtls.a
12LDADD += $(abs_top_builddir)/ssl/.libs/libssl.a
12LDADD += $(abs_top_builddir)/crypto/libcrypto.la 13LDADD += $(abs_top_builddir)/crypto/libcrypto.la
13LDADD += $(abs_top_builddir)/tls/libtls.la
14 14
15TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh 15TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
16 16
diff --git a/tls/Makefile.am b/tls/Makefile.am
index 2fc1c2d..3212dfd 100644
--- a/tls/Makefile.am
+++ b/tls/Makefile.am
@@ -5,8 +5,9 @@ lib_LTLIBRARIES = libtls.la
5EXTRA_DIST = VERSION 5EXTRA_DIST = VERSION
6EXTRA_DIST += CMakeLists.txt 6EXTRA_DIST += CMakeLists.txt
7EXTRA_DIST += tls.def 7EXTRA_DIST += tls.def
8EXTRA_DIST += tls.sym
8 9
9libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined 10libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined -export-symbols $(top_srcdir)/tls/tls.sym
10libtls_la_LIBADD = $(abs_top_builddir)/ssl/libssl.la 11libtls_la_LIBADD = $(abs_top_builddir)/ssl/libssl.la
11libtls_la_LIBADD += $(abs_top_builddir)/crypto/libcrypto.la 12libtls_la_LIBADD += $(abs_top_builddir)/crypto/libcrypto.la
12libtls_la_LIBADD += $(PLATFORM_LDADD) 13libtls_la_LIBADD += $(PLATFORM_LDADD)
diff --git a/tls/tls.def b/tls/tls.def
index f8f91e5..afab188 100644
--- a/tls/tls.def
+++ b/tls/tls.def
@@ -1,9 +1,7 @@
1EXPORTS 1EXPORTS
2strsep
3tls_accept_cbs 2tls_accept_cbs
4tls_accept_fds 3tls_accept_fds
5tls_accept_socket 4tls_accept_socket
6tls_check_name
7tls_client 5tls_client
8tls_close 6tls_close
9tls_config_add_keypair_file 7tls_config_add_keypair_file
@@ -14,8 +12,8 @@ tls_config_free
14tls_config_insecure_noverifycert 12tls_config_insecure_noverifycert
15tls_config_insecure_noverifyname 13tls_config_insecure_noverifyname
16tls_config_insecure_noverifytime 14tls_config_insecure_noverifytime
17tls_config_load_file
18tls_config_new 15tls_config_new
16tls_config_ocsp_require_stapling
19tls_config_parse_protocols 17tls_config_parse_protocols
20tls_config_prefer_ciphers_client 18tls_config_prefer_ciphers_client
21tls_config_prefer_ciphers_server 19tls_config_prefer_ciphers_server
@@ -28,8 +26,6 @@ tls_config_set_cert_mem
28tls_config_set_ciphers 26tls_config_set_ciphers
29tls_config_set_dheparams 27tls_config_set_dheparams
30tls_config_set_ecdhecurve 28tls_config_set_ecdhecurve
31tls_config_set_error
32tls_config_set_errorx
33tls_config_set_key_file 29tls_config_set_key_file
34tls_config_set_key_mem 30tls_config_set_key_mem
35tls_config_set_keypair_file 31tls_config_set_keypair_file
@@ -40,10 +36,6 @@ tls_config_verify
40tls_config_verify_client 36tls_config_verify_client
41tls_config_verify_client_optional 37tls_config_verify_client_optional
42tls_configure 38tls_configure
43tls_configure_server
44tls_configure_ssl
45tls_configure_ssl_keypair
46tls_configure_ssl_verify
47tls_conn_alpn_selected 39tls_conn_alpn_selected
48tls_conn_cipher 40tls_conn_cipher
49tls_conn_servername 41tls_conn_servername
@@ -53,19 +45,12 @@ tls_connect_cbs
53tls_connect_fds 45tls_connect_fds
54tls_connect_servername 46tls_connect_servername
55tls_connect_socket 47tls_connect_socket
56tls_conninfo_free
57tls_conninfo_populate
58tls_error 48tls_error
59tls_error_set
60tls_error_setx
61tls_free 49tls_free
62tls_handshake 50tls_handshake
63tls_handshake_client
64tls_handshake_server
65tls_host_port
66tls_init 51tls_init
67tls_load_file 52tls_load_file
68tls_new 53tls_ocsp_process_response
69tls_peer_cert_contains_name 54tls_peer_cert_contains_name
70tls_peer_cert_hash 55tls_peer_cert_hash
71tls_peer_cert_issuer 56tls_peer_cert_issuer
@@ -73,14 +58,15 @@ tls_peer_cert_notafter
73tls_peer_cert_notbefore 58tls_peer_cert_notbefore
74tls_peer_cert_provided 59tls_peer_cert_provided
75tls_peer_cert_subject 60tls_peer_cert_subject
61tls_peer_ocsp_cert_status
62tls_peer_ocsp_crl_reason
63tls_peer_ocsp_next_update
64tls_peer_ocsp_response_status
65tls_peer_ocsp_result
66tls_peer_ocsp_revocation_time
67tls_peer_ocsp_this_update
68tls_peer_ocsp_url
76tls_read 69tls_read
77tls_reset 70tls_reset
78tls_server 71tls_server
79tls_server_conn
80tls_set_cbs
81tls_set_error
82tls_set_errorx
83tls_sni_ctx_free
84tls_sni_ctx_new
85tls_ssl_error
86tls_write 72tls_write
diff --git a/update.sh b/update.sh
index 131a374..7a2d065 100755
--- a/update.sh
+++ b/update.sh
@@ -199,6 +199,10 @@ for i in `awk '/SOURCES|HEADERS/ { print $3 }' tls/Makefile.am` ; do
199 $CP $libtls_src/$i libtls-standalone/src 199 $CP $libtls_src/$i libtls-standalone/src
200 fi 200 fi
201done 201done
202# add the libtls symbol export list
203grep '^[[:alpha:]]' < $libtls_src/Symbols.list > tls/tls.sym
204echo EXPORTS > tls/tls.def
205cat tls/tls.sym >> tls/tls.def
202 206
203$CP_LIBC $libc_src/string/strsep.c tls 207$CP_LIBC $libc_src/string/strsep.c tls
204$CP_LIBC $libc_src/string/strsep.c libtls-standalone/compat 208$CP_LIBC $libc_src/string/strsep.c libtls-standalone/compat
@@ -240,6 +244,10 @@ rm -f ssl/*.c ssl/*.h
240for i in `awk '/SOURCES|HEADERS/ { print $3 }' ssl/Makefile.am` ; do 244for i in `awk '/SOURCES|HEADERS/ { print $3 }' ssl/Makefile.am` ; do
241 $CP $libssl_src/$i ssl 245 $CP $libssl_src/$i ssl
242done 246done
247# add the libssl symbol export list
248grep '^[[:alpha:]]' < $libssl_src/Symbols.list > ssl/ssl.sym
249echo EXPORTS > ssl/ssl.def
250cat ssl/ssl.sym >> ssl/ssl.def
243 251
244# copy libcrypto tests 252# copy libcrypto tests
245echo "copying tests" 253echo "copying tests"