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