Commit a8d5f33
committed
internal: reject inbound packets that are not block aligned
- DoReceive() validates the peeked packet_length in
PROCESS_PACKET_LENGTH: UINT32_SZ plus curSz for non-AEAD, curSz
alone for AEAD, against peerBlockSz floored at MIN_BLOCK_SZ. A
non-zero remainder sets ssh->error to WS_BUFFER_E and returns
WS_FATAL_ERROR.
- BuildMacTestPacketPrefix() in unit.c takes padLen from the caller
and pads to a block-aligned total; test_DoReceive_VerifyMacFailure,
test_DoReceive_AeadTagFailure, and
test_DoReceive_RejectsShortPadding follow.
- BuildPacket() in regress.c pads to 16.
- test_DoReceive_RejectsMisalignedPacket,
test_DoReceive_RejectsMisalignedCtr, and
test_DoReceive_RejectsMisalignedAead cover the cleartext, AES-CTR,
and AES-GCM paths.
Issue: F-88341 parent 581053b commit a8d5f33
3 files changed
Lines changed: 336 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12813 | 12813 | | |
12814 | 12814 | | |
12815 | 12815 | | |
| 12816 | + | |
12816 | 12817 | | |
12817 | 12818 | | |
12818 | 12819 | | |
12819 | 12820 | | |
| 12821 | + | |
12820 | 12822 | | |
12821 | 12823 | | |
12822 | 12824 | | |
| |||
12855 | 12857 | | |
12856 | 12858 | | |
12857 | 12859 | | |
| 12860 | + | |
| 12861 | + | |
| 12862 | + | |
| 12863 | + | |
| 12864 | + | |
| 12865 | + | |
| 12866 | + | |
| 12867 | + | |
| 12868 | + | |
| 12869 | + | |
| 12870 | + | |
| 12871 | + | |
| 12872 | + | |
| 12873 | + | |
| 12874 | + | |
12858 | 12875 | | |
12859 | 12876 | | |
12860 | 12877 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
| 110 | + | |
112 | 111 | | |
113 | 112 | | |
114 | | - | |
| 113 | + | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
| |||
0 commit comments