pub struct OpaqueMessage {
pub typ: ContentType,
pub version: ProtocolVersion,
pub payload: Payload,
}
Expand description
A TLS frame, named TLSPlaintext in the standard.
This type owns all memory for its interior parts. It is used to read/write from/to I/O
buffers as well as for fragmenting, joining and encryption/decryption. It can be converted
into a Message
by decoding the payload.
Fields§
§typ: ContentType
§version: ProtocolVersion
§payload: Payload
Implementations§
source§impl OpaqueMessage
impl OpaqueMessage
sourceconst HEADER_SIZE: u16 = 5u16
const HEADER_SIZE: u16 = 5u16
Content type, version and size.
sourceconst MAX_PAYLOAD: u16 = 18_432u16
const MAX_PAYLOAD: u16 = 18_432u16
This is the maximum on-the-wire size of a TLSCiphertext. That’s 2^14 payload bytes, a header, and a 2KB allowance for ciphertext overheads.
sourcepub const MAX_WIRE_SIZE: usize = 18_437usize
pub const MAX_WIRE_SIZE: usize = 18_437usize
Maximum on-wire message size.
sourcepub fn read(r: &mut Reader<'_>) -> Result<Self, MessageError>
pub fn read(r: &mut Reader<'_>) -> Result<Self, MessageError>
MessageError
allows callers to distinguish between valid prefixes (might
become valid if we read more data) and invalid data.
sourcepub fn into_plain_message(self) -> PlainMessage
pub fn into_plain_message(self) -> PlainMessage
Force conversion into a plaintext message.
This should only be used for messages that are known to be in plaintext. Otherwise, the
OpaqueMessage
should be decrypted into a PlainMessage
using a MessageDecrypter
.
Trait Implementations§
source§impl Clone for OpaqueMessage
impl Clone for OpaqueMessage
source§fn clone(&self) -> OpaqueMessage
fn clone(&self) -> OpaqueMessage
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Codec for OpaqueMessage
impl Codec for OpaqueMessage
source§fn read(reader: &mut Reader<'_>) -> Option<Self>
fn read(reader: &mut Reader<'_>) -> Option<Self>
Reader
.
Return Some if it worked, None if not.source§fn get_encoding(&self) -> Vec<u8>
fn get_encoding(&self) -> Vec<u8>
encode()
.source§fn read_bytes(bytes: &[u8]) -> Option<Self>
fn read_bytes(bytes: &[u8]) -> Option<Self>
bytes
and
return it.source§impl Debug for OpaqueMessage
impl Debug for OpaqueMessage
source§impl Extractable<TLSProtocolTypes> for OpaqueMessage
impl Extractable<TLSProtocolTypes> for OpaqueMessage
source§fn extract_knowledge<'a>(
&'a self,
knowledges: &mut Vec<Knowledge<'a, TLSProtocolTypes>>,
matcher: Option<<TLSProtocolTypes as ProtocolTypes>::Matcher>,
source: &'a Source,
) -> Result<(), Error>
fn extract_knowledge<'a>( &'a self, knowledges: &mut Vec<Knowledge<'a, TLSProtocolTypes>>, matcher: Option<<TLSProtocolTypes as ProtocolTypes>::Matcher>, source: &'a Source, ) -> Result<(), Error>
knowledges
with new knowledge gathered form the type implementing EvaluatedTerm
by recursively calling extract_knowledge
on all contained element
This will put source as the source of all the produced knowledge, matcher is also passed
recursively but might be overwritten by a type with a more specific matchersource§impl From<OpaqueMessage> for OpaqueMessageFlight
impl From<OpaqueMessage> for OpaqueMessageFlight
source§fn from(value: OpaqueMessage) -> Self
fn from(value: OpaqueMessage) -> Self
source§impl ProtocolMessage<TLSProtocolTypes, OpaqueMessage> for Message
impl ProtocolMessage<TLSProtocolTypes, OpaqueMessage> for Message
fn create_opaque(&self) -> OpaqueMessage
fn debug(&self, info: &str)
source§impl ProtocolMessageFlight<TLSProtocolTypes, Message, OpaqueMessage, OpaqueMessageFlight> for MessageFlight
impl ProtocolMessageFlight<TLSProtocolTypes, Message, OpaqueMessage, OpaqueMessageFlight> for MessageFlight
source§impl TryFrom<OpaqueMessage> for Message
impl TryFrom<OpaqueMessage> for Message
impl VecCodecWoSize for OpaqueMessage
Auto Trait Implementations§
impl Freeze for OpaqueMessage
impl RefUnwindSafe for OpaqueMessage
impl Send for OpaqueMessage
impl Sync for OpaqueMessage
impl Unpin for OpaqueMessage
impl UnwindSafe for OpaqueMessage
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneAny for T
impl<T> CloneAny for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CodecP for Twhere
T: Codec,
impl<T> CodecP for Twhere
T: Codec,
source§impl<T, PT> EvaluatedTerm<PT> for T
impl<T, PT> EvaluatedTerm<PT> for T
§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = Tail
type PreprendResult = Tail
TupleList
], of an [Prepend::prepend()
] call,
including the prepended entry.