]> Cypherpunks repositories - gostls13.git/commit
crypto/{aes,cipher,rc4}: fix out of bounds write in stream ciphers
authorWei Congrui <crvv.mail@gmail.com>
Sat, 29 Jul 2017 10:23:00 +0000 (18:23 +0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 9 Aug 2017 04:17:51 +0000 (04:17 +0000)
commit254f8ea9eafd1678e178b3292a00b8aca517a864
tree6ef4982324ec50f47f823ff5301059c739fed1e4
parentbef0055a0ae8c79c9a008b17356521afda1bce85
crypto/{aes,cipher,rc4}: fix out of bounds write in stream ciphers

Functions XORKeyStream should panic if len(dst) < len(src), but it
write to dst before bounds checking. In asm routines and fastXORBytes,
this is an out of bounds write.

Fixes #21104

Change-Id: I354346cda8d63910f3bb619416ffd54cd0a04a0b
Reviewed-on: https://go-review.googlesource.com/52050
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/crypto/aes/ctr_s390x.go
src/crypto/cipher/xor.go
src/crypto/issue21104_test.go [new file with mode: 0644]
src/crypto/rc4/rc4_asm.go