]> Cypherpunks.ru repositories - gostls13.git/commit
crypto/tls: limit number of consecutive warning alerts
authorfilewalkwithme <maiconscosta@gmail.com>
Fri, 3 Nov 2017 02:45:04 +0000 (03:45 +0100)
committerAdam Langley <agl@golang.org>
Wed, 8 Nov 2017 23:18:52 +0000 (23:18 +0000)
commitd8ee5d11e5d13398671346c8c4dff824754a2144
treea08fed07cc60783d8c784283a84a81624269065e
parenta042221cdb9eb8b11240311057ff274e26b53165
crypto/tls: limit number of consecutive warning alerts

In the current implementation, it is possible for a client to
continuously send warning alerts, which are just dropped on the floor
inside readRecord.

This can enable scenarios in where someone can try to continuously
send warning alerts to the server just to keep it busy.

This CL implements a simple counter that triggers an error if
we hit the warning alert limit.

Fixes #22543

Change-Id: Ief0ca10308cf5a4dea21a5a67d3e8f6501912da6
Reviewed-on: https://go-review.googlesource.com/75750
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/crypto/tls/common.go
src/crypto/tls/conn.go
src/crypto/tls/tls_test.go