summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls.h
diff options
context:
space:
mode:
authorjsing <>2016-08-22 14:55:59 +0000
committerjsing <>2016-08-22 14:55:59 +0000
commit9471125540d25a0117670bd41ea6c3a0ff7844eb (patch)
treeb381f554fd76ea61d743e75d83ea05d769d71108 /src/lib/libtls/tls.h
parent74ebdd842595c2d6c66a0aa102dc5c4b98412c8d (diff)
downloadopenbsd-9471125540d25a0117670bd41ea6c3a0ff7844eb.tar.gz
openbsd-9471125540d25a0117670bd41ea6c3a0ff7844eb.tar.bz2
openbsd-9471125540d25a0117670bd41ea6c3a0ff7844eb.zip
Provide an API that enables server side SNI support - add the ability to
provide additional keypairs (via tls_config_add_keypair_{file,mem}()) and allow the server to determine what servername the client requested (via tls_conn_servername()). ok beck@
Diffstat (limited to 'src/lib/libtls/tls.h')
-rw-r--r--src/lib/libtls/tls.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/libtls/tls.h b/src/lib/libtls/tls.h
index 13df43f046..7a68c3d0d3 100644
--- a/src/lib/libtls/tls.h
+++ b/src/lib/libtls/tls.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls.h,v 1.33 2016/08/12 15:10:59 jsing Exp $ */ 1/* $OpenBSD: tls.h,v 1.34 2016/08/22 14:55:59 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -52,6 +52,11 @@ const char *tls_error(struct tls *_ctx);
52struct tls_config *tls_config_new(void); 52struct tls_config *tls_config_new(void);
53void tls_config_free(struct tls_config *_config); 53void tls_config_free(struct tls_config *_config);
54 54
55int tls_config_add_keypair_file(struct tls_config *_config,
56 const char *_cert_file, const char *_key_file);
57int tls_config_add_keypair_mem(struct tls_config *_config, const uint8_t *_cert,
58 size_t _cert_len, const uint8_t *_key, size_t _key_len);
59
55int tls_config_set_alpn(struct tls_config *_config, const char *_alpn); 60int tls_config_set_alpn(struct tls_config *_config, const char *_alpn);
56int tls_config_set_ca_file(struct tls_config *_config, const char *_ca_file); 61int tls_config_set_ca_file(struct tls_config *_config, const char *_ca_file);
57int tls_config_set_ca_path(struct tls_config *_config, const char *_ca_path); 62int tls_config_set_ca_path(struct tls_config *_config, const char *_ca_path);
@@ -119,6 +124,7 @@ time_t tls_peer_cert_notafter(struct tls *_ctx);
119 124
120const char *tls_conn_alpn_selected(struct tls *_ctx); 125const char *tls_conn_alpn_selected(struct tls *_ctx);
121const char *tls_conn_cipher(struct tls *_ctx); 126const char *tls_conn_cipher(struct tls *_ctx);
127const char *tls_conn_servername(struct tls *_ctx);
122const char *tls_conn_version(struct tls *_ctx); 128const char *tls_conn_version(struct tls *_ctx);
123 129
124uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password); 130uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password);