mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-09 10:00:57 +03:00
Implement handshake done and cipher dropping.
Summary: This implements the handshake done signal and also cipher dropping. Reviewed By: yangchi Differential Revision: D19584922 fbshipit-source-id: a98bec8f1076393b051ff65a2d8aae7d572b42f5
This commit is contained in:
committed by
Facebook Github Bot
parent
49d262c84c
commit
472e40a902
@@ -125,14 +125,11 @@ CodecResult QuicReadCodec::parseLongHeaderPacket(
|
||||
auto protectionType = longHeader.getProtectionType();
|
||||
switch (protectionType) {
|
||||
case ProtectionType::Initial:
|
||||
if (handshakeDoneTime_) {
|
||||
auto timeBetween = Clock::now() - *handshakeDoneTime_;
|
||||
if (timeBetween > kTimeToRetainZeroRttKeys) {
|
||||
VLOG(4) << nodeToString(nodeType_)
|
||||
<< " dropping initial packet for exceeding key timeout"
|
||||
<< connIdToHex();
|
||||
return CodecResult(Nothing());
|
||||
}
|
||||
if (!initialHeaderCipher_) {
|
||||
VLOG(4) << nodeToString(nodeType_)
|
||||
<< " dropping initial packet after initial keys dropped"
|
||||
<< connIdToHex();
|
||||
return CodecResult(Nothing());
|
||||
}
|
||||
headerCipher = initialHeaderCipher_.get();
|
||||
cipher = initialReadCipher_.get();
|
||||
@@ -143,6 +140,7 @@ CodecResult QuicReadCodec::parseLongHeaderPacket(
|
||||
break;
|
||||
case ProtectionType::ZeroRtt:
|
||||
if (handshakeDoneTime_) {
|
||||
// TODO actually drop the 0-rtt keys in addition to dropping packets.
|
||||
auto timeBetween = Clock::now() - *handshakeDoneTime_;
|
||||
if (timeBetween > kTimeToRetainZeroRttKeys) {
|
||||
VLOG(4) << nodeToString(nodeType_)
|
||||
|
||||
Reference in New Issue
Block a user