summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorguenther <>2016-11-04 18:23:32 +0000
committerguenther <>2016-11-04 18:23:32 +0000
commite8686503dae1f619d00440b2df8c7bdef857a901 (patch)
tree30cc145fffcee6328b94fed90a468aa94b74da74 /src/lib
parent3b007660bd04b1ebd97816eb1f5c5949de969c45 (diff)
downloadopenbsd-e8686503dae1f619d00440b2df8c7bdef857a901.tar.gz
openbsd-e8686503dae1f619d00440b2df8c7bdef857a901.tar.bz2
openbsd-e8686503dae1f619d00440b2df8c7bdef857a901.zip
Add an explict list of exported symbols with just the functions declared
in <tls.h>, and use __{BEGIN,END}_HIDDEN_DECLS in tls_internal.h to optimize internal functions ok jsing@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libtls/Makefile10
-rw-r--r--src/lib/libtls/Symbols.list71
-rw-r--r--src/lib/libtls/tls_internal.h6
3 files changed, 85 insertions, 2 deletions
diff --git a/src/lib/libtls/Makefile b/src/lib/libtls/Makefile
index f90c57d53f..bc46332da3 100644
--- a/src/lib/libtls/Makefile
+++ b/src/lib/libtls/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.26 2016/11/02 15:18:42 beck Exp $ 1# $OpenBSD: Makefile,v 1.27 2016/11/04 18:23:32 guenther Exp $
2 2
3CFLAGS+= -Wall -Werror -Wimplicit 3CFLAGS+= -Wall -Werror -Wimplicit
4CFLAGS+= -DLIBRESSL_INTERNAL 4CFLAGS+= -DLIBRESSL_INTERNAL
@@ -10,6 +10,9 @@ DPADD= ${LIBCRYPTO} ${LIBSSL}
10LDADD+= -L${BSDOBJDIR}/lib/libcrypto -lcrypto 10LDADD+= -L${BSDOBJDIR}/lib/libcrypto -lcrypto
11LDADD+= -L${BSDOBJDIR}/lib/libssl -lssl 11LDADD+= -L${BSDOBJDIR}/lib/libssl -lssl
12 12
13VERSION_SCRIPT= Symbols.map
14SYMBOL_LIST= ${.CURDIR}/Symbols.list
15
13HDRS= tls.h 16HDRS= tls.h
14 17
15SRCS= tls.c \ 18SRCS= tls.c \
@@ -34,4 +37,9 @@ includes:
34 eval "$$j"; \ 37 eval "$$j"; \
35 done; 38 done;
36 39
40${VERSION_SCRIPT}: ${SYMBOL_LIST}
41 { printf '{\n\tglobal:\n'; \
42 sed '/^[._a-zA-Z]/s/$$/;/; s/^/ /' ${SYMBOL_LIST}; \
43 printf '\n\tlocal:\n\t\t*;\n};\n'; } >$@.tmp && mv $@.tmp $@
44
37.include <bsd.lib.mk> 45.include <bsd.lib.mk>
diff --git a/src/lib/libtls/Symbols.list b/src/lib/libtls/Symbols.list
new file mode 100644
index 0000000000..9074d5e011
--- /dev/null
+++ b/src/lib/libtls/Symbols.list
@@ -0,0 +1,71 @@
1tls_accept_cbs
2tls_accept_fds
3tls_accept_socket
4tls_client
5tls_close
6tls_config_add_keypair_file
7tls_config_add_keypair_mem
8tls_config_clear_keys
9tls_config_error
10tls_config_free
11tls_config_insecure_noverifycert
12tls_config_insecure_noverifyname
13tls_config_insecure_noverifytime
14tls_config_new
15tls_config_ocsp_require_stapling
16tls_config_parse_protocols
17tls_config_prefer_ciphers_client
18tls_config_prefer_ciphers_server
19tls_config_set_alpn
20tls_config_set_ca_file
21tls_config_set_ca_mem
22tls_config_set_ca_path
23tls_config_set_cert_file
24tls_config_set_cert_mem
25tls_config_set_ciphers
26tls_config_set_dheparams
27tls_config_set_ecdhecurve
28tls_config_set_key_file
29tls_config_set_key_mem
30tls_config_set_keypair_file
31tls_config_set_keypair_mem
32tls_config_set_protocols
33tls_config_set_verify_depth
34tls_config_verify
35tls_config_verify_client
36tls_config_verify_client_optional
37tls_configure
38tls_conn_alpn_selected
39tls_conn_cipher
40tls_conn_servername
41tls_conn_version
42tls_connect
43tls_connect_cbs
44tls_connect_fds
45tls_connect_servername
46tls_connect_socket
47tls_error
48tls_free
49tls_handshake
50tls_init
51tls_load_file
52tls_ocsp_process_response
53tls_peer_cert_contains_name
54tls_peer_cert_hash
55tls_peer_cert_issuer
56tls_peer_cert_notafter
57tls_peer_cert_notbefore
58tls_peer_cert_provided
59tls_peer_cert_subject
60tls_peer_ocsp_cert_status
61tls_peer_ocsp_crl_reason
62tls_peer_ocsp_next_update
63tls_peer_ocsp_response_status
64tls_peer_ocsp_result
65tls_peer_ocsp_revocation_time
66tls_peer_ocsp_this_update
67tls_peer_ocsp_url
68tls_read
69tls_reset
70tls_server
71tls_write
diff --git a/src/lib/libtls/tls_internal.h b/src/lib/libtls/tls_internal.h
index 7b07c96c86..4fe4ee7811 100644
--- a/src/lib/libtls/tls_internal.h
+++ b/src/lib/libtls/tls_internal.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_internal.h,v 1.47 2016/11/04 18:07:24 beck Exp $ */ 1/* $OpenBSD: tls_internal.h,v 1.48 2016/11/04 18:23:32 guenther Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> 3 * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org>
4 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 4 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
@@ -24,6 +24,8 @@
24 24
25#include <openssl/ssl.h> 25#include <openssl/ssl.h>
26 26
27__BEGIN_HIDDEN_DECLS
28
27#define _PATH_SSL_CA_FILE "/etc/ssl/cert.pem" 29#define _PATH_SSL_CA_FILE "/etc/ssl/cert.pem"
28 30
29#define TLS_CIPHERS_DEFAULT "TLSv1.2+AEAD+ECDHE:TLSv1.2+AEAD+DHE" 31#define TLS_CIPHERS_DEFAULT "TLSv1.2+AEAD+ECDHE:TLSv1.2+AEAD+DHE"
@@ -209,4 +211,6 @@ int tls_ocsp_verify_cb(SSL *ssl, void *arg);
209void tls_ocsp_ctx_free(struct tls_ocsp_ctx *ctx); 211void tls_ocsp_ctx_free(struct tls_ocsp_ctx *ctx);
210struct tls_ocsp_ctx *tls_ocsp_setup_from_peer(struct tls *ctx); 212struct tls_ocsp_ctx *tls_ocsp_setup_from_peer(struct tls *ctx);
211 213
214__END_HIDDEN_DECLS
215
212#endif /* HEADER_TLS_INTERNAL_H */ 216#endif /* HEADER_TLS_INTERNAL_H */