76 lines
2.5 KiB
Go
76 lines
2.5 KiB
Go
|
// Copyright 2009 The Go Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a BSD-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
|
package etls
|
||
|
|
||
|
// ETLS handshake message types.
|
||
|
const (
|
||
|
typeHelloRequest uint8 = 0
|
||
|
typeClientHello uint8 = 1
|
||
|
typeServerHello uint8 = 2
|
||
|
typeNewSessionTicket uint8 = 4
|
||
|
typeCertificate uint8 = 11
|
||
|
typeServerKeyExchange uint8 = 12
|
||
|
typeCertificateRequest uint8 = 13
|
||
|
typeServerHelloDone uint8 = 14
|
||
|
typeCertificateVerify uint8 = 15
|
||
|
typeClientKeyExchange uint8 = 16
|
||
|
typeFinished uint8 = 20
|
||
|
typeCertificateStatus uint8 = 22
|
||
|
typeNextProtocol uint8 = 67 // Not IANA assigned
|
||
|
)
|
||
|
|
||
|
// ETLS compression types.
|
||
|
const (
|
||
|
compressionNone uint8 = 0
|
||
|
)
|
||
|
|
||
|
// ETLS extension numbers
|
||
|
const (
|
||
|
extensionServerName uint16 = 0
|
||
|
extensionStatusRequest uint16 = 5
|
||
|
extensionSupportedCurves uint16 = 10
|
||
|
extensionSupportedPoints uint16 = 11
|
||
|
extensionSignatureAlgorithms uint16 = 13
|
||
|
extensionALPN uint16 = 16
|
||
|
extensionSCT uint16 = 18 // https://tools.ietf.org/html/rfc6962#section-6
|
||
|
extensionSessionTicket uint16 = 35
|
||
|
extensionNextProtoNeg uint16 = 13172 // not IANA assigned
|
||
|
extensionRenegotiationInfo uint16 = 0xff01
|
||
|
)
|
||
|
|
||
|
// CurveID is the type of a ETLS identifier for an elliptic curve. See
|
||
|
// https://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8
|
||
|
type CurveID uint16
|
||
|
|
||
|
const (
|
||
|
CurveP256 CurveID = 23
|
||
|
CurveP384 CurveID = 24
|
||
|
CurveP521 CurveID = 25
|
||
|
X25519 CurveID = 29
|
||
|
)
|
||
|
|
||
|
// Certificate types (for certificateRequestMsg)
|
||
|
const (
|
||
|
certTypeRSASign = 1 // A certificate containing an RSA key
|
||
|
certTypeDSSSign = 2 // A certificate containing a DSA key
|
||
|
certTypeRSAFixedDH = 3 // A certificate containing a static DH key
|
||
|
certTypeDSSFixedDH = 4 // A certificate containing a static DH key
|
||
|
|
||
|
// See RFC 4492 sections 3 and 5.5.
|
||
|
certTypeECDSASign = 64 // A certificate containing an ECDSA-capable public key, signed with ECDSA.
|
||
|
certTypeRSAFixedECDH = 65 // A certificate containing an ECDH-capable public key, signed with RSA.
|
||
|
certTypeECDSAFixedECDH = 66 // A certificate containing an ECDH-capable public key, signed with ECDSA.
|
||
|
)
|
||
|
|
||
|
// SignatureScheme identifies a signature algorithm supported by ETLS. See
|
||
|
// https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.3.
|
||
|
type SignatureScheme uint16
|
||
|
type Extension uint16
|
||
|
|
||
|
// ETLS signaling cipher suite values
|
||
|
const (
|
||
|
scsvRenegotiation uint16 = 0x00ff
|
||
|
)
|