Lines Matching refs:dnstls_data

23         if (stream->dnstls_data.buffer_offset < stream->dnstls_data.write_buffer->length) {  in dnstls_flush_write_buffer()
24 assert(stream->dnstls_data.write_buffer->data); in dnstls_flush_write_buffer()
27 … iov[0] = IOVEC_MAKE(stream->dnstls_data.write_buffer->data + stream->dnstls_data.buffer_offset, in dnstls_flush_write_buffer()
28 … stream->dnstls_data.write_buffer->length - stream->dnstls_data.buffer_offset); in dnstls_flush_write_buffer()
36 stream->dnstls_data.buffer_offset += ss; in dnstls_flush_write_buffer()
38 … if (stream->dnstls_data.buffer_offset < stream->dnstls_data.write_buffer->length) { in dnstls_flush_write_buffer()
42 BIO_reset(SSL_get_wbio(stream->dnstls_data.ssl)); in dnstls_flush_write_buffer()
43 stream->dnstls_data.buffer_offset = 0; in dnstls_flush_write_buffer()
68 BIO_get_mem_ptr(wb, &stream->dnstls_data.write_buffer); in dnstls_stream_connect_tls()
69 stream->dnstls_data.buffer_offset = 0; in dnstls_stream_connect_tls()
71 s = SSL_new(stream->manager->dnstls_data.ctx); in dnstls_stream_connect_tls()
76 r = SSL_set_session(s, server->dnstls_data.session); in dnstls_stream_connect_tls()
110 stream->dnstls_data.handshake = SSL_do_handshake(s); in dnstls_stream_connect_tls()
111 if (stream->dnstls_data.handshake <= 0) { in dnstls_stream_connect_tls()
112 error = SSL_get_error(s, stream->dnstls_data.handshake); in dnstls_stream_connect_tls()
123 stream->dnstls_data.ssl = TAKE_PTR(s); in dnstls_stream_connect_tls()
127 SSL_free(TAKE_PTR(stream->dnstls_data.ssl)); in dnstls_stream_connect_tls()
138 if (stream->dnstls_data.ssl) in dnstls_stream_free()
139 SSL_free(stream->dnstls_data.ssl); in dnstls_stream_free()
147 assert(stream->dnstls_data.ssl); in dnstls_stream_on_io()
156 if (stream->dnstls_data.shutdown) { in dnstls_stream_on_io()
158 r = SSL_shutdown(stream->dnstls_data.ssl); in dnstls_stream_on_io()
168 error = SSL_get_error(stream->dnstls_data.ssl, r); in dnstls_stream_on_io()
189 stream->dnstls_data.shutdown = false; in dnstls_stream_on_io()
197 } else if (stream->dnstls_data.handshake <= 0) { in dnstls_stream_on_io()
199 stream->dnstls_data.handshake = SSL_do_handshake(stream->dnstls_data.ssl); in dnstls_stream_on_io()
200 if (stream->dnstls_data.handshake <= 0) { in dnstls_stream_on_io()
201 … error = SSL_get_error(stream->dnstls_data.ssl, stream->dnstls_data.handshake); in dnstls_stream_on_io()
234 assert(stream->dnstls_data.ssl); in dnstls_stream_shutdown()
237 s = SSL_get1_session(stream->dnstls_data.ssl); in dnstls_stream_shutdown()
239 if (stream->server->dnstls_data.session) in dnstls_stream_shutdown()
240 SSL_SESSION_free(stream->server->dnstls_data.session); in dnstls_stream_shutdown()
242 stream->server->dnstls_data.session = s; in dnstls_stream_shutdown()
248 r = SSL_shutdown(stream->dnstls_data.ssl); in dnstls_stream_shutdown()
250 if (!stream->dnstls_data.shutdown) { in dnstls_stream_shutdown()
251 stream->dnstls_data.shutdown = true; in dnstls_stream_shutdown()
263 ssl_error = SSL_get_error(stream->dnstls_data.ssl, r); in dnstls_stream_shutdown()
270 if (!stream->dnstls_data.shutdown) { in dnstls_stream_shutdown()
271 stream->dnstls_data.shutdown = true; in dnstls_stream_shutdown()
300 ss = r = SSL_write(stream->dnstls_data.ssl, buf, count); in dnstls_stream_write()
302 error = SSL_get_error(stream->dnstls_data.ssl, r); in dnstls_stream_write()
333 assert(stream->dnstls_data.ssl); in dnstls_stream_writev()
356 assert(stream->dnstls_data.ssl); in dnstls_stream_read()
360 ss = r = SSL_read(stream->dnstls_data.ssl, buf, count); in dnstls_stream_read()
362 error = SSL_get_error(stream->dnstls_data.ssl, r); in dnstls_stream_read()
399 if (server->dnstls_data.session) in dnstls_server_free()
400 SSL_SESSION_free(server->dnstls_data.session); in dnstls_server_free()
411 manager->dnstls_data.ctx = SSL_CTX_new(TLS_client_method()); in dnstls_manager_init()
412 if (!manager->dnstls_data.ctx) in dnstls_manager_init()
415 r = SSL_CTX_set_min_proto_version(manager->dnstls_data.ctx, TLS1_2_VERSION); in dnstls_manager_init()
419 (void) SSL_CTX_set_options(manager->dnstls_data.ctx, SSL_OP_NO_COMPRESSION); in dnstls_manager_init()
421 r = SSL_CTX_set_default_verify_paths(manager->dnstls_data.ctx); in dnstls_manager_init()
433 if (manager->dnstls_data.ctx) in dnstls_manager_free()
434 SSL_CTX_free(manager->dnstls_data.ctx); in dnstls_manager_free()