]> Cypherpunks repositories - gostls13.git/commit
[dev.boringcrypto] crypto/aes: panic on invalid dst, src overlap
authorRuss Cox <rsc@golang.org>
Thu, 14 Sep 2017 03:10:49 +0000 (23:10 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 18 Sep 2017 00:32:06 +0000 (00:32 +0000)
commit89ba9e3541b12ce4e6e36682e5a0a534e0c0cd56
treed87edc64ed8d6159910d4844faaa5b271a5e2f37
parenta929f3a04dc677703b46c8a908b86432b6b9b52b
[dev.boringcrypto] crypto/aes: panic on invalid dst, src overlap

I've now debugged multiple mysterious "inability to communicate"
bugs that manifest as a silent unexplained authentication failure but are
really crypto.AEAD.Open being invoked with badly aligned buffers.
In #21624 I suggested using a panic as the consequence of bad alignment,
so that this kind of failure is loud and clearly different from, say, a
corrupted or invalid message signature. Adding the panic here made
my failure very easy to track down, once I realized that was the problem.
I don't want to debug another one of these.

Also using this CL as an experiment to get data about the impact of
maybe applying this change more broadly in the master branch.

Change-Id: Id2e2d8e980439f8acacac985fc2674f7c96c5032
Reviewed-on: https://go-review.googlesource.com/63915
Reviewed-by: Adam Langley <agl@golang.org>
src/crypto/internal/boring/aes.go