summaryrefslogtreecommitdiff
path: root/src/libtls/tls_socket.c
diff options
context:
space:
mode:
authorRomain Francoise <rfrancoise@debian.org>2014-04-15 19:35:31 +0200
committerRomain Francoise <rfrancoise@debian.org>2014-04-15 19:35:31 +0200
commitdf40590dead5696facf9943f46e222a5e831286d (patch)
treed701325b24c0e1c5676fa9cb8ed959254dd4367a /src/libtls/tls_socket.c
parent91b54afb0421705a4fb9d990d813007cd45bc2ce (diff)
parentc5ebfc7b9c16551fe825dc1d79c3f7e2f096f6c9 (diff)
downloadvyos-strongswan-df40590dead5696facf9943f46e222a5e831286d.tar.gz
vyos-strongswan-df40590dead5696facf9943f46e222a5e831286d.zip
Merge tag 'upstream/5.1.3'
Upstream version 5.1.3 * tag 'upstream/5.1.3': Import upstream version 5.1.3
Diffstat (limited to 'src/libtls/tls_socket.c')
-rw-r--r--src/libtls/tls_socket.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/libtls/tls_socket.c b/src/libtls/tls_socket.c
index 19232750b..648771e75 100644
--- a/src/libtls/tls_socket.c
+++ b/src/libtls/tls_socket.c
@@ -406,9 +406,11 @@ METHOD(tls_socket_t, destroy, void,
* See header
*/
tls_socket_t *tls_socket_create(bool is_server, identification_t *server,
- identification_t *peer, int fd, tls_cache_t *cache)
+ identification_t *peer, int fd, tls_cache_t *cache,
+ tls_version_t max_version, bool nullok)
{
private_tls_socket_t *this;
+ tls_purpose_t purpose;
INIT(this,
.public = {
@@ -430,13 +432,23 @@ tls_socket_t *tls_socket_create(bool is_server, identification_t *server,
.fd = fd,
);
- this->tls = tls_create(is_server, server, peer, TLS_PURPOSE_GENERIC,
+ if (nullok)
+ {
+ purpose = TLS_PURPOSE_GENERIC_NULLOK;
+ }
+ else
+ {
+ purpose = TLS_PURPOSE_GENERIC;
+ }
+
+ this->tls = tls_create(is_server, server, peer, purpose,
&this->app.application, cache);
if (!this->tls)
{
free(this);
return NULL;
}
+ this->tls->set_version(this->tls, max_version);
return &this->public;
}