Commit 7595a95
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 f494688 commit 7595a95
3 files changed
Lines changed: 336 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12810 | 12810 | | |
12811 | 12811 | | |
12812 | 12812 | | |
| 12813 | + | |
12813 | 12814 | | |
12814 | 12815 | | |
12815 | 12816 | | |
12816 | 12817 | | |
| 12818 | + | |
12817 | 12819 | | |
12818 | 12820 | | |
12819 | 12821 | | |
| |||
12852 | 12854 | | |
12853 | 12855 | | |
12854 | 12856 | | |
| 12857 | + | |
| 12858 | + | |
| 12859 | + | |
| 12860 | + | |
| 12861 | + | |
| 12862 | + | |
| 12863 | + | |
| 12864 | + | |
| 12865 | + | |
| 12866 | + | |
| 12867 | + | |
| 12868 | + | |
| 12869 | + | |
| 12870 | + | |
| 12871 | + | |
12855 | 12872 | | |
12856 | 12873 | | |
12857 | 12874 | | |
| |||
| 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