diff options
author | Andreas Schneider <asn@samba.org> | 2017-05-09 13:17:13 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2017-05-09 23:20:08 +0200 |
commit | 85e3d1774cd069dc02a34850afc3c3df022eee91 (patch) | |
tree | 36bd8cb00d2eca7b4b0101b2ef57185b1d879f90 /source4/lib | |
parent | cb17fcc5f53f336d802f6105e6bf3239ac2106a4 (diff) | |
download | samba-85e3d1774cd069dc02a34850afc3c3df022eee91.tar.gz |
s4:tls: Do not use deprecated GnuTLS types
Those have been deprecated with GnuTLS 1.0.20 in 2004. I think it is
safe to use them now ;)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/tls/tls.c | 14 | ||||
-rw-r--r-- | source4/lib/tls/tls_tstream.c | 16 |
2 files changed, 16 insertions, 14 deletions
diff --git a/source4/lib/tls/tls.c b/source4/lib/tls/tls.c index ad8bbd444a4..ac4df221999 100644 --- a/source4/lib/tls/tls.c +++ b/source4/lib/tls/tls.c @@ -39,8 +39,8 @@ typedef gnutls_datum gnutls_datum_t; /* hold persistent tls data */ struct tls_params { - gnutls_certificate_credentials x509_cred; - gnutls_dh_params dh_params; + gnutls_certificate_credentials_t x509_cred; + gnutls_dh_params_t dh_params; bool tls_enabled; const char *tls_priority; }; @@ -52,14 +52,14 @@ struct tls_context { struct tevent_fd *fde; bool tls_enabled; #if ENABLE_GNUTLS - gnutls_session session; + gnutls_session_t session; bool done_handshake; bool have_first_byte; uint8_t first_byte; bool tls_detect; const char *plain_chars; bool output_pending; - gnutls_certificate_credentials xcred; + gnutls_certificate_credentials_t xcred; bool interrupted; #endif }; @@ -111,7 +111,7 @@ static NTSTATUS tls_socket_init(struct socket_context *sock) /* callback for reading from a socket */ -static ssize_t tls_pull(gnutls_transport_ptr ptr, void *buf, size_t size) +static ssize_t tls_pull(gnutls_transport_ptr_t ptr, void *buf, size_t size) { struct tls_context *tls = talloc_get_type(ptr, struct tls_context); NTSTATUS status; @@ -150,7 +150,7 @@ static ssize_t tls_pull(gnutls_transport_ptr ptr, void *buf, size_t size) /* callback for writing to a socket */ -static ssize_t tls_push(gnutls_transport_ptr ptr, const void *buf, size_t size) +static ssize_t tls_push(gnutls_transport_ptr_t ptr, const void *buf, size_t size) { struct tls_context *tls = talloc_get_type(ptr, struct tls_context); NTSTATUS status; @@ -545,7 +545,7 @@ struct socket_context *tls_init_server(struct tls_params *params, params->x509_cred)); gnutls_certificate_server_set_request(tls->session, GNUTLS_CERT_REQUEST); gnutls_dh_set_prime_bits(tls->session, DH_BITS); - gnutls_transport_set_ptr(tls->session, (gnutls_transport_ptr)tls); + gnutls_transport_set_ptr(tls->session, (gnutls_transport_ptr_t)tls); gnutls_transport_set_pull_function(tls->session, (gnutls_pull_func)tls_pull); gnutls_transport_set_push_function(tls->session, (gnutls_push_func)tls_push); #if GNUTLS_VERSION_MAJOR < 3 diff --git a/source4/lib/tls/tls_tstream.c b/source4/lib/tls/tls_tstream.c index 28fe3328b12..94689718d63 100644 --- a/source4/lib/tls/tls_tstream.c +++ b/source4/lib/tls/tls_tstream.c @@ -85,7 +85,7 @@ struct tstream_tls { int error; #if ENABLE_GNUTLS - gnutls_session tls_session; + gnutls_session_t tls_session; #endif /* ENABLE_GNUTLS */ enum tls_verify_peer_state verify_peer; @@ -190,7 +190,7 @@ static void tstream_tls_push_trigger_write(struct tevent_context *ev, struct tevent_immediate *im, void *private_data); -static ssize_t tstream_tls_push_function(gnutls_transport_ptr ptr, +static ssize_t tstream_tls_push_function(gnutls_transport_ptr_t ptr, const void *buf, size_t size) { struct tstream_context *stream = @@ -329,7 +329,7 @@ static void tstream_tls_push_done(struct tevent_req *subreq) static void tstream_tls_pull_done(struct tevent_req *subreq); -static ssize_t tstream_tls_pull_function(gnutls_transport_ptr ptr, +static ssize_t tstream_tls_pull_function(gnutls_transport_ptr_t ptr, void *buf, size_t size) { struct tstream_context *stream = @@ -911,8 +911,8 @@ static const struct tstream_context_ops tstream_tls_ops = { struct tstream_tls_params { #if ENABLE_GNUTLS - gnutls_certificate_credentials x509_cred; - gnutls_dh_params dh_params; + gnutls_certificate_credentials_t x509_cred; + gnutls_dh_params_t dh_params; const char *tls_priority; #endif /* ENABLE_GNUTLS */ bool tls_enabled; @@ -1115,7 +1115,8 @@ struct tevent_req *_tstream_tls_connect_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } - gnutls_transport_set_ptr(tlss->tls_session, (gnutls_transport_ptr)state->tls_stream); + gnutls_transport_set_ptr(tlss->tls_session, + (gnutls_transport_ptr_t)state->tls_stream); gnutls_transport_set_pull_function(tlss->tls_session, (gnutls_pull_func)tstream_tls_pull_function); gnutls_transport_set_push_function(tlss->tls_session, @@ -1390,7 +1391,8 @@ struct tevent_req *_tstream_tls_accept_send(TALLOC_CTX *mem_ctx, GNUTLS_CERT_REQUEST); gnutls_dh_set_prime_bits(tlss->tls_session, DH_BITS); - gnutls_transport_set_ptr(tlss->tls_session, (gnutls_transport_ptr)state->tls_stream); + gnutls_transport_set_ptr(tlss->tls_session, + (gnutls_transport_ptr_t)state->tls_stream); gnutls_transport_set_pull_function(tlss->tls_session, (gnutls_pull_func)tstream_tls_pull_function); gnutls_transport_set_push_function(tlss->tls_session, |