Lines Matching refs:sc
35 static int ssl_undefined_function_3(SSL_CONNECTION *sc, unsigned char *r, in ssl_undefined_function_3() argument
38 return ssl_undefined_function(SSL_CONNECTION_GET_SSL(sc)); in ssl_undefined_function_3()
41 static int ssl_undefined_function_4(SSL_CONNECTION *sc, int r) in ssl_undefined_function_4() argument
43 return ssl_undefined_function(SSL_CONNECTION_GET_SSL(sc)); in ssl_undefined_function_4()
46 static size_t ssl_undefined_function_5(SSL_CONNECTION *sc, const char *r, in ssl_undefined_function_5() argument
49 return ssl_undefined_function(SSL_CONNECTION_GET_SSL(sc)); in ssl_undefined_function_5()
57 static int ssl_undefined_function_7(SSL_CONNECTION *sc, unsigned char *r, in ssl_undefined_function_7() argument
61 return ssl_undefined_function(SSL_CONNECTION_GET_SSL(sc)); in ssl_undefined_function_7()
64 static int ssl_undefined_function_8(SSL_CONNECTION *sc) in ssl_undefined_function_8() argument
66 return ssl_undefined_function(SSL_CONNECTION_GET_SSL(sc)); in ssl_undefined_function_8()
581 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ossl_ssl_connection_reset() local
583 if (sc == NULL) in ossl_ssl_connection_reset()
586 if (ssl_clear_bad_session(sc)) { in ossl_ssl_connection_reset()
587 SSL_SESSION_free(sc->session); in ossl_ssl_connection_reset()
588 sc->session = NULL; in ossl_ssl_connection_reset()
590 SSL_SESSION_free(sc->psksession); in ossl_ssl_connection_reset()
591 sc->psksession = NULL; in ossl_ssl_connection_reset()
592 OPENSSL_free(sc->psksession_id); in ossl_ssl_connection_reset()
593 sc->psksession_id = NULL; in ossl_ssl_connection_reset()
594 sc->psksession_id_len = 0; in ossl_ssl_connection_reset()
595 sc->hello_retry_request = SSL_HRR_NONE; in ossl_ssl_connection_reset()
596 sc->sent_tickets = 0; in ossl_ssl_connection_reset()
598 sc->error = 0; in ossl_ssl_connection_reset()
599 sc->hit = 0; in ossl_ssl_connection_reset()
600 sc->shutdown = 0; in ossl_ssl_connection_reset()
602 if (sc->renegotiate) { in ossl_ssl_connection_reset()
607 ossl_statem_clear(sc); in ossl_ssl_connection_reset()
609 sc->version = s->method->version; in ossl_ssl_connection_reset()
610 sc->client_version = sc->version; in ossl_ssl_connection_reset()
611 sc->rwstate = SSL_NOTHING; in ossl_ssl_connection_reset()
613 BUF_MEM_free(sc->init_buf); in ossl_ssl_connection_reset()
614 sc->init_buf = NULL; in ossl_ssl_connection_reset()
615 sc->first_packet = 0; in ossl_ssl_connection_reset()
617 sc->key_update = SSL_KEY_UPDATE_NONE; in ossl_ssl_connection_reset()
618 memset(sc->ext.compress_certificate_from_peer, 0, in ossl_ssl_connection_reset()
619 sizeof(sc->ext.compress_certificate_from_peer)); in ossl_ssl_connection_reset()
620 sc->ext.compress_certificate_sent = 0; in ossl_ssl_connection_reset()
622 EVP_MD_CTX_free(sc->pha_dgst); in ossl_ssl_connection_reset()
623 sc->pha_dgst = NULL; in ossl_ssl_connection_reset()
626 sc->dane.mdpth = -1; in ossl_ssl_connection_reset()
627 sc->dane.pdpth = -1; in ossl_ssl_connection_reset()
628 X509_free(sc->dane.mcert); in ossl_ssl_connection_reset()
629 sc->dane.mcert = NULL; in ossl_ssl_connection_reset()
630 sc->dane.mtlsa = NULL; in ossl_ssl_connection_reset()
633 X509_VERIFY_PARAM_move_peername(sc->param, NULL); in ossl_ssl_connection_reset()
636 OPENSSL_free(sc->shared_sigalgs); in ossl_ssl_connection_reset()
637 sc->shared_sigalgs = NULL; in ossl_ssl_connection_reset()
638 sc->shared_sigalgslen = 0; in ossl_ssl_connection_reset()
654 if (!RECORD_LAYER_reset(&sc->rlayer)) in ossl_ssl_connection_reset()
944 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_is_dtls() local
951 if (sc == NULL) in SSL_is_dtls()
954 return SSL_CONNECTION_IS_DTLS(sc) ? 1 : 0; in SSL_is_dtls()
959 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_is_tls() local
966 if (sc == NULL) in SSL_is_tls()
969 return SSL_CONNECTION_IS_DTLS(sc) ? 0 : 1; in SSL_is_tls()
1009 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_set_session_id_context() local
1011 if (sc == NULL) in SSL_set_session_id_context()
1018 sc->sid_ctx_length = sid_ctx_len; in SSL_set_session_id_context()
1019 memcpy(sc->sid_ctx, sid_ctx, sid_ctx_len); in SSL_set_session_id_context()
1035 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_set_generate_session_id() local
1037 if (sc == NULL || !CRYPTO_THREAD_write_lock(ssl->lock)) in SSL_set_generate_session_id()
1039 sc->generate_session_id = cb; in SSL_set_generate_session_id()
1055 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(ssl); in SSL_has_matching_session_id() local
1057 if (sc == NULL || id_len > sizeof(r.session_id)) in SSL_has_matching_session_id()
1060 r.ssl_version = sc->version; in SSL_has_matching_session_id()
1064 if (!CRYPTO_THREAD_read_lock(sc->session_ctx->lock)) in SSL_has_matching_session_id()
1066 p = lh_SSL_SESSION_retrieve(sc->session_ctx->sessions, &r); in SSL_has_matching_session_id()
1067 CRYPTO_THREAD_unlock(sc->session_ctx->lock); in SSL_has_matching_session_id()
1078 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_purpose() local
1080 if (sc == NULL) in SSL_set_purpose()
1083 return X509_VERIFY_PARAM_set_purpose(sc->param, purpose); in SSL_set_purpose()
1093 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_trust() local
1095 if (sc == NULL) in SSL_set_trust()
1098 return X509_VERIFY_PARAM_set_trust(sc->param, trust); in SSL_set_trust()
1103 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set1_host() local
1105 if (sc == NULL) in SSL_set1_host()
1111 && X509_VERIFY_PARAM_set1_ip_asc(sc->param, hostname) == 1) in SSL_set1_host()
1114 return X509_VERIFY_PARAM_set1_host(sc->param, hostname, 0); in SSL_set1_host()
1119 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_add1_host() local
1121 if (sc == NULL) in SSL_add1_host()
1135 old_ip = X509_VERIFY_PARAM_get1_ip_asc(sc->param); in SSL_add1_host()
1142 return X509_VERIFY_PARAM_set1_ip_asc(sc->param, hostname); in SSL_add1_host()
1146 return X509_VERIFY_PARAM_add1_host(sc->param, hostname, 0); in SSL_add1_host()
1151 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_hostflags() local
1153 if (sc == NULL) in SSL_set_hostflags()
1156 X509_VERIFY_PARAM_set_hostflags(sc->param, flags); in SSL_set_hostflags()
1161 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get0_peername() local
1163 if (sc == NULL) in SSL_get0_peername()
1166 return X509_VERIFY_PARAM_get0_peername(sc->param); in SSL_get0_peername()
1193 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_dane_enable() local
1195 if (sc == NULL) in SSL_dane_enable()
1198 dane = &sc->dane; in SSL_dane_enable()
1213 if (sc->ext.hostname == NULL) { in SSL_dane_enable()
1221 if (!X509_VERIFY_PARAM_set1_host(sc->param, basedomain, 0)) { in SSL_dane_enable()
1241 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_dane_set_flags() local
1243 if (sc == NULL) in SSL_dane_set_flags()
1246 orig = sc->dane.flags; in SSL_dane_set_flags()
1248 sc->dane.flags |= flags; in SSL_dane_set_flags()
1255 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_dane_clear_flags() local
1257 if (sc == NULL) in SSL_dane_clear_flags()
1260 orig = sc->dane.flags; in SSL_dane_clear_flags()
1262 sc->dane.flags &= ~flags; in SSL_dane_clear_flags()
1269 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get0_dane_authority() local
1271 if (sc == NULL) in SSL_get0_dane_authority()
1274 dane = &sc->dane; in SSL_get0_dane_authority()
1276 if (!DANETLS_ENABLED(dane) || sc->verify_result != X509_V_OK) in SSL_get0_dane_authority()
1291 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get0_dane_tlsa() local
1293 if (sc == NULL) in SSL_get0_dane_tlsa()
1296 dane = &sc->dane; in SSL_get0_dane_tlsa()
1298 if (!DANETLS_ENABLED(dane) || sc->verify_result != X509_V_OK) in SSL_get0_dane_tlsa()
1317 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get0_dane() local
1319 if (sc == NULL) in SSL_get0_dane()
1322 return &sc->dane; in SSL_get0_dane()
1328 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_dane_tlsa_add() local
1330 if (sc == NULL) in SSL_dane_tlsa_add()
1333 return dane_tlsa_add(&sc->dane, usage, selector, mtype, data, dlen); in SSL_dane_tlsa_add()
1349 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_set1_param() local
1351 if (sc == NULL) in SSL_set1_param()
1354 return X509_VERIFY_PARAM_set1(sc->param, vpm); in SSL_set1_param()
1364 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_get0_param() local
1366 if (sc == NULL) in SSL_get0_param()
1369 return sc->param; in SSL_get0_param()
1374 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_certs_clear() local
1376 if (sc == NULL) in SSL_certs_clear()
1379 ssl_cert_clear_certs(sc->cert); in SSL_certs_clear()
1502 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set0_rbio() local
1511 if (sc == NULL) in SSL_set0_rbio()
1514 BIO_free_all(sc->rbio); in SSL_set0_rbio()
1515 sc->rbio = rbio; in SSL_set0_rbio()
1516 sc->rlayer.rrlmethod->set1_bio(sc->rlayer.rrl, sc->rbio); in SSL_set0_rbio()
1521 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set0_wbio() local
1530 if (sc == NULL) in SSL_set0_wbio()
1536 if (sc->bbio != NULL) in SSL_set0_wbio()
1537 sc->wbio = BIO_pop(sc->wbio); in SSL_set0_wbio()
1539 BIO_free_all(sc->wbio); in SSL_set0_wbio()
1540 sc->wbio = wbio; in SSL_set0_wbio()
1543 if (sc->bbio != NULL) in SSL_set0_wbio()
1544 sc->wbio = BIO_push(sc->bbio, sc->wbio); in SSL_set0_wbio()
1546 sc->rlayer.wrlmethod->set1_bio(sc->rlayer.wrl, sc->wbio); in SSL_set0_wbio()
1591 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_rbio() local
1598 if (sc == NULL) in SSL_get_rbio()
1601 return sc->rbio; in SSL_get_rbio()
1606 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_wbio() local
1613 if (sc == NULL) in SSL_get_wbio()
1616 if (sc->bbio != NULL) { in SSL_get_wbio()
1621 return BIO_next(sc->bbio); in SSL_get_wbio()
1623 return sc->wbio; in SSL_get_wbio()
1767 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_finished() local
1769 if (sc == NULL) in SSL_get_finished()
1772 ret = sc->s3.tmp.finish_md_len; in SSL_get_finished()
1775 memcpy(buf, sc->s3.tmp.finish_md, count); in SSL_get_finished()
1783 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_peer_finished() local
1785 if (sc == NULL) in SSL_get_peer_finished()
1788 ret = sc->s3.tmp.peer_finish_md_len; in SSL_get_peer_finished()
1791 memcpy(buf, sc->s3.tmp.peer_finish_md, count); in SSL_get_peer_finished()
1797 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_verify_mode() local
1799 if (sc == NULL) in SSL_get_verify_mode()
1802 return sc->verify_mode; in SSL_get_verify_mode()
1807 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_verify_depth() local
1809 if (sc == NULL) in SSL_get_verify_depth()
1812 return X509_VERIFY_PARAM_get_depth(sc->param); in SSL_get_verify_depth()
1816 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_verify_callback() local
1818 if (sc == NULL) in SSL_get_verify_callback()
1821 return sc->verify_callback; in SSL_get_verify_callback()
1841 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_verify() local
1843 if (sc == NULL) in SSL_set_verify()
1846 sc->verify_mode = mode; in SSL_set_verify()
1848 sc->verify_callback = callback; in SSL_set_verify()
1853 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_verify_depth() local
1855 if (sc == NULL) in SSL_set_verify_depth()
1858 X509_VERIFY_PARAM_set_depth(sc->param, depth); in SSL_set_verify_depth()
1863 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_set_read_ahead() local
1866 if (sc == NULL) in SSL_set_read_ahead()
1869 RECORD_LAYER_set_read_ahead(&sc->rlayer, yes); in SSL_set_read_ahead()
1872 &sc->rlayer.read_ahead); in SSL_set_read_ahead()
1876 sc->rlayer.rrlmethod->set_options(sc->rlayer.rrl, options); in SSL_set_read_ahead()
1881 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL_ONLY(s); in SSL_get_read_ahead() local
1883 if (sc == NULL) in SSL_get_read_ahead()
1886 return RECORD_LAYER_get_read_ahead(&sc->rlayer); in SSL_get_read_ahead()
1916 const SSL_CONNECTION *sc; in SSL_has_pending() local
1923 sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_has_pending()
1926 if (SSL_CONNECTION_IS_DTLS(sc)) { in SSL_has_pending()
1930 iter = pqueue_iterator(sc->rlayer.d->buffered_app_data); in SSL_has_pending()
1938 if (RECORD_LAYER_processed_read_pending(&sc->rlayer)) in SSL_has_pending()
1941 return RECORD_LAYER_read_pending(&sc->rlayer); in SSL_has_pending()
1956 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get0_peer_certificate() local
1958 if (sc == NULL) in SSL_get0_peer_certificate()
1961 if (sc->session == NULL) in SSL_get0_peer_certificate()
1964 return sc->session->peer; in SSL_get0_peer_certificate()
1970 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in STACK_OF() local
1972 if (sc == NULL) in STACK_OF()
1975 if (sc->session == NULL) in STACK_OF()
1978 r = sc->session->peer_chain; in STACK_OF()
2045 const SSL_CONNECTION *sc; in SSL_check_private_key() local
2047 if ((sc = SSL_CONNECTION_FROM_CONST_SSL(ssl)) == NULL) { in SSL_check_private_key()
2051 if (sc->cert->key->x509 == NULL) { in SSL_check_private_key()
2055 if (sc->cert->key->privatekey == NULL) { in SSL_check_private_key()
2059 return X509_check_private_key(sc->cert->key->x509, in SSL_check_private_key()
2060 sc->cert->key->privatekey); in SSL_check_private_key()
2065 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_waiting_for_async() local
2067 if (sc == NULL) in SSL_waiting_for_async()
2070 if (sc->job) in SSL_waiting_for_async()
2079 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get_all_async_fds() local
2081 if (sc == NULL) in SSL_get_all_async_fds()
2084 if ((ctx = sc->waitctx) == NULL) in SSL_get_all_async_fds()
2093 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get_changed_async_fds() local
2095 if (sc == NULL) in SSL_get_changed_async_fds()
2098 if ((ctx = sc->waitctx) == NULL) in SSL_get_changed_async_fds()
2118 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_async_callback() local
2120 if (sc == NULL) in SSL_set_async_callback()
2123 sc->async_cb = callback; in SSL_set_async_callback()
2129 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_async_callback_arg() local
2131 if (sc == NULL) in SSL_set_async_callback_arg()
2134 sc->async_cb_arg = arg; in SSL_set_async_callback_arg()
2141 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get_async_status() local
2143 if (sc == NULL) in SSL_get_async_status()
2146 if ((ctx = sc->waitctx) == NULL) in SSL_get_async_status()
2154 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_accept() local
2161 if (sc == NULL) in SSL_accept()
2164 if (sc->handshake_func == NULL) { in SSL_accept()
2174 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_connect() local
2181 if (sc == NULL) in SSL_connect()
2184 if (sc->handshake_func == NULL) { in SSL_connect()
2200 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ssl_async_wait_ctx_cb() local
2202 if (sc == NULL) in ssl_async_wait_ctx_cb()
2205 return sc->async_cb(s, sc->async_cb_arg); in ssl_async_wait_ctx_cb()
2212 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ssl_start_async_job() local
2214 if (sc == NULL) in ssl_start_async_job()
2217 if (sc->waitctx == NULL) { in ssl_start_async_job()
2218 sc->waitctx = ASYNC_WAIT_CTX_new(); in ssl_start_async_job()
2219 if (sc->waitctx == NULL) in ssl_start_async_job()
2221 if (sc->async_cb != NULL in ssl_start_async_job()
2223 (sc->waitctx, ssl_async_wait_ctx_cb, s)) in ssl_start_async_job()
2227 sc->rwstate = SSL_NOTHING; in ssl_start_async_job()
2228 switch (ASYNC_start_job(&sc->job, sc->waitctx, &ret, func, args, in ssl_start_async_job()
2231 sc->rwstate = SSL_NOTHING; in ssl_start_async_job()
2235 sc->rwstate = SSL_ASYNC_PAUSED; in ssl_start_async_job()
2238 sc->rwstate = SSL_ASYNC_NO_JOBS; in ssl_start_async_job()
2241 sc->job = NULL; in ssl_start_async_job()
2244 sc->rwstate = SSL_NOTHING; in ssl_start_async_job()
2257 SSL_CONNECTION *sc; in ssl_io_intern() local
2263 if ((sc = SSL_CONNECTION_FROM_SSL(s)) == NULL) in ssl_io_intern()
2268 return args->f.func_read(s, buf, num, &sc->asyncrw); in ssl_io_intern()
2270 return args->f.func_write(s, buf, num, &sc->asyncrw); in ssl_io_intern()
2279 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ssl_read_internal() local
2286 if (sc == NULL) in ssl_read_internal()
2289 if (sc->handshake_func == NULL) { in ssl_read_internal()
2294 if (sc->shutdown & SSL_RECEIVED_SHUTDOWN) { in ssl_read_internal()
2295 sc->rwstate = SSL_NOTHING; in ssl_read_internal()
2299 if (sc->early_data_state == SSL_EARLY_DATA_CONNECT_RETRY in ssl_read_internal()
2300 || sc->early_data_state == SSL_EARLY_DATA_ACCEPT_RETRY) { in ssl_read_internal()
2308 ossl_statem_check_finish_init(sc, 0); in ssl_read_internal()
2310 if ((sc->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) { in ssl_read_internal()
2321 *readbytes = sc->asyncrw; in ssl_read_internal()
2362 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_read_early_data() local
2365 if (sc == NULL || !sc->server) { in SSL_read_early_data()
2370 switch (sc->early_data_state) { in SSL_read_early_data()
2379 sc->early_data_state = SSL_EARLY_DATA_ACCEPTING; in SSL_read_early_data()
2383 sc->early_data_state = SSL_EARLY_DATA_ACCEPT_RETRY; in SSL_read_early_data()
2389 if (sc->ext.early_data == SSL_EARLY_DATA_ACCEPTED) { in SSL_read_early_data()
2390 sc->early_data_state = SSL_EARLY_DATA_READING; in SSL_read_early_data()
2397 if (ret > 0 || (ret <= 0 && sc->early_data_state in SSL_read_early_data()
2399 sc->early_data_state = SSL_EARLY_DATA_READ_RETRY; in SSL_read_early_data()
2404 sc->early_data_state = SSL_EARLY_DATA_FINISHED_READING; in SSL_read_early_data()
2417 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL_ONLY(s); in SSL_get_early_data_status() local
2420 if (sc == NULL) in SSL_get_early_data_status()
2423 return sc->ext.early_data; in SSL_get_early_data_status()
2428 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ssl_peek_internal() local
2435 if (sc == NULL) in ssl_peek_internal()
2438 if (sc->handshake_func == NULL) { in ssl_peek_internal()
2443 if (sc->shutdown & SSL_RECEIVED_SHUTDOWN) { in ssl_peek_internal()
2446 if ((sc->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) { in ssl_peek_internal()
2457 *readbytes = sc->asyncrw; in ssl_peek_internal()
2499 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ssl_write_internal() local
2506 if (sc == NULL) in ssl_write_internal()
2509 if (sc->handshake_func == NULL) { in ssl_write_internal()
2514 if (sc->shutdown & SSL_SENT_SHUTDOWN) { in ssl_write_internal()
2515 sc->rwstate = SSL_NOTHING; in ssl_write_internal()
2525 if (sc->early_data_state == SSL_EARLY_DATA_CONNECT_RETRY in ssl_write_internal()
2526 || sc->early_data_state == SSL_EARLY_DATA_ACCEPT_RETRY in ssl_write_internal()
2527 || sc->early_data_state == SSL_EARLY_DATA_READ_RETRY) { in ssl_write_internal()
2532 ossl_statem_check_finish_init(sc, 1); in ssl_write_internal()
2534 if ((sc->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) { in ssl_write_internal()
2545 *written = sc->asyncrw; in ssl_write_internal()
2555 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_sendfile() local
2557 if (sc == NULL) in SSL_sendfile()
2560 if (sc->handshake_func == NULL) { in SSL_sendfile()
2565 if (sc->shutdown & SSL_SENT_SHUTDOWN) { in SSL_sendfile()
2566 sc->rwstate = SSL_NOTHING; in SSL_sendfile()
2571 if (!BIO_get_ktls_send(sc->wbio)) { in SSL_sendfile()
2577 if (sc->s3.alert_dispatch > 0) { in SSL_sendfile()
2586 sc->rwstate = SSL_WRITING; in SSL_sendfile()
2587 if (BIO_flush(sc->wbio) <= 0) { in SSL_sendfile()
2588 if (!BIO_should_retry(sc->wbio)) { in SSL_sendfile()
2589 sc->rwstate = SSL_NOTHING; in SSL_sendfile()
2609 BIO_set_retry_write(sc->wbio); in SSL_sendfile()
2616 sc->rwstate = SSL_NOTHING; in SSL_sendfile()
2663 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_write_early_data() local
2666 if (sc == NULL) in SSL_write_early_data()
2669 switch (sc->early_data_state) { in SSL_write_early_data()
2671 if (sc->server in SSL_write_early_data()
2673 || ((sc->session == NULL || sc->session->ext.max_early_data == 0) in SSL_write_early_data()
2674 && (sc->psk_use_session_cb == NULL))) { in SSL_write_early_data()
2681 sc->early_data_state = SSL_EARLY_DATA_CONNECTING; in SSL_write_early_data()
2685 sc->early_data_state = SSL_EARLY_DATA_CONNECT_RETRY; in SSL_write_early_data()
2691 sc->early_data_state = SSL_EARLY_DATA_WRITING; in SSL_write_early_data()
2697 partialwrite = sc->mode & SSL_MODE_ENABLE_PARTIAL_WRITE; in SSL_write_early_data()
2698 sc->mode &= ~SSL_MODE_ENABLE_PARTIAL_WRITE; in SSL_write_early_data()
2700 sc->mode |= partialwrite; in SSL_write_early_data()
2702 sc->early_data_state = SSL_EARLY_DATA_WRITE_RETRY; in SSL_write_early_data()
2705 sc->early_data_state = SSL_EARLY_DATA_WRITE_FLUSH; in SSL_write_early_data()
2710 if (statem_flush(sc) != 1) in SSL_write_early_data()
2713 sc->early_data_state = SSL_EARLY_DATA_WRITE_RETRY; in SSL_write_early_data()
2718 early_data_state = sc->early_data_state; in SSL_write_early_data()
2720 sc->early_data_state = SSL_EARLY_DATA_UNAUTH_WRITING; in SSL_write_early_data()
2724 (void)BIO_flush(sc->wbio); in SSL_write_early_data()
2725 sc->early_data_state = early_data_state; in SSL_write_early_data()
2742 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_shutdown() local
2749 if (sc == NULL) in SSL_shutdown()
2752 if (sc->handshake_func == NULL) { in SSL_shutdown()
2758 if ((sc->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) { in SSL_shutdown()
2778 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_key_update() local
2785 if (sc == NULL) in SSL_key_update()
2788 if (!SSL_CONNECTION_IS_TLS13(sc)) { in SSL_key_update()
2804 if (RECORD_LAYER_write_pending(&sc->rlayer)) { in SSL_key_update()
2809 ossl_statem_set_in_init(sc, 1); in SSL_key_update()
2810 sc->key_update = updatetype; in SSL_key_update()
2816 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_key_update_type() local
2823 if (sc == NULL) in SSL_get_key_update_type()
2826 return sc->key_update; in SSL_get_key_update_type()
2833 static int can_renegotiate(const SSL_CONNECTION *sc) in can_renegotiate() argument
2835 if (SSL_CONNECTION_IS_TLS13(sc)) { in can_renegotiate()
2840 if ((sc->options & SSL_OP_NO_RENEGOTIATION) != 0) { in can_renegotiate()
2850 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_renegotiate() local
2852 if (sc == NULL) in SSL_renegotiate()
2855 if (!can_renegotiate(sc)) in SSL_renegotiate()
2858 sc->renegotiate = 1; in SSL_renegotiate()
2859 sc->new_session = 1; in SSL_renegotiate()
2865 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_renegotiate_abbreviated() local
2867 if (sc == NULL) in SSL_renegotiate_abbreviated()
2870 if (!can_renegotiate(sc)) in SSL_renegotiate_abbreviated()
2873 sc->renegotiate = 1; in SSL_renegotiate_abbreviated()
2874 sc->new_session = 0; in SSL_renegotiate_abbreviated()
2880 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_renegotiate_pending() local
2882 if (sc == NULL) in SSL_renegotiate_pending()
2889 return (sc->renegotiate != 0); in SSL_renegotiate_pending()
2894 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_new_session_ticket() local
2896 if (sc == NULL) in SSL_new_session_ticket()
2900 if ((SSL_in_init(s) && sc->ext.extra_tickets_expected == 0) in SSL_new_session_ticket()
2901 || SSL_IS_FIRST_HANDSHAKE(sc) || !sc->server in SSL_new_session_ticket()
2902 || !SSL_CONNECTION_IS_TLS13(sc)) in SSL_new_session_ticket()
2904 sc->ext.extra_tickets_expected++; in SSL_new_session_ticket()
2905 if (!RECORD_LAYER_write_pending(&sc->rlayer) && !SSL_in_init(s)) in SSL_new_session_ticket()
2906 ossl_statem_set_in_init(sc, 1); in SSL_new_session_ticket()
2918 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ossl_ctrl_internal() local
2938 if (sc == NULL) in ossl_ctrl_internal()
2943 return RECORD_LAYER_get_read_ahead(&sc->rlayer); in ossl_ctrl_internal()
2945 l = RECORD_LAYER_get_read_ahead(&sc->rlayer); in ossl_ctrl_internal()
2946 RECORD_LAYER_set_read_ahead(&sc->rlayer, larg); in ossl_ctrl_internal()
2953 sc->mode |= larg; in ossl_ctrl_internal()
2956 &sc->mode); in ossl_ctrl_internal()
2960 sc->rlayer.rrlmethod->set_options(sc->rlayer.rrl, options); in ossl_ctrl_internal()
2962 return sc->mode; in ossl_ctrl_internal()
2965 return (sc->mode &= ~larg); in ossl_ctrl_internal()
2967 return (long)sc->max_cert_list; in ossl_ctrl_internal()
2971 l = (long)sc->max_cert_list; in ossl_ctrl_internal()
2972 sc->max_cert_list = (size_t)larg; in ossl_ctrl_internal()
2978 if (sc->wbio != NULL && BIO_get_ktls_send(sc->wbio)) in ossl_ctrl_internal()
2981 sc->max_send_fragment = larg; in ossl_ctrl_internal()
2982 if (sc->max_send_fragment < sc->split_send_fragment) in ossl_ctrl_internal()
2983 sc->split_send_fragment = sc->max_send_fragment; in ossl_ctrl_internal()
2984 sc->rlayer.wrlmethod->set_max_frag_len(sc->rlayer.wrl, larg); in ossl_ctrl_internal()
2987 if ((size_t)larg > sc->max_send_fragment || larg == 0) in ossl_ctrl_internal()
2989 sc->split_send_fragment = larg; in ossl_ctrl_internal()
2994 sc->max_pipelines = larg; in ossl_ctrl_internal()
2995 if (sc->rlayer.rrlmethod->set_max_pipelines != NULL) in ossl_ctrl_internal()
2996 sc->rlayer.rrlmethod->set_max_pipelines(sc->rlayer.rrl, (size_t)larg); in ossl_ctrl_internal()
2999 return sc->s3.send_connection_binding; in ossl_ctrl_internal()
3001 sc->rwstate = SSL_RETRY_VERIFY; in ossl_ctrl_internal()
3004 return (sc->cert->cert_flags |= larg); in ossl_ctrl_internal()
3006 return (sc->cert->cert_flags &= ~larg); in ossl_ctrl_internal()
3010 if (sc->s3.tmp.ciphers_raw == NULL) in ossl_ctrl_internal()
3012 *(unsigned char **)parg = sc->s3.tmp.ciphers_raw; in ossl_ctrl_internal()
3013 return (int)sc->s3.tmp.ciphers_rawlen; in ossl_ctrl_internal()
3018 if (!sc->session || SSL_in_init(s) || ossl_statem_get_in_handshake(sc)) in ossl_ctrl_internal()
3020 if (sc->session->flags & SSL_SESS_FLAG_EXTMS) in ossl_ctrl_internal()
3025 return ssl_check_allowed_versions(larg, sc->max_proto_version) in ossl_ctrl_internal()
3027 &sc->min_proto_version); in ossl_ctrl_internal()
3029 return sc->min_proto_version; in ossl_ctrl_internal()
3031 return ssl_check_allowed_versions(sc->min_proto_version, larg) in ossl_ctrl_internal()
3033 &sc->max_proto_version); in ossl_ctrl_internal()
3035 return sc->max_proto_version; in ossl_ctrl_internal()
3038 return SSL_ctrl((SSL *)sc, cmd, larg, parg); in ossl_ctrl_internal()
3223 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in STACK_OF() local
3225 if (sc != NULL) { in STACK_OF()
3226 if (sc->cipher_list != NULL) { in STACK_OF()
3227 return sc->cipher_list; in STACK_OF()
3237 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in STACK_OF() local
3239 if (sc == NULL || !sc->server) in STACK_OF()
3241 return sc->peer_ciphers; in STACK_OF()
3248 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in STACK_OF() local
3250 if (sc == NULL) in STACK_OF()
3256 if (!ssl_set_client_disabled(sc)) in STACK_OF()
3260 if (!ssl_cipher_disabled(sc, c, SSL_SECOP_CIPHER_SUPPORTED, 0)) { in STACK_OF()
3362 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_cipher_list() local
3365 if (sc == NULL) in SSL_set_cipher_list()
3369 sk = ssl_create_cipher_list(ctx, sc->tls13_ciphersuites, in SSL_set_cipher_list()
3370 &sc->cipher_list, &sc->cipher_list_by_id, str, in SSL_set_cipher_list()
3371 sc->cert); in SSL_set_cipher_list()
3388 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_shared_ciphers() local
3390 if (sc == NULL) in SSL_get_shared_ciphers()
3393 if (!sc->server in SSL_get_shared_ciphers()
3394 || sc->peer_ciphers == NULL in SSL_get_shared_ciphers()
3399 clntsk = sc->peer_ciphers; in SSL_get_shared_ciphers()
3442 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_servername() local
3445 if (sc == NULL) in SSL_get_servername()
3452 server = sc->handshake_func == NULL ? 0 : sc->server; in SSL_get_servername()
3474 if (sc->hit && !SSL_CONNECTION_IS_TLS13(sc)) in SSL_get_servername()
3475 return sc->session->ext.hostname; in SSL_get_servername()
3500 if (sc->ext.hostname == NULL in SSL_get_servername()
3501 && sc->session != NULL in SSL_get_servername()
3502 && sc->session->ssl_version != TLS1_3_VERSION) in SSL_get_servername()
3503 return sc->session->ext.hostname; in SSL_get_servername()
3505 if (!SSL_CONNECTION_IS_TLS13(sc) && sc->hit in SSL_get_servername()
3506 && sc->session->ext.hostname != NULL) in SSL_get_servername()
3507 return sc->session->ext.hostname; in SSL_get_servername()
3511 return sc->ext.hostname; in SSL_get_servername()
3608 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get0_next_proto_negotiated() local
3610 if (sc == NULL) { in SSL_get0_next_proto_negotiated()
3617 *data = sc->ext.npn; in SSL_get0_next_proto_negotiated()
3621 *len = (unsigned int)sc->ext.npn_len; in SSL_get0_next_proto_negotiated()
3722 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_set_alpn_protos() local
3724 if (sc == NULL) in SSL_set_alpn_protos()
3728 OPENSSL_free(sc->ext.alpn); in SSL_set_alpn_protos()
3729 sc->ext.alpn = NULL; in SSL_set_alpn_protos()
3730 sc->ext.alpn_len = 0; in SSL_set_alpn_protos()
3740 OPENSSL_free(sc->ext.alpn); in SSL_set_alpn_protos()
3741 sc->ext.alpn = alpn; in SSL_set_alpn_protos()
3742 sc->ext.alpn_len = protos_len; in SSL_set_alpn_protos()
3769 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(ssl); in SSL_get0_alpn_selected() local
3771 if (sc == NULL) { in SSL_get0_alpn_selected()
3778 *data = sc->s3.alpn_selected; in SSL_get0_alpn_selected()
3782 *len = (unsigned int)sc->s3.alpn_selected_len; in SSL_get0_alpn_selected()
3790 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_export_keying_material() local
3792 if (sc == NULL) in SSL_export_keying_material()
3795 if (sc->session == NULL in SSL_export_keying_material()
3796 || (sc->version < TLS1_VERSION && sc->version != DTLS1_BAD_VER)) in SSL_export_keying_material()
3799 return sc->ssl.method->ssl3_enc->export_keying_material(sc, out, olen, label, in SSL_export_keying_material()
3810 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_export_keying_material_early() local
3812 if (sc == NULL) in SSL_export_keying_material_early()
3815 if (sc->version != TLS1_3_VERSION) in SSL_export_keying_material_early()
3818 return tls13_export_keying_material_early(sc, out, olen, label, llen, in SSL_export_keying_material_early()
4403 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_default_passwd_cb() local
4405 if (sc == NULL) in SSL_set_default_passwd_cb()
4408 sc->default_passwd_callback = cb; in SSL_set_default_passwd_cb()
4413 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_default_passwd_cb_userdata() local
4415 if (sc == NULL) in SSL_set_default_passwd_cb_userdata()
4418 sc->default_passwd_callback_userdata = u; in SSL_set_default_passwd_cb_userdata()
4423 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get_default_passwd_cb() local
4425 if (sc == NULL) in SSL_get_default_passwd_cb()
4428 return sc->default_passwd_callback; in SSL_get_default_passwd_cb()
4433 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get_default_passwd_cb_userdata() local
4435 if (sc == NULL) in SSL_get_default_passwd_cb_userdata()
4438 return sc->default_passwd_callback_userdata; in SSL_get_default_passwd_cb_userdata()
4468 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_cert_cb() local
4470 if (sc == NULL) in SSL_set_cert_cb()
4473 ssl_cert_set_cert_cb(sc->cert, cb, arg); in SSL_set_cert_cb()
4712 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_ssl_method() local
4715 if (sc == NULL in SSL_set_ssl_method()
4722 int (*hf) (SSL *) = sc->handshake_func; in SSL_set_ssl_method()
4733 sc->handshake_func = meth->ssl_connect; in SSL_set_ssl_method()
4735 sc->handshake_func = meth->ssl_accept; in SSL_set_ssl_method()
4750 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in ossl_ssl_get_error() local
4763 if (sc == NULL) in ossl_ssl_get_error()
4812 bio = sc->wbio; in ossl_ssl_get_error()
4843 if ((sc->shutdown & SSL_RECEIVED_SHUTDOWN) && in ossl_ssl_get_error()
4844 (sc->s3.warn_alert == SSL_AD_CLOSE_NOTIFY)) in ossl_ssl_get_error()
4854 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in ssl_do_handshake_intern() local
4856 if (sc == NULL) in ssl_do_handshake_intern()
4859 return sc->handshake_func(s); in ssl_do_handshake_intern()
4865 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_do_handshake() local
4872 if (sc->handshake_func == NULL) { in SSL_do_handshake()
4877 ossl_statem_check_finish_init(sc, -1); in SSL_do_handshake()
4882 if ((sc->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) { in SSL_do_handshake()
4890 ret = sc->handshake_func(s); in SSL_do_handshake()
4898 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_set_accept_state() local
4907 sc->server = 1; in SSL_set_accept_state()
4908 sc->shutdown = 0; in SSL_set_accept_state()
4909 ossl_statem_clear(sc); in SSL_set_accept_state()
4910 sc->handshake_func = s->method->ssl_accept; in SSL_set_accept_state()
4912 RECORD_LAYER_reset(&sc->rlayer); in SSL_set_accept_state()
4917 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_set_connect_state() local
4926 sc->server = 0; in SSL_set_connect_state()
4927 sc->shutdown = 0; in SSL_set_connect_state()
4928 ossl_statem_clear(sc); in SSL_set_connect_state()
4929 sc->handshake_func = s->method->ssl_connect; in SSL_set_connect_state()
4931 RECORD_LAYER_reset(&sc->rlayer); in SSL_set_connect_state()
4980 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_version() local
4988 if (sc == NULL) in SSL_get_version()
4991 return ssl_protocol_to_string(sc->version); in SSL_get_version()
4996 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_handshake_rtt() local
4998 if (sc == NULL) in SSL_get_handshake_rtt()
5000 if (sc->ts_msg_write.t <= 0 || sc->ts_msg_read.t <= 0) in SSL_get_handshake_rtt()
5002 if (sc->ts_msg_read.t < sc->ts_msg_write.t) in SSL_get_handshake_rtt()
5005 *rtt = ossl_time2us(ossl_time_subtract(sc->ts_msg_read, sc->ts_msg_write)); in SSL_get_handshake_rtt()
5045 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_dup() local
5047 if (sc == NULL) in SSL_dup()
5064 if (sc->session != NULL) { in SSL_dup()
5081 if (sc->cert != NULL) { in SSL_dup()
5083 retsc->cert = ssl_cert_dup(sc->cert); in SSL_dup()
5088 if (!SSL_set_session_id_context(ret, sc->sid_ctx, in SSL_dup()
5089 (int)sc->sid_ctx_length)) in SSL_dup()
5093 if (!ssl_dane_dup(retsc, sc)) in SSL_dup()
5095 retsc->version = sc->version; in SSL_dup()
5096 retsc->options = sc->options; in SSL_dup()
5097 retsc->min_proto_version = sc->min_proto_version; in SSL_dup()
5098 retsc->max_proto_version = sc->max_proto_version; in SSL_dup()
5099 retsc->mode = sc->mode; in SSL_dup()
5102 retsc->msg_callback = sc->msg_callback; in SSL_dup()
5103 retsc->msg_callback_arg = sc->msg_callback_arg; in SSL_dup()
5106 retsc->generate_session_id = sc->generate_session_id; in SSL_dup()
5114 retsc->server = sc->server; in SSL_dup()
5115 if (sc->handshake_func) { in SSL_dup()
5116 if (sc->server) in SSL_dup()
5121 retsc->shutdown = sc->shutdown; in SSL_dup()
5122 retsc->hit = sc->hit; in SSL_dup()
5124 retsc->default_passwd_callback = sc->default_passwd_callback; in SSL_dup()
5125 retsc->default_passwd_callback_userdata = sc->default_passwd_callback_userdata; in SSL_dup()
5127 X509_VERIFY_PARAM_inherit(retsc->param, sc->param); in SSL_dup()
5130 if (sc->cipher_list != NULL) { in SSL_dup()
5131 if ((retsc->cipher_list = sk_SSL_CIPHER_dup(sc->cipher_list)) == NULL) in SSL_dup()
5134 if (sc->cipher_list_by_id != NULL) in SSL_dup()
5135 if ((retsc->cipher_list_by_id = sk_SSL_CIPHER_dup(sc->cipher_list_by_id)) in SSL_dup()
5140 if (!dup_ca_names(&retsc->ca_names, sc->ca_names) in SSL_dup()
5141 || !dup_ca_names(&retsc->client_ca_names, sc->client_ca_names)) in SSL_dup()
5153 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get_certificate() local
5155 if (sc == NULL) in SSL_get_certificate()
5158 if (sc->cert != NULL) in SSL_get_certificate()
5159 return sc->cert->key->x509; in SSL_get_certificate()
5166 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_privatekey() local
5168 if (sc == NULL) in SSL_get_privatekey()
5171 if (sc->cert != NULL) in SSL_get_privatekey()
5172 return sc->cert->key->privatekey; in SSL_get_privatekey()
5195 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_current_cipher() local
5197 if (sc == NULL) in SSL_get_current_cipher()
5200 if ((sc->session != NULL) && (sc->session->cipher != NULL)) in SSL_get_current_cipher()
5201 return sc->session->cipher; in SSL_get_current_cipher()
5207 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_pending_cipher() local
5209 if (sc == NULL) in SSL_get_pending_cipher()
5212 return sc->s3.tmp.new_cipher; in SSL_get_pending_cipher()
5218 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL_ONLY(s); in SSL_get_current_compression() local
5220 if (sc == NULL) in SSL_get_current_compression()
5223 return sc->rlayer.wrlmethod->get_compression(sc->rlayer.wrl); in SSL_get_current_compression()
5232 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL_ONLY(s); in SSL_get_current_expansion() local
5234 if (sc == NULL) in SSL_get_current_expansion()
5237 return sc->rlayer.rrlmethod->get_compression(sc->rlayer.rrl); in SSL_get_current_expansion()
5293 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_set_quiet_shutdown() local
5296 if (sc == NULL) in SSL_set_quiet_shutdown()
5299 sc->quiet_shutdown = mode; in SSL_set_quiet_shutdown()
5304 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL_ONLY(s); in SSL_get_quiet_shutdown() local
5307 if (sc == NULL) in SSL_get_quiet_shutdown()
5310 return sc->quiet_shutdown; in SSL_get_quiet_shutdown()
5315 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_set_shutdown() local
5318 if (sc == NULL) in SSL_set_shutdown()
5321 sc->shutdown = mode; in SSL_set_shutdown()
5326 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL_ONLY(s); in SSL_get_shutdown() local
5334 if (sc == NULL) in SSL_get_shutdown()
5337 return sc->shutdown; in SSL_get_shutdown()
5342 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_version() local
5349 if (sc == NULL) in SSL_version()
5352 return sc->version; in SSL_version()
5357 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_client_version() local
5364 if (sc == NULL) in SSL_client_version()
5367 return sc->client_version; in SSL_client_version()
5378 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl); in SSL_set_SSL_CTX() local
5381 if (sc == NULL) in SSL_set_SSL_CTX()
5387 ctx = sc->session_ctx; in SSL_set_SSL_CTX()
5393 if (!custom_exts_copy_flags(&new_cert->custext, &sc->cert->custext)) { in SSL_set_SSL_CTX()
5398 ssl_cert_free(sc->cert); in SSL_set_SSL_CTX()
5399 sc->cert = new_cert; in SSL_set_SSL_CTX()
5405 if (!ossl_assert(sc->sid_ctx_length <= sizeof(sc->sid_ctx))) in SSL_set_SSL_CTX()
5415 (sc->sid_ctx_length == ssl->ctx->sid_ctx_length) && in SSL_set_SSL_CTX()
5416 (memcmp(sc->sid_ctx, ssl->ctx->sid_ctx, sc->sid_ctx_length) == 0)) { in SSL_set_SSL_CTX()
5417 sc->sid_ctx_length = ctx->sid_ctx_length; in SSL_set_SSL_CTX()
5418 memcpy(&sc->sid_ctx, &ctx->sid_ctx, sizeof(sc->sid_ctx)); in SSL_set_SSL_CTX()
5521 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_set_info_callback() local
5523 if (sc == NULL) in SSL_set_info_callback()
5526 sc->info_callback = cb; in SSL_set_info_callback()
5536 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(ssl); in SSL_get_info_callback() local
5538 if (sc == NULL) in SSL_get_info_callback()
5541 return sc->info_callback; in SSL_get_info_callback()
5546 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_set_verify_result() local
5548 if (sc == NULL) in SSL_set_verify_result()
5551 sc->verify_result = arg; in SSL_set_verify_result()
5556 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(ssl); in SSL_get_verify_result() local
5558 if (sc == NULL) in SSL_get_verify_result()
5561 return sc->verify_result; in SSL_get_verify_result()
5566 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(ssl); in SSL_get_client_random() local
5568 if (sc == NULL) in SSL_get_client_random()
5572 return sizeof(sc->s3.client_random); in SSL_get_client_random()
5573 if (outlen > sizeof(sc->s3.client_random)) in SSL_get_client_random()
5574 outlen = sizeof(sc->s3.client_random); in SSL_get_client_random()
5575 memcpy(out, sc->s3.client_random, outlen); in SSL_get_client_random()
5581 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(ssl); in SSL_get_server_random() local
5583 if (sc == NULL) in SSL_get_server_random()
5587 return sizeof(sc->s3.server_random); in SSL_get_server_random()
5588 if (outlen > sizeof(sc->s3.server_random)) in SSL_get_server_random()
5589 outlen = sizeof(sc->s3.server_random); in SSL_get_server_random()
5590 memcpy(out, sc->s3.server_random, outlen); in SSL_get_server_random()
5657 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_want() local
5664 if (sc == NULL) in SSL_want()
5667 return sc->rwstate; in SSL_want()
5689 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_use_psk_identity_hint() local
5691 if (sc == NULL) in SSL_use_psk_identity_hint()
5698 OPENSSL_free(sc->cert->psk_identity_hint); in SSL_use_psk_identity_hint()
5700 sc->cert->psk_identity_hint = OPENSSL_strdup(identity_hint); in SSL_use_psk_identity_hint()
5701 if (sc->cert->psk_identity_hint == NULL) in SSL_use_psk_identity_hint()
5704 sc->cert->psk_identity_hint = NULL; in SSL_use_psk_identity_hint()
5710 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_psk_identity_hint() local
5712 if (sc == NULL || sc->session == NULL) in SSL_get_psk_identity_hint()
5715 return sc->session->psk_identity_hint; in SSL_get_psk_identity_hint()
5720 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_psk_identity() local
5722 if (sc == NULL || sc->session == NULL) in SSL_get_psk_identity()
5725 return sc->session->psk_identity; in SSL_get_psk_identity()
5730 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_psk_client_callback() local
5732 if (sc == NULL) in SSL_set_psk_client_callback()
5735 sc->psk_client_callback = cb; in SSL_set_psk_client_callback()
5745 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_psk_server_callback() local
5747 if (sc == NULL) in SSL_set_psk_server_callback()
5750 sc->psk_server_callback = cb; in SSL_set_psk_server_callback()
5761 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_psk_find_session_callback() local
5763 if (sc == NULL) in SSL_set_psk_find_session_callback()
5766 sc->psk_find_session_cb = cb; in SSL_set_psk_find_session_callback()
5777 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_psk_use_session_callback() local
5779 if (sc == NULL) in SSL_set_psk_use_session_callback()
5782 sc->psk_use_session_cb = cb; in SSL_set_psk_use_session_callback()
5875 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl); in SSL_set_record_padding_callback() local
5877 if (sc == NULL) in SSL_set_record_padding_callback()
5882 sc->rlayer.record_padding_cb = cb; in SSL_set_record_padding_callback()
5890 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_set_record_padding_callback_arg() local
5892 if (sc == NULL) in SSL_set_record_padding_callback_arg()
5895 sc->rlayer.record_padding_arg = arg; in SSL_set_record_padding_callback_arg()
5900 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(ssl); in SSL_get_record_padding_callback_arg() local
5902 if (sc == NULL) in SSL_get_record_padding_callback_arg()
5905 return sc->rlayer.record_padding_arg; in SSL_get_record_padding_callback_arg()
5911 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_set_block_padding_ex() local
5913 if (sc == NULL in SSL_set_block_padding_ex()
5920 sc->rlayer.block_padding = 0; in SSL_set_block_padding_ex()
5922 sc->rlayer.block_padding = app_block_size; in SSL_set_block_padding_ex()
5927 sc->rlayer.hs_padding = 0; in SSL_set_block_padding_ex()
5929 sc->rlayer.hs_padding = hs_block_size; in SSL_set_block_padding_ex()
5943 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_num_tickets() local
5945 if (sc == NULL) in SSL_set_num_tickets()
5948 sc->num_tickets = num_tickets; in SSL_set_num_tickets()
5955 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_num_tickets() local
5957 if (sc == NULL) in SSL_get_num_tickets()
5960 return sc->num_tickets; in SSL_get_num_tickets()
6012 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_session_reused() local
6014 if (sc == NULL) in SSL_session_reused()
6017 return sc->hit; in SSL_session_reused()
6022 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_is_server() local
6024 if (sc == NULL) in SSL_is_server()
6027 return sc->server; in SSL_is_server()
6041 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_security_level() local
6043 if (sc == NULL) in SSL_set_security_level()
6046 sc->cert->sec_level = level; in SSL_set_security_level()
6051 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_security_level() local
6053 if (sc == NULL) in SSL_get_security_level()
6056 return sc->cert->sec_level; in SSL_get_security_level()
6064 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_security_callback() local
6066 if (sc == NULL) in SSL_set_security_callback()
6069 sc->cert->sec_cb = cb; in SSL_set_security_callback()
6076 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_security_callback() local
6078 if (sc == NULL) in SSL_get_security_callback()
6081 return sc->cert->sec_cb; in SSL_get_security_callback()
6086 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set0_security_ex_data() local
6088 if (sc == NULL) in SSL_set0_security_ex_data()
6091 sc->cert->sec_ex = ex; in SSL_set0_security_ex_data()
6096 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get0_security_ex_data() local
6098 if (sc == NULL) in SSL_get0_security_ex_data()
6101 return sc->cert->sec_ex; in SSL_get0_security_ex_data()
6148 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_options() local
6155 if (sc == NULL) in SSL_get_options()
6158 return sc->options; in SSL_get_options()
6168 SSL_CONNECTION *sc; in SSL_set_options() local
6176 sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_options()
6177 if (sc == NULL) in SSL_set_options()
6180 sc->options |= op; in SSL_set_options()
6183 &sc->options); in SSL_set_options()
6187 sc->rlayer.rrlmethod->set_options(sc->rlayer.rrl, options); in SSL_set_options()
6188 sc->rlayer.wrlmethod->set_options(sc->rlayer.wrl, options); in SSL_set_options()
6190 return sc->options; in SSL_set_options()
6200 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_clear_options() local
6208 if (sc == NULL) in SSL_clear_options()
6211 sc->options &= ~op; in SSL_clear_options()
6214 &sc->options); in SSL_clear_options()
6218 sc->rlayer.rrlmethod->set_options(sc->rlayer.rrl, options); in SSL_clear_options()
6219 sc->rlayer.wrlmethod->set_options(sc->rlayer.wrl, options); in SSL_clear_options()
6221 return sc->options; in SSL_clear_options()
6226 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in STACK_OF() local
6228 if (sc == NULL) in STACK_OF()
6231 return sc->verified_chain; in STACK_OF()
6380 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in STACK_OF() local
6382 if (sc == NULL) in STACK_OF()
6385 if (!sc->scts_parsed) { in STACK_OF()
6386 if (ct_extract_tls_extension_scts(sc) < 0 || in STACK_OF()
6387 ct_extract_ocsp_response_scts(sc) < 0 || in STACK_OF()
6388 ct_extract_x509v3_extension_scts(sc) < 0) in STACK_OF()
6391 sc->scts_parsed = 1; in STACK_OF()
6393 return sc->scts; in STACK_OF()
6424 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set_ct_validation_callback() local
6426 if (sc == NULL) in SSL_set_ct_validation_callback()
6448 sc->ct_validation_callback = callback; in SSL_set_ct_validation_callback()
6449 sc->ct_validation_callback_arg = arg; in SSL_set_ct_validation_callback()
6475 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_ct_is_enabled() local
6477 if (sc == NULL) in SSL_ct_is_enabled()
6480 return sc->ct_validation_callback != NULL; in SSL_ct_is_enabled()
6647 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_client_hello_isv2() local
6649 if (sc == NULL) in SSL_client_hello_isv2()
6652 if (sc->clienthello == NULL) in SSL_client_hello_isv2()
6654 return sc->clienthello->isv2; in SSL_client_hello_isv2()
6659 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_client_hello_get0_legacy_version() local
6661 if (sc == NULL) in SSL_client_hello_get0_legacy_version()
6664 if (sc->clienthello == NULL) in SSL_client_hello_get0_legacy_version()
6666 return sc->clienthello->legacy_version; in SSL_client_hello_get0_legacy_version()
6671 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_client_hello_get0_random() local
6673 if (sc == NULL) in SSL_client_hello_get0_random()
6676 if (sc->clienthello == NULL) in SSL_client_hello_get0_random()
6679 *out = sc->clienthello->random; in SSL_client_hello_get0_random()
6685 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_client_hello_get0_session_id() local
6687 if (sc == NULL) in SSL_client_hello_get0_session_id()
6690 if (sc->clienthello == NULL) in SSL_client_hello_get0_session_id()
6693 *out = sc->clienthello->session_id; in SSL_client_hello_get0_session_id()
6694 return sc->clienthello->session_id_len; in SSL_client_hello_get0_session_id()
6699 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_client_hello_get0_ciphers() local
6701 if (sc == NULL) in SSL_client_hello_get0_ciphers()
6704 if (sc->clienthello == NULL) in SSL_client_hello_get0_ciphers()
6707 *out = PACKET_data(&sc->clienthello->ciphersuites); in SSL_client_hello_get0_ciphers()
6708 return PACKET_remaining(&sc->clienthello->ciphersuites); in SSL_client_hello_get0_ciphers()
6713 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_client_hello_get0_compression_methods() local
6715 if (sc == NULL) in SSL_client_hello_get0_compression_methods()
6718 if (sc->clienthello == NULL) in SSL_client_hello_get0_compression_methods()
6721 *out = sc->clienthello->compressions; in SSL_client_hello_get0_compression_methods()
6722 return sc->clienthello->compressions_len; in SSL_client_hello_get0_compression_methods()
6730 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_client_hello_get1_extensions_present() local
6732 if (sc == NULL) in SSL_client_hello_get1_extensions_present()
6735 if (sc->clienthello == NULL || out == NULL || outlen == NULL) in SSL_client_hello_get1_extensions_present()
6737 for (i = 0; i < sc->clienthello->pre_proc_exts_len; i++) { in SSL_client_hello_get1_extensions_present()
6738 ext = sc->clienthello->pre_proc_exts + i; in SSL_client_hello_get1_extensions_present()
6749 for (i = 0; i < sc->clienthello->pre_proc_exts_len; i++) { in SSL_client_hello_get1_extensions_present()
6750 ext = sc->clienthello->pre_proc_exts + i; in SSL_client_hello_get1_extensions_present()
6769 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_client_hello_get_extension_order() local
6771 if (sc == NULL) in SSL_client_hello_get_extension_order()
6774 if (sc->clienthello == NULL || num_exts == NULL) in SSL_client_hello_get_extension_order()
6776 for (i = 0; i < sc->clienthello->pre_proc_exts_len; i++) { in SSL_client_hello_get_extension_order()
6777 ext = sc->clienthello->pre_proc_exts + i; in SSL_client_hello_get_extension_order()
6791 for (i = 0; i < sc->clienthello->pre_proc_exts_len; i++) { in SSL_client_hello_get_extension_order()
6792 ext = sc->clienthello->pre_proc_exts + i; in SSL_client_hello_get_extension_order()
6808 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_client_hello_get0_ext() local
6810 if (sc == NULL) in SSL_client_hello_get0_ext()
6813 if (sc->clienthello == NULL) in SSL_client_hello_get0_ext()
6815 for (i = 0; i < sc->clienthello->pre_proc_exts_len; ++i) { in SSL_client_hello_get0_ext()
6816 r = sc->clienthello->pre_proc_exts + i; in SSL_client_hello_get0_ext()
6831 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl); in SSL_free_buffers() local
6833 if (sc == NULL) in SSL_free_buffers()
6836 rl = &sc->rlayer; in SSL_free_buffers()
6845 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_alloc_buffers() local
6847 if (sc == NULL) in SSL_alloc_buffers()
6854 rl = &sc->rlayer; in SSL_alloc_buffers()
6871 SSL_CONNECTION *sc, in nss_keylog_int() argument
6880 SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(sc); in nss_keylog_int()
6917 do_sslkeylogfile(SSL_CONNECTION_GET_SSL(sc), (const char *)out); in nss_keylog_int()
6920 sctx->keylog_callback(SSL_CONNECTION_GET_USER_SSL(sc), (const char *)out); in nss_keylog_int()
6925 int ssl_log_rsa_client_key_exchange(SSL_CONNECTION *sc, in ssl_log_rsa_client_key_exchange() argument
6932 SSLfatal(sc, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR); in ssl_log_rsa_client_key_exchange()
6938 sc, in ssl_log_rsa_client_key_exchange()
6945 int ssl_log_secret(SSL_CONNECTION *sc, in ssl_log_secret() argument
6951 sc, in ssl_log_secret()
6952 sc->s3.client_random, in ssl_log_secret()
7030 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_bytes_to_cipher_list() local
7032 if (sc == NULL) in SSL_bytes_to_cipher_list()
7037 return ossl_bytes_to_cipher_list(sc, &pkt, sk, scsvs, isv2format, 0); in SSL_bytes_to_cipher_list()
7140 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_set_max_early_data() local
7142 if (sc == NULL) in SSL_set_max_early_data()
7145 sc->max_early_data = max_early_data; in SSL_set_max_early_data()
7152 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_max_early_data() local
7154 if (sc == NULL) in SSL_get_max_early_data()
7157 return sc->max_early_data; in SSL_get_max_early_data()
7174 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_set_recv_max_early_data() local
7176 if (sc == NULL) in SSL_set_recv_max_early_data()
7179 sc->recv_max_early_data = recv_max_early_data; in SSL_set_recv_max_early_data()
7186 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get_recv_max_early_data() local
7188 if (sc == NULL) in SSL_get_recv_max_early_data()
7191 return sc->recv_max_early_data; in SSL_get_recv_max_early_data()
7194 __owur unsigned int ssl_get_max_send_fragment(const SSL_CONNECTION *sc) in ssl_get_max_send_fragment() argument
7197 if (sc->session != NULL && USE_MAX_FRAGMENT_LENGTH_EXT(sc->session)) in ssl_get_max_send_fragment()
7198 return GET_MAX_FRAGMENT_LENGTH(sc->session); in ssl_get_max_send_fragment()
7201 return sc->max_send_fragment; in ssl_get_max_send_fragment()
7204 __owur unsigned int ssl_get_split_send_fragment(const SSL_CONNECTION *sc) in ssl_get_split_send_fragment() argument
7207 if (sc->session != NULL && USE_MAX_FRAGMENT_LENGTH_EXT(sc->session) in ssl_get_split_send_fragment()
7208 && sc->split_send_fragment > GET_MAX_FRAGMENT_LENGTH(sc->session)) in ssl_get_split_send_fragment()
7209 return GET_MAX_FRAGMENT_LENGTH(sc->session); in ssl_get_split_send_fragment()
7212 if (sc->split_send_fragment > sc->max_send_fragment) in ssl_get_split_send_fragment()
7213 return sc->max_send_fragment; in ssl_get_split_send_fragment()
7216 return sc->split_send_fragment; in ssl_get_split_send_fragment()
7222 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_stateless() local
7224 if (sc == NULL) in SSL_stateless()
7233 sc->s3.flags |= TLS1_FLAGS_STATELESS; in SSL_stateless()
7235 sc->s3.flags &= ~TLS1_FLAGS_STATELESS; in SSL_stateless()
7237 if (ret > 0 && sc->ext.cookieok) in SSL_stateless()
7240 if (sc->hello_retry_request == SSL_HRR_PENDING && !ossl_statem_in_error(sc)) in SSL_stateless()
7253 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(ssl); in SSL_set_post_handshake_auth() local
7255 if (sc == NULL) in SSL_set_post_handshake_auth()
7258 sc->pha_enabled = val; in SSL_set_post_handshake_auth()
7263 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); in SSL_verify_client_post_handshake() local
7272 if (sc == NULL) in SSL_verify_client_post_handshake()
7275 if (!SSL_CONNECTION_IS_TLS13(sc)) { in SSL_verify_client_post_handshake()
7279 if (!sc->server) { in SSL_verify_client_post_handshake()
7289 switch (sc->post_handshake_auth) { in SSL_verify_client_post_handshake()
7307 sc->post_handshake_auth = SSL_PHA_REQUEST_PENDING; in SSL_verify_client_post_handshake()
7310 if (!send_certificate_request(sc)) { in SSL_verify_client_post_handshake()
7311 sc->post_handshake_auth = SSL_PHA_EXT_RECEIVED; /* restore on error */ in SSL_verify_client_post_handshake()
7316 ossl_statem_set_in_init(sc, 1); in SSL_verify_client_post_handshake()
7343 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_set_allow_early_data_cb() local
7345 if (sc == NULL) in SSL_set_allow_early_data_cb()
7348 sc->allow_early_data_cb = cb; in SSL_set_allow_early_data_cb()
7349 sc->allow_early_data_cb_data = arg; in SSL_set_allow_early_data_cb()
7460 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set0_tmp_dh_pkey() local
7462 if (sc == NULL) in SSL_set0_tmp_dh_pkey()
7465 if (!ssl_security(sc, SSL_SECOP_TMP_DH, in SSL_set0_tmp_dh_pkey()
7470 EVP_PKEY_free(sc->cert->dh_tmp); in SSL_set0_tmp_dh_pkey()
7471 sc->cert->dh_tmp = dhpkey; in SSL_set0_tmp_dh_pkey()
7490 SSL_CONNECTION *sc; in SSL_handle_events() local
7497 sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_handle_events()
7498 if (sc != NULL && SSL_CONNECTION_IS_DTLS(sc)) in SSL_handle_events()
7514 SSL_CONNECTION *sc; in SSL_get_event_timeout() local
7521 sc = SSL_CONNECTION_FROM_SSL_ONLY(s); in SSL_get_event_timeout()
7522 if (sc != NULL && SSL_CONNECTION_IS_DTLS(sc) in SSL_get_event_timeout()
7536 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get_rpoll_descriptor() local
7543 if (sc == NULL || sc->rbio == NULL) in SSL_get_rpoll_descriptor()
7546 return BIO_get_rpoll_descriptor(sc->rbio, desc); in SSL_get_rpoll_descriptor()
7551 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get_wpoll_descriptor() local
7558 if (sc == NULL || sc->wbio == NULL) in SSL_get_wpoll_descriptor()
7561 return BIO_get_wpoll_descriptor(sc->wbio, desc); in SSL_get_wpoll_descriptor()
7883 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get0_peer_rpk() local
7885 if (sc == NULL || sc->session == NULL) in SSL_get0_peer_rpk()
7887 return sc->session->peer_rpk; in SSL_get0_peer_rpk()
7892 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get_negotiated_client_cert_type() local
7894 if (sc == NULL) in SSL_get_negotiated_client_cert_type()
7897 return sc->ext.client_cert_type; in SSL_get_negotiated_client_cert_type()
7902 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_get_negotiated_server_cert_type() local
7904 if (sc == NULL) in SSL_get_negotiated_server_cert_type()
7907 return sc->ext.server_cert_type; in SSL_get_negotiated_server_cert_type()
7964 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set1_client_cert_type() local
7966 return set_cert_type(&sc->client_cert_type, &sc->client_cert_type_len, in SSL_set1_client_cert_type()
7972 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s); in SSL_set1_server_cert_type() local
7974 return set_cert_type(&sc->server_cert_type, &sc->server_cert_type_len, in SSL_set1_server_cert_type()
7992 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get0_client_cert_type() local
7997 *t = sc->client_cert_type; in SSL_get0_client_cert_type()
7998 *len = sc->client_cert_type_len; in SSL_get0_client_cert_type()
8004 const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_CONST_SSL(s); in SSL_get0_server_cert_type() local
8009 *t = sc->server_cert_type; in SSL_get0_server_cert_type()
8010 *len = sc->server_cert_type_len; in SSL_get0_server_cert_type()