r/C_Programming • u/xie_xang • Jun 28 '26
Project Building a lightweight QUIC implementation in C — looking for protocol feedback
Hi everyone,
I've been working on a personal project called quic-lite, a single-header implementation of QUIC written in C.
The goal is to keep it lightweight, readable, and reasonably close to the QUIC RFCs while avoiding unnecessary complexity.
Current features include:
- Packet and frame encoding/decoding
- QUIC variable-length integers
- UDP abstraction
- AEAD encryption and header protection
- Transport parameter handling
- RFC-aligned packet structures
2
Upvotes
•
u/AutoModerator Jun 28 '26
Hi /u/xie_xang,
Your submission in r/C_Programming was filtered because it links to a git project.
You must edit the submission or respond to this comment with an explanation about how AI was involved in the creation of your project.
While AI-generated code is not disallowed, low-effort "slop" projects may be removed and it's likely that other users push back strongly on substantially AI-generated projects.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
5
u/flyingron Jun 29 '26
Do you have something against inline? I detest #define'd pseudo funcs.
4
u/skeeto Jun 29 '26
Neat project! I round-trip fuzz tested and found two packet-number bugs, both at the edges of the 62-bit packet-number space, so not critical in practice.
First,
ql_pkt_num_encodesilently produces an unrecoverable encoding when the gap to largest-acked is bigger than 4 wire bytes can represent (231). It still returns a 4-byte number, and the peer reconstructs the wrong value. Here'spn.c:Then:
Quick fix:
Second,
ql_pkt_num_decodemay hand back a packet number larger than the 62-bit maximum whenlargest_pnsits near the top of the space. The RFC 9000 Appendix A.3 reconstruction assumes numbers never reach 262, so it doesn't fold the candidate back down. Here'sdec.c:Then:
Quick fix:
0
u/[deleted] Jun 29 '26
[deleted] — view deleted comment