use std::iter::range_inclusive;
use std::slice::bytes::copy_memory;
use packet;
-use packet::{ Packet, Error };
+use packet::Packet;
+use packet::PacketType::Error;
use end_point::EndPoint;
/// Tries to decipher a ciphered data block by using the previous XOR operand and an oracle on the provided address and port.
forged_xor_operand(&mut final_packet)[byte] = v;
- match end_point.send_raw_with_result(final_packet) {
- Ok(Ok(p @ Packet { t: Error(packet::AuthError), .. })) => {
+ match end_point.send_raw_with_result(&final_packet) {
+ Ok(Ok(p @ Packet { t: Error(packet::ErrorType::Auth), .. })) => {
println!("We received a MAC Error: {}", p);
// If we already got a MAC mismatch for the first byte then
break;
}
},
- Ok(Ok(Packet { t: Error(packet::CryptError), .. })) => (), // Ignored case: the padding is wrong.
+ Ok(Ok(Packet { t: Error(packet::ErrorType::Crypt), .. })) => (), // Ignored case: the padding is wrong.
other => {
println!("Unexcepted response, aborting. {}", other);
return None