36 lines
866 B
Rust
36 lines
866 B
Rust
use crate::ProtocolError;
|
|
use crate::buffer::CryptoBuffer;
|
|
use crate::parse_buffer::ParseBuffer;
|
|
|
|
#[derive(Debug, Copy, Clone)]
|
|
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
|
pub struct ChangeCipherSpec {}
|
|
|
|
#[allow(clippy::unnecessary_wraps)]
|
|
impl ChangeCipherSpec {
|
|
pub fn new() -> Self {
|
|
Self {}
|
|
}
|
|
|
|
pub fn read(_rx_buf: &mut [u8]) -> Result<Self, ProtocolError> {
|
|
Ok(Self {})
|
|
}
|
|
|
|
#[allow(dead_code)]
|
|
pub fn parse(_: &mut ParseBuffer) -> Result<Self, ProtocolError> {
|
|
Ok(Self {})
|
|
}
|
|
|
|
#[allow(dead_code, clippy::unused_self)]
|
|
pub(crate) fn encode(self, buf: &mut CryptoBuffer<'_>) -> Result<(), ProtocolError> {
|
|
buf.push(1).map_err(|_| ProtocolError::EncodeError)?;
|
|
Ok(())
|
|
}
|
|
}
|
|
|
|
impl Default for ChangeCipherSpec {
|
|
fn default() -> Self {
|
|
ChangeCipherSpec::new()
|
|
}
|
|
}
|