diff --git a/src/quic_frame.c b/src/quic_frame.c index d7a081e1a..7e1dbba54 100644 --- a/src/quic_frame.c +++ b/src/quic_frame.c @@ -500,11 +500,19 @@ static int quic_parse_new_token_frame(struct quic_frame *frm, struct quic_conn * { struct qf_new_token *new_token_frm = &frm->new_token; - if (!quic_dec_int(&new_token_frm->len, pos, end) || end - *pos < new_token_frm->len || - sizeof(new_token_frm->data) < new_token_frm->len) + if (!quic_dec_int(&new_token_frm->len, pos, end) || end - *pos < new_token_frm->len) return 0; + /* TODO token length is unknown as it is dependent from the peer. Hence + * dynamic allocation should be implemented for token storage, albeit + * with constraint to ensure memory usage remains reasonable. + */ +#if 0 + if (sizeof(new_token_frm->data) < new_token_frm->len) + return 0; memcpy(new_token_frm->data, *pos, new_token_frm->len); +#endif + *pos += new_token_frm->len; return 1; diff --git a/src/quic_rx.c b/src/quic_rx.c index b705d414d..e659bef9e 100644 --- a/src/quic_rx.c +++ b/src/quic_rx.c @@ -949,7 +949,11 @@ static int qc_parse_pkt_frms(struct quic_conn *qc, struct quic_rx_packet *pkt, goto err; } else { - /* TODO */ + /* TODO NEW_TOKEN not implemented on client side. + * Note that for now token is not copied into field + * of qf_new_token frame. See quic_parse_new_token_frame() + * for further explanations. + */ } break; case QUIC_FT_STREAM_8 ... QUIC_FT_STREAM_F: