/rust/registry/src/index.crates.io-1949cf8c6b5b557f/tls-parser-0.11.0/src/tls_dh.rs
Line | Count | Source |
1 | | use nom::multi::length_data; |
2 | | use nom::number::streaming::be_u16; |
3 | | use nom::IResult; |
4 | | use nom_derive::*; |
5 | | |
6 | | /// Diffie-Hellman parameters, defined in [RFC5246] section 7.4.3 |
7 | 0 | #[derive(PartialEq, NomBE)] Unexecuted instantiation: <tls_parser::tls_dh::ServerDHParams as nom_derive::traits::Parse<&[u8]>>::parse_be Unexecuted instantiation: <tls_parser::tls_dh::ServerDHParams as nom_derive::traits::Parse<&[u8]>>::parse_le Unexecuted instantiation: <tls_parser::tls_dh::ServerDHParams as nom_derive::traits::Parse<&[u8]>>::parse_be Unexecuted instantiation: <tls_parser::tls_dh::ServerDHParams as nom_derive::traits::Parse<&[u8]>>::parse_le |
8 | | pub struct ServerDHParams<'a> { |
9 | | /// The prime modulus used for the Diffie-Hellman operation. |
10 | | #[nom(Parse = "length_data(be_u16)")] |
11 | | pub dh_p: &'a [u8], |
12 | | /// The generator used for the Diffie-Hellman operation. |
13 | | #[nom(Parse = "length_data(be_u16)")] |
14 | | pub dh_g: &'a [u8], |
15 | | /// The server's Diffie-Hellman public value (g^X mod p). |
16 | | #[nom(Parse = "length_data(be_u16)")] |
17 | | pub dh_ys: &'a [u8], |
18 | | } |
19 | | |
20 | | #[inline] |
21 | 0 | pub fn parse_dh_params(i: &[u8]) -> IResult<&[u8], ServerDHParams> { |
22 | 0 | ServerDHParams::parse(i) |
23 | 0 | } Unexecuted instantiation: tls_parser::tls_dh::parse_dh_params Unexecuted instantiation: tls_parser::tls_dh::parse_dh_params |