go/src
Filippo Valsorda 05a85f493c crypto/tls: remove a forgotten note to future self
Now, this is embarrassing. While preparing CL 142818, I noticed a
possible vulnerability in the existing code which I was rewriting. I
took a note to go back and assess if it was indeed an issue, and in case
start the security release process. The note unintentionally slipped
into the commit. Fortunately, there was no vulnerability.

What caught my eye was that I had fixed the calculation of the minimum
encrypted payload length from

    roundUp(explicitIVLen+macSize+1, blockSize)

to (using the same variable names)

    explicitIVLen + roundUp(macSize+1, blockSize)

The explicit nonce sits outside of the encrypted payload, so it should
not be part of the value rounded up to the CBC block size.

You can see that for some values of the above, the old result could be
lower than the correct value. An unexpectedly short payload might cause
a panic during decryption (a DoS vulnerability) or even more serious
issues due to the constant time code that follows it (see for example
Yet Another Padding Oracle in OpenSSL CBC Ciphersuites [1]).

In practice, explicitIVLen is either zero or equal to blockSize, so it
does not change the amount of rounding up necessary and the two
formulations happen to be identical. Nothing to see here.

It looked more suspicious than it is in part due to the fact that the
explicitIVLen definition moved farther into hc.explicitNonceLen() and
changed name from IV (which suggests a block length) to nonce (which
doesn't necessarily). But anyway it was never meant to surface or be
noted, except it slipped, so here we are for a boring explanation.

[1] https://blog.cloudflare.com/yet-another-padding-oracle-in-openssl-cbc-ciphersuites/

Change-Id: I365560dfe006513200fa877551ce7afec9115fdf
Reviewed-on: https://go-review.googlesource.com/c/147637
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-11-08 06:13:12 +00:00
..
archive all: fix a bunch of misspellings 2018-10-08 03:12:03 +00:00
bufio bufio: suggest io.ReadFull at (*Reader).Read 2018-10-30 13:03:46 +00:00
builtin builtin: document when len and cap are constant 2018-09-18 21:52:11 +00:00
bytes bytes, strings: fix Reader.UnreadRune returning without error on a zero Reader 2018-10-29 20:07:25 +00:00
cmd cmd/go: add goversion environment variable to testing script language 2018-11-08 01:56:34 +00:00
compress all: fix a bunch of misspellings 2018-10-06 15:40:03 +00:00
container container/list: combining insert and remove operations while moving elements within a list. 2018-10-26 20:47:01 +00:00
context context: avoid duplicate removeChild 2018-10-03 15:26:10 +00:00
crypto crypto/tls: remove a forgotten note to future self 2018-11-08 06:13:12 +00:00
database/sql all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
debug all: skip unsupported tests on AIX 2018-11-02 16:12:08 +00:00
encoding all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
errors
expvar expvar: add Map.Delete 2018-10-04 01:16:52 +00:00
flag flag: return a consistent parse error if the flag value is invalid 2018-10-19 03:48:38 +00:00
fmt fmt: print maps in key-sorted order 2018-10-18 21:12:24 +00:00
go go/types: avoid certain problems with recursive alias type declarations 2018-11-07 18:25:08 +00:00
hash hash/crc64: use t.Fatalf in TestGolden 2018-10-25 06:32:12 +00:00
html all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
image jpeg: simplify 'x = x op ...' to 'x op= ...' 2018-10-13 11:18:56 +00:00
index/suffixarray
internal syscall: implement syscalls on Darwin using libSystem 2018-11-07 20:27:01 +00:00
io io: export StringWriter 2018-10-03 20:13:35 +00:00
log log: add Logger.Writer method 2018-10-25 23:23:57 +00:00
math all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
mime mime: add AIX operating system 2018-10-10 15:19:38 +00:00
net net/http: update bundled SOCKS client 2018-11-06 06:57:39 +00:00
os all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
path all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
plugin plugin: remove unused func 2018-08-22 16:29:03 +00:00
reflect reflect: fix StructOf panics from too many methods in embedded fields 2018-11-06 13:52:29 +00:00
regexp all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
runtime syscall: implement syscalls on Darwin using libSystem 2018-11-07 20:27:01 +00:00
sort
strconv strconv: add comment explaining bounded shift in formatBits 2018-10-15 21:45:52 +00:00
strings strings: lower running time of TestCompareStrings 2018-11-04 18:55:55 +00:00
sync all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
syscall syscall: move uses of Syscall to libSystem on darwin 2018-11-08 03:01:54 +00:00
testdata Revert "compress: move benchmark text from src/testdata to src/compress/testdata" 2018-10-01 16:16:21 +00:00
testing testing: implement -benchtime=100x 2018-10-12 17:48:31 +00:00
text text/template/parse: simplify Tree.pipeline 2018-10-29 12:20:11 +00:00
time time: document that a marshaled time does not include location name 2018-11-08 05:41:45 +00:00
unicode
unsafe unsafe: document that Alignof, Offsetof, and Sizeof return a constant 2018-10-11 02:32:20 +00:00
vendor/golang_org/x crypto/tls: implement TLS 1.3 cryptographic computations 2018-11-02 21:54:52 +00:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash
make.bat src/make.bat: add missing go.exe extension 2018-08-25 22:42:46 +00:00
make.rc
naclmake.bash all: use consistent shebang line across all shell scripts 2018-08-22 16:41:11 +00:00
nacltest.bash all: use consistent shebang line across all shell scripts 2018-08-22 16:41:11 +00:00
race.bash
race.bat cmd/dist: fix compilation on windows 2018-08-25 22:39:17 +00:00
run.bash
run.bat
run.rc