@@ -1694,12 +1694,8 @@ QuicConnOnQuicVersionSet(
1694
1694
Connection -> Stats .QuicVersion );
1695
1695
1696
1696
switch (Connection -> Stats .QuicVersion ) {
1697
- case QUIC_VERSION_DRAFT_27 :
1698
- case QUIC_VERSION_DRAFT_28 :
1697
+ case QUIC_VERSION_1 :
1699
1698
case QUIC_VERSION_DRAFT_29 :
1700
- case QUIC_VERSION_DRAFT_30 :
1701
- case QUIC_VERSION_DRAFT_31 :
1702
- case QUIC_VERSION_DRAFT_32 :
1703
1699
case QUIC_VERSION_MS_1 :
1704
1700
default :
1705
1701
Connection -> State .HeaderProtectionEnabled = TRUE;
@@ -1888,6 +1884,13 @@ QuicConnStart(
1888
1884
return Status ;
1889
1885
}
1890
1886
1887
+ _IRQL_requires_max_ (PASSIVE_LEVEL )
1888
+ QUIC_STATUS
1889
+ QuicConnGenerateLocalTransportParameters (
1890
+ _In_ QUIC_CONNECTION * Connection ,
1891
+ _Out_ QUIC_TRANSPORT_PARAMETERS * LocalTP
1892
+ );
1893
+
1891
1894
_IRQL_requires_max_ (PASSIVE_LEVEL )
1892
1895
void
1893
1896
QuicConnRestart (
@@ -1921,8 +1924,30 @@ QuicConnRestart(
1921
1924
QuicCongestionControlReset (& Connection -> CongestionControl );
1922
1925
QuicSendReset (& Connection -> Send );
1923
1926
QuicLossDetectionReset (& Connection -> LossDetection );
1924
- QuicCryptoReset (& Connection -> Crypto , CompleteReset );
1927
+
1928
+ if (CompleteReset ) {
1929
+ QUIC_DBG_ASSERT (Connection -> Configuration != NULL );
1930
+
1931
+ QUIC_TRANSPORT_PARAMETERS LocalTP = { 0 };
1932
+ QUIC_STATUS Status =
1933
+ QuicConnGenerateLocalTransportParameters (Connection , & LocalTP );
1934
+ QUIC_FRE_ASSERT (QUIC_SUCCEEDED (Status )); // Can't fail since it passed already.
1935
+ UNREFERENCED_PARAMETER (Status );
1936
+
1937
+ Status =
1938
+ QuicCryptoInitializeTls (
1939
+ & Connection -> Crypto ,
1940
+ Connection -> Configuration -> SecurityConfig ,
1941
+ & LocalTP );
1942
+ if (QUIC_FAILED (Status )) {
1943
+ QuicConnFatalError (Connection , Status , NULL );
1944
+ }
1945
+
1946
+ } else {
1947
+ QuicCryptoReset (& Connection -> Crypto );
1948
+ }
1925
1949
}
1950
+
1926
1951
_IRQL_requires_max_ (PASSIVE_LEVEL )
1927
1952
QUIC_STATUS
1928
1953
QuicConnSendResumptionTicket (
@@ -2164,14 +2189,12 @@ QuicConnGenerateLocalTransportParameters(
2164
2189
LocalTP -> AckDelayExponent = Connection -> AckDelayExponent ;
2165
2190
}
2166
2191
2167
- if (Connection -> Stats .QuicVersion != QUIC_VERSION_DRAFT_27 ) {
2168
- LocalTP -> Flags |= QUIC_TP_FLAG_INITIAL_SOURCE_CONNECTION_ID ;
2169
- LocalTP -> InitialSourceConnectionIDLength = SourceCid -> CID .Length ;
2170
- QuicCopyMemory (
2171
- LocalTP -> InitialSourceConnectionID ,
2172
- SourceCid -> CID .Data ,
2173
- SourceCid -> CID .Length );
2174
- }
2192
+ LocalTP -> Flags |= QUIC_TP_FLAG_INITIAL_SOURCE_CONNECTION_ID ;
2193
+ LocalTP -> InitialSourceConnectionIDLength = SourceCid -> CID .Length ;
2194
+ QuicCopyMemory (
2195
+ LocalTP -> InitialSourceConnectionID ,
2196
+ SourceCid -> CID .Data ,
2197
+ SourceCid -> CID .Length );
2175
2198
2176
2199
if (Connection -> Settings .DatagramReceiveEnabled ) {
2177
2200
LocalTP -> Flags |= QUIC_TP_FLAG_MAX_DATAGRAM_FRAME_SIZE ;
@@ -2227,8 +2250,7 @@ QuicConnGenerateLocalTransportParameters(
2227
2250
QUIC_FREE (Connection -> OrigDestCID , QUIC_POOL_CID );
2228
2251
Connection -> OrigDestCID = NULL ;
2229
2252
2230
- if (Connection -> State .HandshakeUsedRetryPacket &&
2231
- Connection -> Stats .QuicVersion != QUIC_VERSION_DRAFT_27 ) {
2253
+ if (Connection -> State .HandshakeUsedRetryPacket ) {
2232
2254
QUIC_DBG_ASSERT (SourceCid -> Link .Next != NULL );
2233
2255
const QUIC_CID_HASH_ENTRY * PrevSourceCid =
2234
2256
QUIC_CONTAINING_RECORD (
@@ -2369,68 +2391,6 @@ QuicConnSetConfiguration(
2369
2391
return Status ;
2370
2392
}
2371
2393
2372
- BOOLEAN
2373
- QuicConnValidateTransportParameterDraft27CIDs (
2374
- _In_ QUIC_CONNECTION * Connection
2375
- )
2376
- {
2377
- if (Connection -> State .HandshakeUsedRetryPacket ) {
2378
- QUIC_DBG_ASSERT (!QuicConnIsServer (Connection ));
2379
- QUIC_DBG_ASSERT (Connection -> OrigDestCID != NULL );
2380
- //
2381
- // If we received a Retry packet during the handshake, we (the client)
2382
- // must validate that the server knew the original connection ID we sent,
2383
- // so that we can be sure that no middle box injected the Retry packet.
2384
- //
2385
- if (!(Connection -> PeerTransportParams .Flags & QUIC_TP_FLAG_ORIGINAL_DESTINATION_CONNECTION_ID )) {
2386
- QuicTraceEvent (
2387
- ConnError ,
2388
- "[conn][%p] ERROR, %s." ,
2389
- Connection ,
2390
- "Peer didn't provide the original destination CID in TP" );
2391
- return FALSE;
2392
- } else if (Connection -> PeerTransportParams .OriginalDestinationConnectionIDLength != Connection -> OrigDestCID -> Length ) {
2393
- QuicTraceEvent (
2394
- ConnError ,
2395
- "[conn][%p] ERROR, %s." ,
2396
- Connection ,
2397
- "Peer provided incorrect length of original destination CID in TP" );
2398
- return FALSE;
2399
- } else if (
2400
- memcmp (
2401
- Connection -> PeerTransportParams .OriginalDestinationConnectionID ,
2402
- Connection -> OrigDestCID -> Data ,
2403
- Connection -> OrigDestCID -> Length ) != 0 ) {
2404
- QuicTraceEvent (
2405
- ConnError ,
2406
- "[conn][%p] ERROR, %s." ,
2407
- Connection ,
2408
- "Peer provided incorrect original destination CID in TP" );
2409
- return FALSE;
2410
- } else {
2411
- QUIC_FREE (Connection -> OrigDestCID , QUIC_POOL_CID );
2412
- Connection -> OrigDestCID = NULL ;
2413
- }
2414
-
2415
- } else if (!QuicConnIsServer (Connection )) {
2416
- //
2417
- // Per spec, the client must validate no original destination CID TP
2418
- // was sent if no Retry occurred. No need to validate cached values, as
2419
- // they don't apply to the current connection attempt.
2420
- //
2421
- if (!!(Connection -> PeerTransportParams .Flags & QUIC_TP_FLAG_ORIGINAL_DESTINATION_CONNECTION_ID )) {
2422
- QuicTraceEvent (
2423
- ConnError ,
2424
- "[conn][%p] ERROR, %s." ,
2425
- Connection ,
2426
- "Peer provided the original destination CID in TP when no Retry occurred" );
2427
- return FALSE;
2428
- }
2429
- }
2430
-
2431
- return TRUE;
2432
- }
2433
-
2434
2394
BOOLEAN
2435
2395
QuicConnValidateTransportParameterCIDs (
2436
2396
_In_ QUIC_CONNECTION * Connection
@@ -2556,17 +2516,10 @@ QuicConnProcessPeerTransportParameters(
2556
2516
}
2557
2517
2558
2518
//
2559
- // Version draft-28 and later fully validate all exchanged connection IDs.
2560
- // Version draft-27 only validates in the Retry scenario.
2519
+ // Fully validate all exchanged connection IDs.
2561
2520
//
2562
- if (Connection -> Stats .QuicVersion == QUIC_VERSION_DRAFT_27 ) {
2563
- if (!QuicConnValidateTransportParameterDraft27CIDs (Connection )) {
2564
- goto Error ;
2565
- }
2566
- } else {
2567
- if (!QuicConnValidateTransportParameterCIDs (Connection )) {
2568
- goto Error ;
2569
- }
2521
+ if (!QuicConnValidateTransportParameterCIDs (Connection )) {
2522
+ goto Error ;
2570
2523
}
2571
2524
}
2572
2525
@@ -2809,16 +2762,20 @@ QuicConnRecvVerNeg(
2809
2762
"Received Version Negotation:" );
2810
2763
for (uint16_t i = 0 ; i < ServerVersionListLength ; i ++ ) {
2811
2764
2765
+ uint32_t ServerVersion ;
2766
+ QuicCopyMemory (& ServerVersion , & ServerVersionList [i ], sizeof (ServerVersion ));
2767
+
2812
2768
QuicTraceLogConnVerbose (
2813
2769
VerNegItem ,
2814
2770
Connection ,
2815
- " Ver[%d]: 0x%x" , i ,
2816
- QuicByteSwapUint32 (ServerVersionList [i ]));
2771
+ " Ver[%d]: 0x%x" ,
2772
+ i ,
2773
+ QuicByteSwapUint32 (ServerVersion ));
2817
2774
2818
2775
//
2819
2776
// Check to see if this is the current version.
2820
2777
//
2821
- if (ServerVersionList [ i ] == Connection -> Stats .QuicVersion ) {
2778
+ if (ServerVersion == Connection -> Stats .QuicVersion ) {
2822
2779
QuicPacketLogDrop (Connection , Packet , "Version Negotation that includes the current version" );
2823
2780
return ;
2824
2781
}
@@ -2827,9 +2784,8 @@ QuicConnRecvVerNeg(
2827
2784
// Check to see if this is supported, if we haven't already found a
2828
2785
// supported version.
2829
2786
//
2830
- if (SupportedVersion == 0 &&
2831
- QuicIsVersionSupported (ServerVersionList [i ])) {
2832
- SupportedVersion = ServerVersionList [i ];
2787
+ if (SupportedVersion == 0 && QuicIsVersionSupported (ServerVersion )) {
2788
+ SupportedVersion = ServerVersion ;
2833
2789
}
2834
2790
}
2835
2791
@@ -3203,9 +3159,7 @@ QuicConnRecvHeader(
3203
3159
3204
3160
QuicPathSetValid (Connection , Path , QUIC_PATH_VALID_INITIAL_TOKEN );
3205
3161
3206
- } else if (
3207
- Connection -> Stats .QuicVersion != QUIC_VERSION_DRAFT_27 &&
3208
- Connection -> OrigDestCID == NULL ) {
3162
+ } else if (Connection -> OrigDestCID == NULL ) {
3209
3163
3210
3164
Connection -> OrigDestCID =
3211
3165
QUIC_ALLOC_NONPAGED (
0 commit comments