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