diff options
author | Yawning Angel <yawning@schwanenlied.me> | 2014-05-24 05:06:34 +0000 |
---|---|---|
committer | Yawning Angel <yawning@schwanenlied.me> | 2014-05-24 05:06:34 +0000 |
commit | 8cd2e1f0f9335221fbad892efdbb5e02e787a1e8 (patch) | |
tree | 47863b757a54e7030ab533e69868400e185ce4a3 /framing/framing_test.go | |
parent | b3f0f51775ae2e19c62c70e15f77ef991ad4bb49 (diff) |
Randomize length when the decoder receives an out-of-bound value.
This makes the length error and MAC error indistinguishable to an
external attacker.
Diffstat (limited to 'framing/framing_test.go')
-rw-r--r-- | framing/framing_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/framing/framing_test.go b/framing/framing_test.go index 08f5f17..7df0e28 100644 --- a/framing/framing_test.go +++ b/framing/framing_test.go @@ -86,7 +86,7 @@ func TestEncoder_Encode_Oversize(t *testing.T) { encoder := newEncoder(t) var frame [MaximumSegmentLength]byte - var buf [MaximumFramePayloadLength+1]byte + var buf [MaximumFramePayloadLength + 1]byte _, _ = rand.Read(buf[:]) // YOLO _, err := encoder.Encode(frame[:], buf[:]) if _, ok := err.(InvalidPayloadLengthError); !ok { |