Skip to content

Commit

Permalink
Draft 30 Support (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
nibanks authored Sep 18, 2020
1 parent ffc1e35 commit ef6f3b6
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .azure/azure-pipelines.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ stages:
containerRegistry: '9196310f-afae-4a53-8e35-b9e753eeb0f3'
tags: |
latest
v0.9.0.$(Build.BuildId)
v0.9.1.$(Build.BuildId)
- template: .\templates\run-qns.yml
parameters:
dependsOn: publish_docker
Expand Down
4 changes: 2 additions & 2 deletions scripts/run_endpoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ if [ "$ROLE" == "client" ]; then

if [ "$TESTCASE" == "multiconnect" ]; then
for REQ in $REQUESTS; do
quicinterop ${CLIENT_PARAMS} -custom:server -port:443 -urls:"$REQ"
quicinterop ${CLIENT_PARAMS} -custom:server -port:443 -urls:"$REQ" -version:-16777187
done
else
echo "Requests parameter: ${REQUESTS[@]}"
quicinterop ${CLIENT_PARAMS} -custom:server -port:443 -urls:"${REQUESTS[@]}"
quicinterop ${CLIENT_PARAMS} -custom:server -port:443 -urls:"${REQUESTS[@]}" -version:-16777187
fi
# Wait for the logs to flush to disk.
sleep 5
Expand Down
1 change: 1 addition & 0 deletions src/core/binding.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,7 @@ QuicBindingDeliverDatagrams(
case QUIC_VERSION_DRAFT_27:
case QUIC_VERSION_DRAFT_28:
case QUIC_VERSION_DRAFT_29:
case QUIC_VERSION_DRAFT_30:
case QUIC_VERSION_MS_1:
if (Packet->LH->Type != QUIC_INITIAL) {
QuicPacketLogDrop(Binding, Packet, "Non-initial packet not matched with a connection");
Expand Down
1 change: 1 addition & 0 deletions src/core/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1676,6 +1676,7 @@ QuicConnOnQuicVersionSet(
case QUIC_VERSION_DRAFT_27:
case QUIC_VERSION_DRAFT_28:
case QUIC_VERSION_DRAFT_29:
case QUIC_VERSION_DRAFT_30:
case QUIC_VERSION_MS_1:
default:
Connection->State.HeaderProtectionEnabled = TRUE;
Expand Down
7 changes: 7 additions & 0 deletions src/core/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
// The list is in priority order (highest to lowest).
//
const QUIC_VERSION_INFO QuicSupportedVersionList[] = {
{ QUIC_VERSION_DRAFT_30,
{ 0xaf, 0xbf, 0xec, 0x28, 0x99, 0x93, 0xd2, 0x4c, 0x9e, 0x97,
0x86, 0xf1, 0x9c, 0x61, 0x11, 0xe0, 0x43, 0x90, 0xa8, 0x99 },
{ 0x8b, 0x0d, 0x37, 0xeb, 0x85, 0x35, 0x02, 0x2e, 0xbc, 0x8d, 0x76, 0xa2, 0x07, 0xd8, 0x0d, 0xf2,
0x26, 0x46, 0xec, 0x06, 0xdc, 0x80, 0x96, 0x42, 0xc3, 0x0a, 0x8b, 0xaa, 0x2b, 0xaa, 0xff, 0x4c } },
{ QUIC_VERSION_DRAFT_29,
{ 0xaf, 0xbf, 0xec, 0x28, 0x99, 0x93, 0xd2, 0x4c, 0x9e, 0x97,
0x86, 0xf1, 0x9c, 0x61, 0x11, 0xe0, 0x43, 0x90, 0xa8, 0x99 },
Expand Down Expand Up @@ -599,6 +604,7 @@ QuicPacketLogHeader(
case QUIC_VERSION_DRAFT_27:
case QUIC_VERSION_DRAFT_28:
case QUIC_VERSION_DRAFT_29:
case QUIC_VERSION_DRAFT_30:
case QUIC_VERSION_MS_1: {
const QUIC_LONG_HEADER_V1 * const LongHdr =
(const QUIC_LONG_HEADER_V1 * const)Packet;
Expand Down Expand Up @@ -691,6 +697,7 @@ QuicPacketLogHeader(
case QUIC_VERSION_DRAFT_27:
case QUIC_VERSION_DRAFT_28:
case QUIC_VERSION_DRAFT_29:
case QUIC_VERSION_DRAFT_30:
case QUIC_VERSION_MS_1: {
const QUIC_SHORT_HEADER_V1 * const Header =
(const QUIC_SHORT_HEADER_V1 * const)Packet;
Expand Down
3 changes: 2 additions & 1 deletion src/core/packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ typedef struct QUIC_VERSION_INFO {
//
// The list of supported QUIC versions.
//
extern const QUIC_VERSION_INFO QuicSupportedVersionList[4];
extern const QUIC_VERSION_INFO QuicSupportedVersionList[5];

//
// Prefixes used in packet logging.
Expand Down Expand Up @@ -252,6 +252,7 @@ QuicPacketIsHandshake(
case QUIC_VERSION_DRAFT_27:
case QUIC_VERSION_DRAFT_28:
case QUIC_VERSION_DRAFT_29:
case QUIC_VERSION_DRAFT_30:
case QUIC_VERSION_MS_1:
return ((QUIC_LONG_HEADER_V1*)Packet)->Type != QUIC_0_RTT_PROTECTED;
default:
Expand Down
3 changes: 3 additions & 0 deletions src/core/packet_builder.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ QuicPacketBuilderPrepare(
case QUIC_VERSION_DRAFT_27:
case QUIC_VERSION_DRAFT_28:
case QUIC_VERSION_DRAFT_29:
case QUIC_VERSION_DRAFT_30:
case QUIC_VERSION_MS_1:
Builder->HeaderLength =
QuicPacketEncodeShortHeaderV1(
Expand All @@ -327,6 +328,7 @@ QuicPacketBuilderPrepare(
case QUIC_VERSION_DRAFT_27:
case QUIC_VERSION_DRAFT_28:
case QUIC_VERSION_DRAFT_29:
case QUIC_VERSION_DRAFT_30:
case QUIC_VERSION_MS_1:
default:
Builder->HeaderLength =
Expand Down Expand Up @@ -654,6 +656,7 @@ QuicPacketBuilderFinalize(
case QUIC_VERSION_DRAFT_27:
case QUIC_VERSION_DRAFT_28:
case QUIC_VERSION_DRAFT_29:
case QUIC_VERSION_DRAFT_30:
case QUIC_VERSION_MS_1:
default:
QuicVarIntEncode2Bytes(
Expand Down
7 changes: 5 additions & 2 deletions src/inc/quic_versions.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define QUIC_VERSION_DRAFT_27 0x1b0000ffU // IETF draft 27
#define QUIC_VERSION_DRAFT_28 0x1c0000ffU // IETF draft 28
#define QUIC_VERSION_DRAFT_29 0x1d0000ffU // IETF draft 29
#define QUIC_VERSION_DRAFT_30 0x1e0000ffU // IETF draft 30

//
// The QUIC version numbers, in host byte order.
Expand All @@ -30,6 +31,7 @@
#define QUIC_VERSION_DRAFT_27_H 0xff00001bU // IETF draft 27
#define QUIC_VERSION_DRAFT_28_H 0xff00001cU // IETF draft 28
#define QUIC_VERSION_DRAFT_29_H 0xff00001dU // IETF draft 29
#define QUIC_VERSION_DRAFT_30_H 0xff00001eU // IETF draft 30

//
// Represents a reserved version value; used to force version negotation.
Expand All @@ -40,8 +42,8 @@
//
// The latest QUIC version number.
//
#define QUIC_VERSION_LATEST QUIC_VERSION_DRAFT_29
#define QUIC_VERSION_LATEST_H QUIC_VERSION_DRAFT_29_H
#define QUIC_VERSION_LATEST QUIC_VERSION_DRAFT_30
#define QUIC_VERSION_LATEST_H QUIC_VERSION_DRAFT_30_H

inline
BOOLEAN
Expand All @@ -54,6 +56,7 @@ QuicIsVersionSupported(
case QUIC_VERSION_DRAFT_27:
case QUIC_VERSION_DRAFT_28:
case QUIC_VERSION_DRAFT_29:
case QUIC_VERSION_DRAFT_30:
case QUIC_VERSION_MS_1:
return TRUE;
default:
Expand Down
2 changes: 1 addition & 1 deletion src/tools/attack/attack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static uint32_t AttackType;
static const char* ServerName;
static const char* IpAddress;
static QUIC_ADDR ServerAddress;
static const char* Alpn = "h3-29";
static const char* Alpn = "h3-30";
static uint64_t TimeoutMs = ATTACK_TIMEOUT_DEFAULT_MS;
static uint32_t ThreadCount = ATTACK_THREADS_DEFAULT;

Expand Down
3 changes: 3 additions & 0 deletions src/tools/interop/interop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ QUIC_PRIVATE_TRANSPORT_PARAMETER RandomTransportParameter = {
};

const QUIC_BUFFER HandshakeAlpns[] = {
{ sizeof("hq-30") - 1, (uint8_t*)"hq-30" },
{ sizeof("h3-30") - 1, (uint8_t*)"h3-30" },
{ sizeof("hq-29") - 1, (uint8_t*)"hq-29" },
{ sizeof("h3-29") - 1, (uint8_t*)"h3-29" },
{ sizeof("hq-28") - 1, (uint8_t*)"hq-28" },
Expand All @@ -49,6 +51,7 @@ const QUIC_BUFFER HandshakeAlpns[] = {
};

const QUIC_BUFFER DatapathAlpns[] = {
{ sizeof("hq-30") - 1, (uint8_t*)"hq-30" },
{ sizeof("hq-29") - 1, (uint8_t*)"hq-29" },
{ sizeof("hq-28") - 1, (uint8_t*)"hq-28" },
{ sizeof("hq-27") - 1, (uint8_t*)"hq-27" },
Expand Down
1 change: 1 addition & 0 deletions src/tools/interopserver/InteropServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const char* RootFolderPath;
const char* UploadFolderPath;

const QUIC_BUFFER SupportedALPNs[] = {
{ sizeof("hq-30") - 1, (uint8_t*)"hq-30" },
{ sizeof("hq-29") - 1, (uint8_t*)"hq-29" },
{ sizeof("hq-28") - 1, (uint8_t*)"hq-28" },
{ sizeof("hq-27") - 1, (uint8_t*)"hq-27" },
Expand Down
1 change: 1 addition & 0 deletions src/tools/post/post.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ extern "C" void QuicTraceRundown(void) { }

#define ALPN_BUFFER(str) { sizeof(str) - 1, (uint8_t*)str }
const QUIC_BUFFER ALPNs[] = {
ALPN_BUFFER("hq-30"),
ALPN_BUFFER("hq-29"),
ALPN_BUFFER("hq-28"),
ALPN_BUFFER("hq-27")
Expand Down
4 changes: 2 additions & 2 deletions src/tools/reach/reach.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const char* ServerName = "localhost";
const char* ServerIp = nullptr;
QUIC_ADDR ServerAddress = {0};
std::vector<const char*> ALPNs(
{ "h3-27", "h3-28", "h3-29",
"hq-27", "hq-28", "hq-29",
{ "h3-27", "h3-28", "h3-29", "h3-30",
"hq-27", "hq-28", "hq-29", "hq-30",
"smb" });
const char* InputAlpn = nullptr;

Expand Down

0 comments on commit ef6f3b6

Please sign in to comment.