rustls/msgs/mod.rs
1#![allow(missing_docs)]
2//! <https://langsec.org> cat says:
3//!
4//! ```text
5//! ___ _ _ _ _ ___ ___ ___ ___ ___ _ _ ___ _____ ___ ___ _ _
6//! | __| | | | | | | | _ \ __/ __/ _ \ / __| \| |_ _|_ _|_ _/ _ \| \| |
7//! | _|| |_| | |__| |__ | / _| (_| (_) | (_ | .` || | | | | | (_) | .` |
8//! |_| \___/|____|____| |_|_\___\___\___/ \___|_|\_|___| |_| |___\___/|_|\_|
9//!
10//!
11//! .__....._ _.....__,
12//! .": o :': ;': o :".
13//! `. `-' .'. .'. `-' .'
14//! `---' `---'
15//!
16//! _...----... ... ... ...----..._
17//! .-'__..-""'---- `. `"` .' ----'""-..__`-.
18//! '.-' _.--"""' `-._.-' '"""--._ `-.`
19//! ' .-"' : `"-. `
20//! ' `. _.'"'._ .' `
21//! `. ,.-'" "'-., .'
22//! `. .'
23//! `-._ _.-'
24//! `"'--...___...--'"`
25//!
26//! ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ _ _ ___
27//! | _ ) __| __/ _ \| _ \ __| | _ \ _ \/ _ \ / __| __/ __/ __|_ _| \| |/ __|
28//! | _ \ _|| _| (_) | / _| | _/ / (_) | (__| _|\__ \__ \| || .` | (_ |
29//! |___/___|_| \___/|_|_\___| |_| |_|_\\___/ \___|___|___/___/___|_|\_|\___|
30//! ```
31//!
32//! <https://langsec.org/ForWantOfANail-h2hc2014.pdf>
33
34#[macro_use]
35mod macros;
36
37pub(crate) mod alert;
38pub(crate) mod base;
39pub(crate) mod ccs;
40pub(crate) mod codec;
41pub(crate) mod deframer;
42pub(crate) mod enums;
43pub(crate) mod fragmenter;
44pub(crate) mod handshake;
45pub(crate) mod message;
46pub(crate) mod persist;
47
48#[cfg(test)]
49mod handshake_test;
50
51pub mod ffdhe_groups;
52#[cfg(test)]
53mod message_test;
54
55#[cfg(test)]
56mod tests {
57 use super::codec::Reader;
58 use super::message::{Message, OutboundOpaqueMessage};
59
60 #[test]
61 fn smoketest() {
62 let bytes = include_bytes!("../testdata/handshake-test.1.bin");
63 let mut r = Reader::init(bytes);
64
65 while r.any_left() {
66 let m = OutboundOpaqueMessage::read(&mut r).unwrap();
67
68 let out = m.clone().encode();
69 assert!(!out.is_empty());
70
71 Message::try_from(m.into_plain_message()).unwrap();
72 }
73 }
74}