|
|
|
|
@ -1141,6 +1141,10 @@ mod tests {
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn test_process_bind_pdu() {
|
|
|
|
|
let header: &[u8] = &[
|
|
|
|
|
0x05, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
|
0x00, 0x00,
|
|
|
|
|
];
|
|
|
|
|
let bind: &[u8] = &[
|
|
|
|
|
0xd0, 0x16, 0xd0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
|
0x01, 0x00, 0x2c, 0xd0, 0x28, 0xda, 0x76, 0x91, 0xf6, 0x6e, 0xcb, 0x0f, 0xbf, 0x85,
|
|
|
|
|
@ -1221,11 +1225,16 @@ mod tests {
|
|
|
|
|
0x02, 0x00, 0x00, 0x00,
|
|
|
|
|
];
|
|
|
|
|
let mut dcerpc_state = DCERPCState::new();
|
|
|
|
|
assert_eq!(16, dcerpc_state.process_header(header));
|
|
|
|
|
assert_eq!(1068, dcerpc_state.process_bind_pdu(bind));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn test_handle_bindctxitem() {
|
|
|
|
|
let header: &[u8] = &[
|
|
|
|
|
0x05, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
|
0x00, 0x00,
|
|
|
|
|
];
|
|
|
|
|
let bind: &[u8] = &[
|
|
|
|
|
0x00, 0x00, 0x01, 0x00, 0x2c, 0xd0, 0x28, 0xda, 0x76, 0x91, 0xf6, 0x6e, 0xcb, 0x0f,
|
|
|
|
|
0xbf, 0x85, 0xcd, 0x9b, 0xf6, 0x39, 0x01, 0x00, 0x03, 0x00, 0x04, 0x5d, 0x88, 0x8a,
|
|
|
|
|
@ -1233,6 +1242,7 @@ mod tests {
|
|
|
|
|
0x00, 0x00,
|
|
|
|
|
];
|
|
|
|
|
let mut dcerpc_state = DCERPCState::new();
|
|
|
|
|
assert_eq!(16, dcerpc_state.process_header(header));
|
|
|
|
|
assert_eq!(44, dcerpc_state.handle_bindctxitem(bind, 0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|