[root]
name = "lab1_rust"
-version = "0.0.1"
+version = "0.0.2"
dependencies = [
- "openssl 0.0.0 (git+https://github.com/sfackler/rust-openssl.git#1e706b8ef4d4344b5297b90bcd430cc96f40fb39)",
+ "openssl 0.0.0 (git+https://github.com/sfackler/rust-openssl.git#766ce4b7785c0b038bee95b74564e5b9bf7e9a4b)",
]
[[package]]
name = "openssl"
version = "0.0.0"
-source = "git+https://github.com/sfackler/rust-openssl.git#1e706b8ef4d4344b5297b90bcd430cc96f40fb39"
+source = "git+https://github.com/sfackler/rust-openssl.git#766ce4b7785c0b038bee95b74564e5b9bf7e9a4b"
[package]
name = "lab1_rust"
-version = "0.0.1"
+version = "0.0.2"
authors = ["Ummon <greg.burri@gmail.com>"]
impl Server {
pub fn new(interface: &str, port: u16, variant: packet::Variant) -> IoResult<Server> {
- let mut acceptor = try!(TcpListener::bind(interface, port).listen());
+ let mut acceptor = try!(TcpListener::bind((interface, port)).listen());
let server = Server {
acceptor: acceptor.clone()
impl Client {
pub fn new(address: &str, port: u16, variant: packet::Variant) -> IoResult<Client> {
Ok(Client { end_point: EndPoint {
- socket: try!(TcpStream::connect(address, port)),
+ socket: try!(TcpStream::connect((address, port))),
current_timestamp: 0,
variant: variant,
}})
/// May print some messages on stdout.
pub fn decipher(address: &str, port: u16, original_xor_operand: &[u8, ..16], cipher_block: &[u8, ..16], variant: packet::Variant) -> Option<Vec<u8>> {
let mut end_point = EndPoint::new(
- match TcpStream::connect(address, port) {
+ match TcpStream::connect((address, port)) {
Ok(s) => s,
_ => {
println!("Unable to connect to the oracle on [{}]:{}", address, port);
match self.t {
Command(_) | Answer(_) => {
let padding_size = if data.len() % 16 == 0 { 16 } else { 16 - data.len() % 16 } ;
- data.reserve_additional(padding_size);
+ data.reserve(padding_size);
for i in range(0, padding_size) {
data.push(padd_fun(i, padding_size));
}