mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-02-18 04:33:20 +00:00
Clean up warnings
This commit is contained in:
parent
fc343ff82e
commit
98c74a120e
@ -24,8 +24,6 @@ pub enum ChatError {
|
|||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
pub enum EncryptionError {
|
pub enum EncryptionError {
|
||||||
#[error("encryption: {0}")]
|
|
||||||
Encryption(String),
|
|
||||||
#[error("decryption: {0}")]
|
#[error("decryption: {0}")]
|
||||||
Decryption(String),
|
Decryption(String),
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
use blake2::{Blake2b512, Digest};
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use crate::crypto::{PublicKey, StaticSecret};
|
use crate::crypto::{PublicKey, StaticSecret};
|
||||||
@ -23,10 +22,6 @@ impl Identity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn address(&self) -> String {
|
|
||||||
hex::encode(Blake2b512::digest(self.public_key()))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn public_key(&self) -> PublicKey {
|
pub fn public_key(&self) -> PublicKey {
|
||||||
PublicKey::from(&self.secret)
|
PublicKey::from(&self.secret)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -187,7 +187,7 @@ impl Inbox {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// TODO: Decrypt Content
|
// TODO: Decrypt Content
|
||||||
let frame = proto::InboxV1Frame::decode(bytes)?;
|
let frame = self.decrypt_frame(bytes)?;
|
||||||
Ok((seed_key, frame))
|
Ok((seed_key, frame))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,12 +203,9 @@ impl Inbox {
|
|||||||
Ok(handshake)
|
Ok(handshake)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn decrypt_frame(
|
fn decrypt_frame(&self, enc_frame_bytes: Bytes) -> Result<proto::InboxV1Frame, ChatError> {
|
||||||
enc_payload: proto::InboxHandshakeV1,
|
|
||||||
) -> Result<proto::InboxV1Frame, ChatError> {
|
|
||||||
let frame_bytes = enc_payload.payload;
|
|
||||||
// TODO: decrypt payload
|
// TODO: decrypt payload
|
||||||
let frame = proto::InboxV1Frame::decode(frame_bytes)?;
|
let frame = proto::InboxV1Frame::decode(enc_frame_bytes)?;
|
||||||
Ok(frame)
|
Ok(frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user