use the CRYPTO_BUFFER_EXCEEDED error for crypto stream overflows

This commit is contained in:
Marten Seemann
2019-11-23 11:48:11 +07:00
parent 92b898e811
commit 50e7d69865
3 changed files with 6 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ const (
VersionNegotiationError ErrorCode = 0x9
ProtocolViolation ErrorCode = 0xa
InvalidMigration ErrorCode = 0xc
CryptoBufferExceeded ErrorCode = 0xd
)
func (e ErrorCode) isCryptoError() bool {
@@ -71,6 +72,8 @@ func (e ErrorCode) String() string {
return "PROTOCOL_VIOLATION"
case InvalidMigration:
return "INVALID_MIGRATION"
case CryptoBufferExceeded:
return "CRYPTO_BUFFER_EXCEEDED"
default:
if e.isCryptoError() {
return "CRYPTO_ERROR"