Lines Matching refs:gtls

93   struct gtls_ctx gtls;  member
110 backend->gtls.io_result = result; in gtls_push()
112 gnutls_transport_set_errno(backend->gtls.session, in gtls_push()
130 if(!backend->gtls.shared_creds->trust_setup) { in gtls_pull()
131 result = Curl_gtls_client_trust_setup(cf, data, &backend->gtls); in gtls_pull()
133 gnutls_transport_set_errno(backend->gtls.session, EINVAL); in gtls_pull()
134 backend->gtls.io_result = result; in gtls_pull()
142 backend->gtls.io_result = result; in gtls_pull()
144 gnutls_transport_set_errno(backend->gtls.session, in gtls_pull()
255 session = backend->gtls.session; in handshake()
300 backend->gtls.io_result = CURLE_OK; in handshake()
303 if(!backend->gtls.shared_creds->trust_setup) { in handshake()
306 CURLcode result = Curl_gtls_client_trust_setup(cf, data, &backend->gtls); in handshake()
331 else if((rc < 0) && backend->gtls.io_result) { in handshake()
332 return backend->gtls.io_result; in handshake()
671 struct gtls_ctx *gtls) in Curl_gtls_client_trust_setup() argument
697 Curl_gtls_shared_creds_free(&gtls->shared_creds); in Curl_gtls_client_trust_setup()
698 gtls->shared_creds = cached_creds; in Curl_gtls_client_trust_setup()
699 rc = gnutls_credentials_set(gtls->session, GNUTLS_CRD_CERTIFICATE, in Curl_gtls_client_trust_setup()
700 gtls->shared_creds->creds); in Curl_gtls_client_trust_setup()
708 result = gtls_populate_creds(cf, data, gtls->shared_creds->creds); in Curl_gtls_client_trust_setup()
711 gtls->shared_creds->trust_setup = TRUE; in Curl_gtls_client_trust_setup()
713 gtls_set_cached_creds(cf, data, gtls->shared_creds); in Curl_gtls_client_trust_setup()
822 struct gtls_ctx *gtls) in gtls_client_init() argument
845 result = Curl_gtls_shared_creds_create(data, &gtls->shared_creds); in gtls_client_init()
853 rc = gnutls_srp_allocate_client_credentials(&gtls->srp_client_cred); in gtls_client_init()
860 rc = gnutls_srp_set_client_credentials(gtls->srp_client_cred, in gtls_client_init()
896 rc = gnutls_init(&gtls->session, init_flags); in gtls_client_init()
903 if(gnutls_server_name_set(gtls->session, GNUTLS_NAME_DNS, in gtls_client_init()
911 rc = gnutls_set_default_priority(gtls->session); in gtls_client_init()
948 rc = gnutls_priority_set_direct(gtls->session, prioritysrp, &err); in gtls_client_init()
958 rc = gnutls_priority_set_direct(gtls->session, prioritylist, &err); in gtls_client_init()
970 if(!gtls->shared_creds->trust_setup) { in gtls_client_init()
971 result = Curl_gtls_client_trust_setup(cf, data, gtls); in gtls_client_init()
977 gtls->shared_creds->creds, config->clientcert, GNUTLS_X509_FMT_DER, in gtls_client_init()
994 gtls->shared_creds->creds, in gtls_client_init()
1009 gtls->shared_creds->creds, in gtls_client_init()
1023 rc = gnutls_credentials_set(gtls->session, GNUTLS_CRD_SRP, in gtls_client_init()
1024 gtls->srp_client_cred); in gtls_client_init()
1033 rc = gnutls_credentials_set(gtls->session, GNUTLS_CRD_CERTIFICATE, in gtls_client_init()
1034 gtls->shared_creds->creds); in gtls_client_init()
1042 rc = gnutls_ocsp_status_request_enable_client(gtls->session, in gtls_client_init()
1226 result = Curl_gtls_ctx_init(&backend->gtls, cf, data, &connssl->peer, in gtls_connect_step1()
1237 gnutls_handshake_set_hook_function(backend->gtls.session, in gtls_connect_step1()
1242 gnutls_transport_set_ptr(backend->gtls.session, cf); in gtls_connect_step1()
1243 gnutls_transport_set_push_function(backend->gtls.session, gtls_push); in gtls_connect_step1()
1244 gnutls_transport_set_pull_function(backend->gtls.session, gtls_pull); in gtls_connect_step1()
1816 backend->gtls.io_result = CURLE_OK; in gtls_send_earlydata()
1818 n = gnutls_record_send_early_data(backend->gtls.session, buf, blen); in gtls_send_earlydata()
1825 result = backend->gtls.io_result ? in gtls_send_earlydata()
1826 backend->gtls.io_result : CURLE_SEND_ERROR; in gtls_send_earlydata()
1898 result = gtls_verifyserver(cf, data, backend->gtls.session); in gtls_connect_common()
1905 rc = gnutls_alpn_get_selected_protocol(backend->gtls.session, &proto); in gtls_connect_common()
1917 if(gnutls_session_get_flags(backend->gtls.session) & in gtls_connect_common()
2000 if(backend->gtls.session && in gtls_data_pending()
2001 0 != gnutls_record_check_pending(backend->gtls.session)) in gtls_data_pending()
2051 backend->gtls.io_result = CURLE_OK; in gtls_send()
2052 rc = gnutls_record_send(backend->gtls.session, buf, blen); in gtls_send()
2062 (backend->gtls.io_result ? backend->gtls.io_result : CURLE_SEND_ERROR); in gtls_send()
2097 if(!backend->gtls.session || cf->shutdown || in gtls_shutdown()
2106 if(!backend->gtls.sent_shutdown) { in gtls_shutdown()
2108 backend->gtls.sent_shutdown = TRUE; in gtls_shutdown()
2110 int ret = gnutls_bye(backend->gtls.session, GNUTLS_SHUT_RDWR); in gtls_shutdown()
2113 connssl->io_need = gnutls_record_get_direction(backend->gtls.session) ? in gtls_shutdown()
2115 backend->gtls.sent_shutdown = FALSE; in gtls_shutdown()
2131 nread = gnutls_record_recv(backend->gtls.session, buf, sizeof(buf)); in gtls_shutdown()
2143 connssl->io_need = gnutls_record_get_direction(backend->gtls.session) ? in gtls_shutdown()
2167 if(backend->gtls.session) { in gtls_close()
2168 gnutls_deinit(backend->gtls.session); in gtls_close()
2169 backend->gtls.session = NULL; in gtls_close()
2171 if(backend->gtls.shared_creds) { in gtls_close()
2172 Curl_gtls_shared_creds_free(&backend->gtls.shared_creds); in gtls_close()
2175 if(backend->gtls.srp_client_cred) { in gtls_close()
2176 gnutls_srp_free_client_credentials(backend->gtls.srp_client_cred); in gtls_close()
2177 backend->gtls.srp_client_cred = NULL; in gtls_close()
2211 ret = gnutls_record_recv(backend->gtls.session, buf, buffersize); in gtls_recv()
2234 *curlcode = backend->gtls.io_result ? in gtls_recv()
2235 backend->gtls.io_result : CURLE_RECV_ERROR; in gtls_recv()
2283 return backend->gtls.session; in gtls_get_internals()