www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - [SAoC2022] QUIC Protocol : Milestone 1, Part 2

reply Vlad =?UTF-8?B?Q2hpY2/ImQ==?= <vladut.chicos gmail.com> writes:
Hi!
I worked a bit on QUIC and TLS frame decoding/encoding : 
https://github.com/dlang-community/quic-d/pull/4. I implemented 
sort of a "FrameReader" that can handle QUIC's variable length 
fields. I took some time to understand how QUIC and TLS frames 
interact with each other. Basically, in order to minimize the 
number of UDP datagrams sent over the network, TLS frames are 
embedded into QUIC CRYPTO frames. This way, these two protocols 
can do their handshakes at the same time.

Suggestions are welcome :)
Thanks!


References :
https://www.rfc-editor.org/rfc/rfc8446
https://www.rfc-editor.org/rfc/rfc9000
https://www.rfc-editor.org/rfc/rfc9001
Oct 06 2022
parent reply Kagamin <spam here.lot> writes:
```
alias tlsVersion = ubyte[2];

struct SupportedVersions
{
     tlsVersion[] tlsVersions = [0x3, 0x4];
}
```
Wait, this compiles? And what it does?
Oct 06 2022
parent Vlad =?UTF-8?B?Q2hpY2/ImQ==?= <vladut.chicos gmail.com> writes:
On Thursday, 6 October 2022 at 19:01:22 UTC, Kagamin wrote:
 ```
 alias tlsVersion = ubyte[2];

 struct SupportedVersions
 {
     tlsVersion[] tlsVersions = [0x3, 0x4];
 }
 ```
 Wait, this compiles? And what it does?
Thank you for warning me. Indeed, it does look wrong. I changed it, should be better now. That struct should be a TLS extension that provides a list of available TLS versions needed for peer negotiation. I gave it a default value(for TLS 1.3) since it is the only one allowed by QUIC.
Oct 06 2022