Lines Matching refs:qtls
19 if ((rl) != NULL) (rl)->qtls->inerror = 1; \
57 QUIC_TLS *qtls; member
115 rl->qtls = (QUIC_TLS *)rlarg; in quic_new_record_layer()
182 if (!rl->qtls->args.yield_secret_cb(enc_level, qdir, suite_id, in quic_new_record_layer()
184 rl->qtls->args.yield_secret_cb_arg)) { in quic_new_record_layer()
303 if (!rl->qtls->args.alert_cb(rl->qtls->args.alert_cb_arg, alert)) { in quic_write_records()
314 if (!rl->qtls->args.crypto_send_cb(template->buf + rl->written, in quic_write_records()
317 rl->qtls->args.crypto_send_cb_arg)) { in quic_write_records()
370 if (!rl->qtls->args.crypto_recv_rcd_cb(data, datalen, in quic_read_record()
371 rl->qtls->args.crypto_recv_rcd_cb_arg)) { in quic_read_record()
431 if (!rl->qtls->args.crypto_release_rcd_cb(rl->recread, in quic_release_record()
432 rl->qtls->args.crypto_release_rcd_cb_arg)) { in quic_release_record()
482 if (rl->qtls->inerror) { in quic_get_state()
604 QUIC_TLS *qtls = add_arg; in add_transport_params_cb() local
606 *out = qtls->local_transport_params; in add_transport_params_cb()
607 *outlen = qtls->local_transport_params_len; in add_transport_params_cb()
625 QUIC_TLS *qtls = parse_arg; in parse_transport_params_cb() local
627 return qtls->args.got_transport_params_cb(in, inlen, in parse_transport_params_cb()
628 qtls->args.got_transport_params_cb_arg); in parse_transport_params_cb()
633 QUIC_TLS *qtls; in ossl_quic_tls_new() local
642 qtls = OPENSSL_zalloc(sizeof(*qtls)); in ossl_quic_tls_new()
643 if (qtls == NULL) in ossl_quic_tls_new()
646 if ((qtls->error_state = OSSL_ERR_STATE_new()) == NULL) { in ossl_quic_tls_new()
647 OPENSSL_free(qtls); in ossl_quic_tls_new()
651 qtls->args = *args; in ossl_quic_tls_new()
652 return qtls; in ossl_quic_tls_new()
655 void ossl_quic_tls_free(QUIC_TLS *qtls) in ossl_quic_tls_free() argument
657 if (qtls == NULL) in ossl_quic_tls_free()
659 OSSL_ERR_STATE_free(qtls->error_state); in ossl_quic_tls_free()
660 OPENSSL_free(qtls); in ossl_quic_tls_free()
663 static int raise_error(QUIC_TLS *qtls, uint64_t error_code, in raise_error() argument
680 OSSL_ERR_STATE_save_to_mark(qtls->error_state); in raise_error()
686 qtls->error_code = error_code; in raise_error()
687 qtls->error_msg = error_msg; in raise_error()
688 qtls->inerror = 1; in raise_error()
694 #define RAISE_ERROR(qtls, error_code, error_msg) \ argument
695 raise_error((qtls), (error_code), (error_msg), \
698 #define RAISE_INTERNAL_ERROR(qtls) \ argument
699 RAISE_ERROR((qtls), OSSL_QUIC_ERR_INTERNAL_ERROR, "internal error")
701 int ossl_quic_tls_tick(QUIC_TLS *qtls) in ossl_quic_tls_tick() argument
707 if (qtls->inerror) in ossl_quic_tls_tick()
733 if (!qtls->configured) { in ossl_quic_tls_tick()
734 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(qtls->args.s); in ossl_quic_tls_tick()
744 if (qtls->args.is_server) { in ossl_quic_tls_tick()
746 return RAISE_INTERNAL_ERROR(qtls); in ossl_quic_tls_tick()
749 return RAISE_ERROR(qtls, OSSL_QUIC_ERR_CRYPTO_NO_APP_PROTO, in ossl_quic_tls_tick()
752 if (!SSL_set_min_proto_version(qtls->args.s, TLS1_3_VERSION)) in ossl_quic_tls_tick()
753 return RAISE_INTERNAL_ERROR(qtls); in ossl_quic_tls_tick()
755 SSL_clear_options(qtls->args.s, SSL_OP_ENABLE_MIDDLEBOX_COMPAT); in ossl_quic_tls_tick()
756 ossl_ssl_set_custom_record_layer(sc, &quic_tls_record_method, qtls); in ossl_quic_tls_tick()
759 qtls->args.is_server ? ENDPOINT_SERVER in ossl_quic_tls_tick()
766 free_transport_params_cb, qtls, in ossl_quic_tls_tick()
767 parse_transport_params_cb, qtls)) in ossl_quic_tls_tick()
768 return RAISE_INTERNAL_ERROR(qtls); in ossl_quic_tls_tick()
772 return RAISE_INTERNAL_ERROR(qtls); in ossl_quic_tls_tick()
778 SSL_set_bio(qtls->args.s, nullbio, nullbio); in ossl_quic_tls_tick()
780 if (qtls->args.is_server) in ossl_quic_tls_tick()
781 SSL_set_accept_state(qtls->args.s); in ossl_quic_tls_tick()
783 SSL_set_connect_state(qtls->args.s); in ossl_quic_tls_tick()
785 qtls->configured = 1; in ossl_quic_tls_tick()
788 if (qtls->complete) in ossl_quic_tls_tick()
793 ret = SSL_read(qtls->args.s, NULL, 0); in ossl_quic_tls_tick()
795 ret = SSL_do_handshake(qtls->args.s); in ossl_quic_tls_tick()
798 err = ossl_ssl_get_error(qtls->args.s, ret, in ossl_quic_tls_tick()
811 return RAISE_INTERNAL_ERROR(qtls); in ossl_quic_tls_tick()
815 if (!qtls->complete) { in ossl_quic_tls_tick()
817 SSL_get0_alpn_selected(qtls->args.s, &alpn, &alpnlen); in ossl_quic_tls_tick()
819 return RAISE_ERROR(qtls, OSSL_QUIC_ERR_CRYPTO_NO_APP_PROTO, in ossl_quic_tls_tick()
822 qtls->complete = 1; in ossl_quic_tls_tick()
824 return qtls->args.handshake_complete_cb(qtls->args.handshake_complete_cb_arg); in ossl_quic_tls_tick()
831 int ossl_quic_tls_set_transport_params(QUIC_TLS *qtls, in ossl_quic_tls_set_transport_params() argument
835 qtls->local_transport_params = transport_params; in ossl_quic_tls_set_transport_params()
836 qtls->local_transport_params_len = transport_params_len; in ossl_quic_tls_set_transport_params()
840 int ossl_quic_tls_get_error(QUIC_TLS *qtls, in ossl_quic_tls_get_error() argument
845 if (qtls->inerror) { in ossl_quic_tls_get_error()
846 *error_code = qtls->error_code; in ossl_quic_tls_get_error()
847 *error_msg = qtls->error_msg; in ossl_quic_tls_get_error()
848 *error_state = qtls->error_state; in ossl_quic_tls_get_error()
851 return qtls->inerror; in ossl_quic_tls_get_error()
858 int ossl_quic_tls_is_cert_request(QUIC_TLS *qtls) in ossl_quic_tls_is_cert_request() argument
860 SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(qtls->args.s); in ossl_quic_tls_is_cert_request()
869 int ossl_quic_tls_has_bad_max_early_data(QUIC_TLS *qtls) in ossl_quic_tls_has_bad_max_early_data() argument
871 uint32_t max_early_data = SSL_get0_session(qtls->args.s)->ext.max_early_data; in ossl_quic_tls_has_bad_max_early_data()