crypto/tls: add missing alert values

Fixes #35911

Change-Id: I093d25aa169963769b51c37d2481bce71bd0fd2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/226858
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
This commit is contained in:
Katie Hockman 2020-04-01 13:49:57 -04:00
parent f28969082e
commit 321fc90102

120
alert.go
View file

@ -15,63 +15,75 @@ const (
) )
const ( const (
alertCloseNotify alert = 0 alertCloseNotify alert = 0
alertUnexpectedMessage alert = 10 alertUnexpectedMessage alert = 10
alertBadRecordMAC alert = 20 alertBadRecordMAC alert = 20
alertDecryptionFailed alert = 21 alertDecryptionFailed alert = 21
alertRecordOverflow alert = 22 alertRecordOverflow alert = 22
alertDecompressionFailure alert = 30 alertDecompressionFailure alert = 30
alertHandshakeFailure alert = 40 alertHandshakeFailure alert = 40
alertBadCertificate alert = 42 alertBadCertificate alert = 42
alertUnsupportedCertificate alert = 43 alertUnsupportedCertificate alert = 43
alertCertificateRevoked alert = 44 alertCertificateRevoked alert = 44
alertCertificateExpired alert = 45 alertCertificateExpired alert = 45
alertCertificateUnknown alert = 46 alertCertificateUnknown alert = 46
alertIllegalParameter alert = 47 alertIllegalParameter alert = 47
alertUnknownCA alert = 48 alertUnknownCA alert = 48
alertAccessDenied alert = 49 alertAccessDenied alert = 49
alertDecodeError alert = 50 alertDecodeError alert = 50
alertDecryptError alert = 51 alertDecryptError alert = 51
alertProtocolVersion alert = 70 alertExportRestriction alert = 60
alertInsufficientSecurity alert = 71 alertProtocolVersion alert = 70
alertInternalError alert = 80 alertInsufficientSecurity alert = 71
alertInappropriateFallback alert = 86 alertInternalError alert = 80
alertUserCanceled alert = 90 alertInappropriateFallback alert = 86
alertNoRenegotiation alert = 100 alertUserCanceled alert = 90
alertMissingExtension alert = 109 alertNoRenegotiation alert = 100
alertUnsupportedExtension alert = 110 alertMissingExtension alert = 109
alertUnrecognizedName alert = 112 alertUnsupportedExtension alert = 110
alertNoApplicationProtocol alert = 120 alertCertificateUnobtainable alert = 111
alertUnrecognizedName alert = 112
alertBadCertificateStatusResponse alert = 113
alertBadCertificateHashValue alert = 114
alertUnknownPSKIdentity alert = 115
alertCertificateRequired alert = 116
alertNoApplicationProtocol alert = 120
) )
var alertText = map[alert]string{ var alertText = map[alert]string{
alertCloseNotify: "close notify", alertCloseNotify: "close notify",
alertUnexpectedMessage: "unexpected message", alertUnexpectedMessage: "unexpected message",
alertBadRecordMAC: "bad record MAC", alertBadRecordMAC: "bad record MAC",
alertDecryptionFailed: "decryption failed", alertDecryptionFailed: "decryption failed",
alertRecordOverflow: "record overflow", alertRecordOverflow: "record overflow",
alertDecompressionFailure: "decompression failure", alertDecompressionFailure: "decompression failure",
alertHandshakeFailure: "handshake failure", alertHandshakeFailure: "handshake failure",
alertBadCertificate: "bad certificate", alertBadCertificate: "bad certificate",
alertUnsupportedCertificate: "unsupported certificate", alertUnsupportedCertificate: "unsupported certificate",
alertCertificateRevoked: "revoked certificate", alertCertificateRevoked: "revoked certificate",
alertCertificateExpired: "expired certificate", alertCertificateExpired: "expired certificate",
alertCertificateUnknown: "unknown certificate", alertCertificateUnknown: "unknown certificate",
alertIllegalParameter: "illegal parameter", alertIllegalParameter: "illegal parameter",
alertUnknownCA: "unknown certificate authority", alertUnknownCA: "unknown certificate authority",
alertAccessDenied: "access denied", alertAccessDenied: "access denied",
alertDecodeError: "error decoding message", alertDecodeError: "error decoding message",
alertDecryptError: "error decrypting message", alertDecryptError: "error decrypting message",
alertProtocolVersion: "protocol version not supported", alertExportRestriction: "export restriction",
alertInsufficientSecurity: "insufficient security level", alertProtocolVersion: "protocol version not supported",
alertInternalError: "internal error", alertInsufficientSecurity: "insufficient security level",
alertInappropriateFallback: "inappropriate fallback", alertInternalError: "internal error",
alertUserCanceled: "user canceled", alertInappropriateFallback: "inappropriate fallback",
alertNoRenegotiation: "no renegotiation", alertUserCanceled: "user canceled",
alertMissingExtension: "missing extension", alertNoRenegotiation: "no renegotiation",
alertUnsupportedExtension: "unsupported extension", alertMissingExtension: "missing extension",
alertUnrecognizedName: "unrecognized name", alertUnsupportedExtension: "unsupported extension",
alertNoApplicationProtocol: "no application protocol", alertCertificateUnobtainable: "certificate unobtainable",
alertUnrecognizedName: "unrecognized name",
alertBadCertificateStatusResponse: "bad certificate status response",
alertBadCertificateHashValue: "bad certificate hash value",
alertUnknownPSKIdentity: "unknown PSK identity",
alertCertificateRequired: "certificate required",
alertNoApplicationProtocol: "no application protocol",
} }
func (e alert) String() string { func (e alert) String() string {