]> Cypherpunks repositories - gostls13.git/commit
crypto: panic on illegal input and output overlap
authorFilippo Valsorda <filippo@golang.org>
Thu, 26 Apr 2018 21:35:01 +0000 (17:35 -0400)
committerFilippo Valsorda <filippo@golang.org>
Tue, 19 Jun 2018 21:06:50 +0000 (21:06 +0000)
commit75d15a2082b9a9fcf30344062a6bfb8f4f51d79e
tree15eb2cdecdbd090e982adca12227679a76e36bf7
parentc6e455bb11d6da5c7a6334e0a7ea174586a83379
crypto: panic on illegal input and output overlap

Normalized all panic checks and added inexact aliasing panics across
Stream, Block, BlockMode and AEAD implementations.

Also, tweaked the aliasing docs of cipher.AEAD, as they did not account
for the append nature of the API.

Fixes #21624

Change-Id: I075c4415f59b3c06e3099bd9f76de6d12af086bf
Reviewed-on: https://go-review.googlesource.com/109697
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
21 files changed:
src/crypto/aes/aes_gcm.go
src/crypto/aes/cbc_s390x.go
src/crypto/aes/cipher.go
src/crypto/aes/cipher_amd64.go
src/crypto/aes/cipher_arm64.go
src/crypto/aes/cipher_ppc64le.go
src/crypto/aes/cipher_s390x.go
src/crypto/aes/ctr_s390x.go
src/crypto/aes/gcm_s390x.go
src/crypto/cipher/cbc.go
src/crypto/cipher/cfb.go
src/crypto/cipher/ctr.go
src/crypto/cipher/gcm.go
src/crypto/cipher/ofb.go
src/crypto/des/cipher.go
src/crypto/internal/subtle/aliasing.go [new file with mode: 0644]
src/crypto/internal/subtle/aliasing_appengine.go [new file with mode: 0644]
src/crypto/internal/subtle/aliasing_test.go [new file with mode: 0644]
src/crypto/rc4/rc4.go
src/crypto/rc4/rc4_asm.go
src/go/build/deps_test.go