refactor: 将 DTLS 本地依赖迁移到 libs 目录

This commit is contained in:
mofeng-git
2026-10-01 22:46:36 +08:00
parent 2f60e61dd5
commit 4f59e78179
99 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1,39 @@
#[cfg(test)]
mod extension_use_extended_master_secret_test;
use super::*;
const EXTENSION_USE_EXTENDED_MASTER_SECRET_HEADER_SIZE: usize = 4;
/// ## Specifications
///
/// * [RFC 8422]
///
/// [RFC 8422]: https://tools.ietf.org/html/rfc8422
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ExtensionUseExtendedMasterSecret {
pub(crate) supported: bool,
}
impl ExtensionUseExtendedMasterSecret {
pub fn extension_value(&self) -> ExtensionValue {
ExtensionValue::UseExtendedMasterSecret
}
pub fn size(&self) -> usize {
2
}
pub fn marshal<W: Write>(&self, writer: &mut W) -> Result<()> {
// length
writer.write_u16::<BigEndian>(0)?;
Ok(writer.flush()?)
}
pub fn unmarshal<R: Read>(reader: &mut R) -> Result<Self> {
let _ = reader.read_u16::<BigEndian>()?;
Ok(ExtensionUseExtendedMasterSecret { supported: true })
}
}