diff options
author | jsing <> | 2016-08-22 14:55:59 +0000 |
---|---|---|
committer | jsing <> | 2016-08-22 14:55:59 +0000 |
commit | 9471125540d25a0117670bd41ea6c3a0ff7844eb (patch) | |
tree | b381f554fd76ea61d743e75d83ea05d769d71108 /src/lib/libtls/tls.h | |
parent | 74ebdd842595c2d6c66a0aa102dc5c4b98412c8d (diff) | |
download | openbsd-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.h | 8 |
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); | |||
52 | struct tls_config *tls_config_new(void); | 52 | struct tls_config *tls_config_new(void); |
53 | void tls_config_free(struct tls_config *_config); | 53 | void tls_config_free(struct tls_config *_config); |
54 | 54 | ||
55 | int tls_config_add_keypair_file(struct tls_config *_config, | ||
56 | const char *_cert_file, const char *_key_file); | ||
57 | int 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 | |||
55 | int tls_config_set_alpn(struct tls_config *_config, const char *_alpn); | 60 | int tls_config_set_alpn(struct tls_config *_config, const char *_alpn); |
56 | int tls_config_set_ca_file(struct tls_config *_config, const char *_ca_file); | 61 | int tls_config_set_ca_file(struct tls_config *_config, const char *_ca_file); |
57 | int tls_config_set_ca_path(struct tls_config *_config, const char *_ca_path); | 62 | int 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 | ||
120 | const char *tls_conn_alpn_selected(struct tls *_ctx); | 125 | const char *tls_conn_alpn_selected(struct tls *_ctx); |
121 | const char *tls_conn_cipher(struct tls *_ctx); | 126 | const char *tls_conn_cipher(struct tls *_ctx); |
127 | const char *tls_conn_servername(struct tls *_ctx); | ||
122 | const char *tls_conn_version(struct tls *_ctx); | 128 | const char *tls_conn_version(struct tls *_ctx); |
123 | 129 | ||
124 | uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password); | 130 | uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password); |