Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/core/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -4086,10 +4086,18 @@ QuicConnRecvHeader(
// don't actually know the length of the packet number so we assume maximum
// (per spec) and start sampling 4 bytes after the start of the packet number.
//
CxPlatCopyMemory(
Cipher,
Packet->AvailBuffer + Packet->HeaderLength + 4,
CXPLAT_HP_SAMPLE_LENGTH);
if (Packet->Encrypted && Connection->State.HeaderProtectionEnabled) {
CxPlatCopyMemory(
Cipher,
Packet->AvailBuffer + Packet->HeaderLength + 4,
CXPLAT_HP_SAMPLE_LENGTH);
} else {
//
// For unencrypted short header packets, no header protection mask will be computed,
// so avoid reading an HP sample that may extend beyond the packet.
//
CxPlatZeroMemory(Cipher, CXPLAT_HP_SAMPLE_LENGTH);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When do we expect to see unencrypted short header packets? When a connection negotiates the no-encryption custom transport parameter?

}

return TRUE;
}
Expand Down
Loading