1package dtls
2
3import "errors"
4
5// Typed errors
6var (
7	ErrConnClosed = errors.New("dtls: conn is closed")
8
9	errBufferTooSmall                    = errors.New("dtls: buffer is too small")
10	errClientCertificateRequired         = errors.New("dtls: server required client verification, but got none")
11	errClientCertificateNotVerified      = errors.New("dtls: client sent certificate but did not verify it")
12	errCertificateVerifyNoCertificate    = errors.New("dtls: client sent certificate verify but we have no certificate to verify")
13	errCipherSuiteNoIntersection         = errors.New("dtls: Client+Server do not support any shared cipher suites")
14	errCipherSuiteUnset                  = errors.New("dtls: server hello can not be created without a cipher suite")
15	errCompressionMethodUnset            = errors.New("dtls: server hello can not be created without a compression method")
16	errContextUnsupported                = errors.New("dtls: context is not supported for ExportKeyingMaterial")
17	errCookieMismatch                    = errors.New("dtls: Client+Server cookie does not match")
18	errCookieTooLong                     = errors.New("dtls: cookie must not be longer then 255 bytes")
19	errDTLSPacketInvalidLength           = errors.New("dtls: packet is too short")
20	errHandshakeInProgress               = errors.New("dtls: Handshake is in progress")
21	errHandshakeMessageUnset             = errors.New("dtls: handshake message unset, unable to marshal")
22	errInvalidCipherSpec                 = errors.New("dtls: cipher spec invalid")
23	errInvalidCipherSuite                = errors.New("dtls: invalid or unknown cipher suite")
24	errInvalidCompressionMethod          = errors.New("dtls: invalid or unknown compression method")
25	errInvalidContentType                = errors.New("dtls: invalid content type")
26	errInvalidECDSASignature             = errors.New("dtls: ECDSA signature contained zero or negative values")
27	errInvalidEllipticCurveType          = errors.New("dtls: invalid or unknown elliptic curve type")
28	errInvalidExtensionType              = errors.New("dtls: invalid extension type")
29	errInvalidHashAlgorithm              = errors.New("dtls: invalid hash algorithm")
30	errInvalidMAC                        = errors.New("dtls: invalid mac")
31	errInvalidNamedCurve                 = errors.New("dtls: invalid named curve")
32	errInvalidPrivateKey                 = errors.New("dtls: invalid private key type")
33	errInvalidSignatureAlgorithm         = errors.New("dtls: invalid signature algorithm")
34	errKeySignatureGenerateUnimplemented = errors.New("dtls: Unable to generate key signature, unimplemented")
35	errKeySignatureMismatch              = errors.New("dtls: Expected and actual key signature do not match")
36	errKeySignatureVerifyUnimplemented   = errors.New("dtls: Unable to verify key signature, unimplemented")
37	errLengthMismatch                    = errors.New("dtls: data length and declared length do not match")
38	errNilNextConn                       = errors.New("dtls: Conn can not be created with a nil nextConn")
39	errNotEnoughRoomForNonce             = errors.New("dtls: Buffer not long enough to contain nonce")
40	errNotImplemented                    = errors.New("dtls: feature has not been implemented yet")
41	errReservedExportKeyingMaterial      = errors.New("dtls: ExportKeyingMaterial can not be used with a reserved label")
42	errSequenceNumberOverflow            = errors.New("dtls: sequence number overflow")
43	errServerMustHaveCertificate         = errors.New("dtls: Certificate is mandatory for server")
44	errUnableToMarshalFragmented         = errors.New("dtls: unable to marshal fragmented handshakes")
45	errVerifyDataMismatch                = errors.New("dtls: Expected and actual verify data does not match")
46	errNoConfigProvided                  = errors.New("dtls: No config provided")
47	errPSKAndCertificate                 = errors.New("dtls: Certificate and PSK provided")
48	errPSKAndIdentityMustBeSetForClient  = errors.New("dtls: PSK and PSK Identity Hint must both be set for client")
49	errIdentityNoPSK                     = errors.New("dtls: Identity Hint provided but PSK is nil")
50	errNoAvailableCipherSuites           = errors.New("dtls: Connection can not be created, no CipherSuites satisfy this Config")
51	errInvalidClientKeyExchange          = errors.New("dtls: Unable to determine if ClientKeyExchange is a public key or PSK Identity")
52	errNoSupportedEllipticCurves         = errors.New("dtls: Client requested zero or more elliptic curves that are not supported by the server")
53	errConnectTimeout                    = errors.New("dtls: The connection timed out during the handshake")
54	errRequestedButNoSRTPExtension       = errors.New("dtls: SRTP support was requested but server did not respond with use_srtp extension")
55	errClientNoMatchingSRTPProfile       = errors.New("dtls: Server responded with SRTP Profile we do not support")
56	errServerNoMatchingSRTPProfile       = errors.New("dtls: Client requested SRTP but we have no matching profiles")
57	errServerRequiredButNoClientEMS      = errors.New("dtls: Server requires the Extended Master Secret extension, but the client does not support it")
58	errClientRequiredButNoServerEMS      = errors.New("dtls: Client required Extended Master Secret extension, but server does not support it")
59	errInvalidFingerprintLength          = errors.New("dtls: Invalid fingerprint length")
60	errInvalidCertificate                = errors.New("dtls: No certificate provided")
61)
62