Converting to_bytes and try_from to serialize() and deserialize() (#138)
This commit is contained in:
@@ -28,7 +28,6 @@ use chacha20poly1305::aead::{Aead, NewAead};
|
||||
use chacha20poly1305::{ChaCha20Poly1305, Key, Nonce};
|
||||
use rustyline::error::ReadlineError;
|
||||
use rustyline::Editor;
|
||||
use std::convert::TryFrom;
|
||||
use std::process::exit;
|
||||
|
||||
use opaque_ke::{
|
||||
@@ -129,7 +128,7 @@ fn register_locker(
|
||||
|
||||
Locker {
|
||||
contents: ciphertext,
|
||||
password_file: password_file.to_bytes(),
|
||||
password_file: password_file.serialize(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +149,8 @@ fn open_locker(
|
||||
|
||||
// Client sends credential_request_bytes to server
|
||||
|
||||
let password_file = ServerRegistration::<Default>::try_from(&locker.password_file[..]).unwrap();
|
||||
let password_file =
|
||||
ServerRegistration::<Default>::deserialize(&locker.password_file[..]).unwrap();
|
||||
let mut server_rng = OsRng;
|
||||
let server_login_start_result = ServerLogin::start(
|
||||
&mut server_rng,
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
use rustyline::error::ReadlineError;
|
||||
use rustyline::Editor;
|
||||
use std::collections::HashMap;
|
||||
use std::convert::TryFrom;
|
||||
use std::process::exit;
|
||||
|
||||
use opaque_ke::{
|
||||
@@ -84,7 +83,7 @@ fn account_registration(
|
||||
.state
|
||||
.finish(RegistrationUpload::deserialize(&message_bytes[..]).unwrap())
|
||||
.unwrap();
|
||||
password_file.to_bytes()
|
||||
password_file.serialize()
|
||||
}
|
||||
|
||||
// Password-based login between a client and server
|
||||
@@ -104,7 +103,7 @@ fn account_login(
|
||||
|
||||
// Client sends credential_request_bytes to server
|
||||
|
||||
let password_file = ServerRegistration::<Default>::try_from(password_file_bytes).unwrap();
|
||||
let password_file = ServerRegistration::<Default>::deserialize(password_file_bytes).unwrap();
|
||||
let mut server_rng = OsRng;
|
||||
let server_login_start_result = ServerLogin::start(
|
||||
&mut server_rng,
|
||||
|
||||
Reference in New Issue
Block a user