Skip to content
Snippets Groups Projects
Commit f21c2d99 authored by Éloïs's avatar Éloïs
Browse files

[feat] ws2pv2: not hash signed messages

parent c517c6a4
No related branches found
No related tags found
No related merge requests found
......@@ -66,12 +66,6 @@ impl From<bincode::Error> for WS2PMessageError {
}
impl WS2PMessage {
/// Verify signature validity
pub fn verify(&self) -> Result<(), SigError> {
match *self {
WS2PMessage::V2(ref msg_v2) => msg_v2.verify(),
}
}
/// Get message hash
pub fn hash(&self) -> Option<Hash> {
match *self {
......
......@@ -87,13 +87,7 @@ impl<'de> BinSignable<'de> for WS2Pv2Message {
self.issuer_pubkey
}
fn store_hash(&self) -> bool {
true
}
fn hash(&self) -> Option<Hash> {
self.message_hash
}
fn set_hash(&mut self, hash: Hash) {
self.message_hash = Some(hash)
false
}
fn signature(&self) -> Option<Sig> {
self.signature
......
......@@ -64,7 +64,7 @@ mod tests {
use std::thread;
use std::time::Duration;
pub fn keypair1() -> ed25519::KeyPair {
pub fn _keypair1() -> ed25519::KeyPair {
ed25519::KeyPairFromSaltedPasswordGenerator::with_default_parameters().generate(
"JhxtHB7UcsDbA9wMSyMKXUzBZUQvqVyB32KwzS9SWoLkjrUhHV".as_bytes(),
"JhxtHB7UcsDbA9wMSyMKXUzBZUQvqVyB32KwzS9SWoLkjrUhHV_".as_bytes(),
......@@ -72,7 +72,7 @@ mod tests {
}
//#[test]
fn listen_on_localhost() {
fn _listen_on_localhost() {
// create service channel
let (service_sender, _service_receiver): (
mpsc::Sender<Ws2pServiceSender>,
......@@ -85,7 +85,7 @@ mod tests {
service_sender,
MySelfWs2pNode {
my_node_id: NodeId(1),
my_key_pair: KeyPairEnum::Ed25519(keypair1()),
my_key_pair: KeyPairEnum::Ed25519(_keypair1()),
my_features: WS2PFeatures(vec![5u8]),
},
"localhost",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment