Skip to content

Commit 3fa2c5e

Browse files
lxinchucklever
authored andcommitted
tlshd: use quic_config to get parameters for quic handshake
The latest update to the QUIC module has moved several parameters from quic_transport_param to quic_config. These include important handshake- related parameters such as receive_session_ticket, certificate_request, and payload_cipher_type. So rename quic_conn_get_transport_param() to quic_conn_get_config(), and Use the QUIC_SOCKOPT_CONFIG socket option to retrieve these parameters before initiating the QUIC handshake. Signed-off-by: Xin Long <[email protected]>
1 parent f1ed4c3 commit 3fa2c5e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/tlshd/quic.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ static gnutls_record_encryption_level_t quic_get_encryption_level(uint8_t level)
284284
}
285285
}
286286

287-
static int quic_conn_get_transport_param(struct tlshd_quic_conn *conn)
287+
static int quic_conn_get_config(struct tlshd_quic_conn *conn)
288288
{
289-
struct quic_transport_param param = {};
290289
int sockfd = conn->parms->sockfd;
290+
struct quic_config config = {};
291291
unsigned int len;
292292

293293
len = sizeof(conn->alpns);
@@ -301,14 +301,14 @@ static int quic_conn_get_transport_param(struct tlshd_quic_conn *conn)
301301
return -1;
302302
}
303303
conn->ticket_len = len;
304-
len = sizeof(param);
305-
if (getsockopt(sockfd, SOL_QUIC, QUIC_SOCKOPT_TRANSPORT_PARAM, &param, &len)) {
306-
tlshd_log_error("socket getsockopt transport param error %d", errno);
304+
len = sizeof(config);
305+
if (getsockopt(sockfd, SOL_QUIC, QUIC_SOCKOPT_CONFIG, &config, &len)) {
306+
tlshd_log_error("socket getsockopt config error %d", errno);
307307
return -1;
308308
}
309-
conn->recv_ticket = param.receive_session_ticket;
310-
conn->cert_req = param.certificate_request;
311-
conn->cipher = param.payload_cipher_type;
309+
conn->recv_ticket = config.receive_session_ticket;
310+
conn->cert_req = config.certificate_request;
311+
conn->cipher = config.payload_cipher_type;
312312
return 0;
313313
}
314314

@@ -438,7 +438,7 @@ int tlshd_quic_conn_create(struct tlshd_quic_conn **conn_p, struct tlshd_handsha
438438
memset(conn, 0, sizeof(*conn));
439439
conn->parms = parms;
440440

441-
if (quic_conn_get_transport_param(conn)) {
441+
if (quic_conn_get_config(conn)) {
442442
ret = -errno;
443443
goto err;
444444
}

0 commit comments

Comments
 (0)