#[non_exhaustive]pub enum ApiMisuse {
Show 29 variants
ResumingFromUnknownCipherSuite(CipherSuite),
ExporterAlreadyUsed,
ExporterContextTooLong,
ExporterOutputTooLong,
ExporterOutputZeroLength,
InvalidQuicHeaderProtectionSampleLength,
InvalidQuicHeaderProtectionPacketNumberLength,
InvalidSignerForProtocolVersion,
QuicRequiresTls13Support,
NoQuicCompatibleCipherSuites,
EmptyCertificateChain,
QuicRestrictsMaxEarlyDataSize,
NoCipherSuitesConfigured,
NoKeyExchangeGroupsConfigured,
NoSignatureVerificationAlgorithms,
EchRequiresTls13Support,
EchForbidsTls12Support,
SecretExtractionRequiresPriorOptIn,
UnverifiableCertificateType,
NoSupportedCertificateTypes,
NonceArraySizeMismatch {
expected: usize,
actual: usize,
},
IvLengthExceedsMaximum {
actual: usize,
maximum: usize,
},
ResumptionDataProvidedTooLate,
KeyUpdateNotAvailableForTls12,
KernelSessionTicketHandlingNotAvailableForTls12,
SplitDuringHandshake,
EncryptBufferTooSmall {
required: usize,
provided: usize,
},
WriteTlsBeforeHandshakeComplete,
WriteTlsAfterSendPathClosed,
}Expand description
Describes cases of API misuse
Variants here should be sufficiently detailed that the action needed is clear.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ResumingFromUnknownCipherSuite(CipherSuite)
Trying to resume a session with an unknown cipher suite.
ExporterAlreadyUsed
The KeyingMaterialExporter was already consumed.
Methods that obtain an exporter (eg, Connection::exporter()) can only
be used once. This error is returned on subsequent calls.
ExporterContextTooLong
The context parameter to KeyingMaterialExporter::derive() was too long.
For TLS1.2 connections (only) this parameter is limited to 64KB.
ExporterOutputTooLong
The output object for KeyingMaterialExporter::derive() was too long.
For TLS1.3 connections this is limited to 255 times the hash output length.
ExporterOutputZeroLength
The output object to KeyingMaterialExporter::derive() was zero length.
This doesn’t make sense, so we explicitly return an error (rather than simply producing no output as requested.)
InvalidQuicHeaderProtectionSampleLength
Incorrect sample length provided to quic::HeaderProtectionKey::encrypt_in_place()
InvalidQuicHeaderProtectionPacketNumberLength
Incorrect relation between sample length and header number length provided to
quic::HeaderProtectionKey::encrypt_in_place()
InvalidSignerForProtocolVersion
Raw keys cannot be used with TLS 1.2.
QuicRequiresTls13Support
QUIC attempted with a configuration that does not support TLS1.3.
NoQuicCompatibleCipherSuites
QUIC attempted with a configuration that does not support a ciphersuite that supports QUIC.
EmptyCertificateChain
An empty certificate chain was provided.
QuicRestrictsMaxEarlyDataSize
QUIC attempted with unsupported ServerConfig::max_early_data_size
This field must be either zero or u32::MAX for QUIC.
NoCipherSuitesConfigured
A CryptoProvider must have at least one cipher suite.
NoKeyExchangeGroupsConfigured
A CryptoProvider must have at least one key exchange group.
NoSignatureVerificationAlgorithms
An empty list of signature verification algorithms was provided.
EchRequiresTls13Support
ECH attempted with a configuration that does not support TLS1.3.
EchForbidsTls12Support
ECH attempted with a configuration that also supports TLS1.2.
SecretExtractionRequiresPriorOptIn
Secret extraction operation attempted without opting-in to secret extraction.
This is possible from Connection::dangerous_extract_secrets().
You must set ServerConfig::enable_secret_extraction or
ClientConfig::enable_secret_extraction to true before this
is available.
UnverifiableCertificateType
Attempt to verify a certificate with an unsupported type.
A verifier indicated support for a certificate type but then failed to verify the peer’s identity of that type.
NoSupportedCertificateTypes
A verifier or resolver implementation signalled that it does not support any certificate types.
NonceArraySizeMismatch
Nonce::to_array() called with incorrect array size.
The nonce length does not match the requested array size N.
Fields
IvLengthExceedsMaximum
Iv::new() called with a value that exceeds the maximum IV length.
The IV length must not exceed Iv::MAX_LEN.
ResumptionDataProvidedTooLate
Calling ServerConnection::set_resumption_data() must be done before
any resumption is offered.
KeyUpdateNotAvailableForTls12
KernelConnection::update_tx_secret() and associated are not available for TLS1.2 connections.
KernelSessionTicketHandlingNotAvailableForTls12
KernelConnection::handle_new_session_ticket() and associated are not available for TLS1.2 connections.
SplitDuringHandshake
ClientConnection::split() or ServerConnection::split() called during handshake.
EncryptBufferTooSmall
An output buffer provided for encryption was too small.
Fields
WriteTlsBeforeHandshakeComplete
Plaintext cannot be encrypted before the handshake is complete.
WriteTlsAfterSendPathClosed
Plaintext cannot be encrypted after the send path has been closed.
Trait Implementations§
Source§impl Error for ApiMisuse
impl Error for ApiMisuse
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()