1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include "Packet.hpp"
NAMESPACE_SOUP
{
SOUP_PACKET(TlsServerECDHParams)
{
u8 curve_type;
u16 named_curve;
std::string point;
SOUP_PACKET_IO(s)
{
return s.u8(curve_type)
&& curve_type == 3
&& s.u16be(named_curve)
&& s.template str_lp<u8_t>(point)
;
}
};
SOUP_PACKET(TlsServerKeyExchange)
{
TlsServerECDHParams params;
u16 signature_scheme; // https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-signaturescheme
std::string signature;
SOUP_PACKET_IO(s)
{
return params.io(s)
&& s.u16be(signature_scheme)
&& s.template str_lp<u16be_t>(signature)
;
}
};
}