Skip to content

Commit

Permalink
Run rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
chifflier committed Mar 1, 2024
1 parent 5d1e1da commit a83848c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,14 +637,18 @@ fn parse_tls_handshake_msg_client_hello(i: &[u8]) -> IResult<&[u8], TlsMessageHa
Ok((i, TlsMessageHandshake::ClientHello(content)))
}

fn parse_tls_handshake_msg_server_hello_tlsv12<const HAS_EXT: bool>(i: &[u8]) -> IResult<&[u8], TlsMessageHandshake> {
fn parse_tls_handshake_msg_server_hello_tlsv12<const HAS_EXT: bool>(
i: &[u8],
) -> IResult<&[u8], TlsMessageHandshake> {
map(
parse_tls_server_hello_tlsv12::<HAS_EXT>,
TlsMessageHandshake::ServerHello,
)(i)
}

pub(crate) fn parse_tls_server_hello_tlsv12<const HAS_EXT: bool>(i: &[u8]) -> IResult<&[u8], TlsServerHelloContents> {
pub(crate) fn parse_tls_server_hello_tlsv12<const HAS_EXT: bool>(
i: &[u8],
) -> IResult<&[u8], TlsServerHelloContents> {
let (i, version) = be_u16(i)?;
let (i, random) = take(32usize)(i)?;
let (i, sidlen) = verify(be_u8, |&n| n <= 32)(i)?;
Expand Down
3 changes: 2 additions & 1 deletion src/tls_serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ mod tests {
0x003f, 0x003e, 0x0033, 0x0032, 0x0031, 0x0030, 0x009a, 0x0099, 0x0098, 0x0097, 0x0045,
0x0044, 0x0043, 0x0042, 0xc031, 0xc02d, 0xc029, 0xc025, 0xc00e, 0xc004, 0x009c, 0x003c,
0x002f, 0x0096, 0x0041, 0xc011, 0xc007, 0xc00c, 0xc002, 0x0005, 0x0004, 0xc012, 0xc008,
0x0016, 0x0013, 0x0010, 0x000d, 0xc00d, 0xc003, 0x000a, 0x00ff];
0x0016, 0x0013, 0x0010, 0x000d, 0xc00d, 0xc003, 0x000a, 0x00ff,
];
let comp = vec![TlsCompressionID(0x00)];

let expected = TlsPlaintext {
Expand Down

0 comments on commit a83848c

Please sign in to comment.