Commit f7a628d8 authored by David Woodhouse's avatar David Woodhouse

Kill DTLS_FREE macro

This can move to the library-specific *-dtls.c files too.
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 455a9996
......@@ -61,11 +61,9 @@
#if defined(OPENCONNECT_OPENSSL)
#define DTLS_SEND SSL_write
#define DTLS_RECV SSL_read
#define DTLS_FREE SSL_free
#elif defined(OPENCONNECT_GNUTLS)
#define DTLS_SEND gnutls_record_send
#define DTLS_RECV gnutls_record_recv
#define DTLS_FREE gnutls_deinit
#endif
static int connect_dtls_socket(struct openconnect_info *vpninfo)
......@@ -125,7 +123,7 @@ static int connect_dtls_socket(struct openconnect_info *vpninfo)
void dtls_close(struct openconnect_info *vpninfo)
{
if (vpninfo->dtls_ssl) {
DTLS_FREE(vpninfo->dtls_ssl);
dtls_ssl_free(vpninfo);
closesocket(vpninfo->dtls_fd);
unmonitor_read_fd(vpninfo, dtls);
unmonitor_write_fd(vpninfo, dtls);
......
......@@ -263,3 +263,7 @@ void dtls_shutdown(struct openconnect_info *vpninfo)
dtls_close(vpninfo);
}
void dtls_ssl_free(struct openconnect_info *vpninfo)
{
gnutls_deinit(vpninfo->dtls_ssl);
}
......@@ -800,6 +800,7 @@ intptr_t os_setup_tun(struct openconnect_info *vpninfo);
int start_dtls_handshake(struct openconnect_info *vpninfo, int dtls_fd);
int dtls_try_handshake(struct openconnect_info *vpninfo);
unsigned dtls_set_mtu(struct openconnect_info *vpninfo, unsigned mtu);
void dtls_ssl_free(struct openconnect_info *vpninfo);
/* dtls.c */
int dtls_setup(struct openconnect_info *vpninfo, int dtls_attempt_period);
......
......@@ -416,6 +416,11 @@ void dtls_shutdown(struct openconnect_info *vpninfo)
SSL_CTX_free(vpninfo->dtls_ctx);
}
void dtls_ssl_free(struct openconnect_info *vpninfo)
{
SSL_free(vpninfo->dtls_ssl);
}
void append_dtls_ciphers(struct openconnect_info *vpninfo, struct oc_text_buf *buf)
{
#ifdef HAVE_DTLS12
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment