mirror of
https://github.com/chatmail/core.git
synced 2026-04-24 08:56:29 +03:00
resolve some small TODOs
This commit is contained in:
21
src/e2ee.rs
21
src/e2ee.rs
@@ -54,21 +54,18 @@ impl EncryptHelper {
|
||||
let cursor = Cursor::new(&mut raw_message);
|
||||
mail_to_encrypt.clone().write_part(cursor).ok();
|
||||
|
||||
println!(
|
||||
"\nEncrypting pk:\n{}\n",
|
||||
String::from_utf8_lossy(&raw_message)
|
||||
); // TODO
|
||||
|
||||
let ctext = pgp::pk_encrypt(raw_message, keyring, Some(sign_key), compress).await?;
|
||||
|
||||
Ok(ctext)
|
||||
}
|
||||
|
||||
/// TODO documentation
|
||||
pub async fn encrypt_for_broadcast(
|
||||
/// Symmetrically encrypt the message to be sent into a broadcast channel,
|
||||
/// or for version 2 of the Securejoin protocol.
|
||||
/// `shared secret` is the secret that will be used for symmetric encryption.
|
||||
pub async fn encrypt_symmetrically(
|
||||
self,
|
||||
context: &Context,
|
||||
passphrase: &str,
|
||||
shared_secret: &str,
|
||||
mail_to_encrypt: MimePart<'static>,
|
||||
compress: bool,
|
||||
) -> Result<String> {
|
||||
@@ -78,12 +75,8 @@ impl EncryptHelper {
|
||||
let cursor = Cursor::new(&mut raw_message);
|
||||
mail_to_encrypt.clone().write_part(cursor).ok();
|
||||
|
||||
println!(
|
||||
"\nEncrypting symm:\n{}\n",
|
||||
String::from_utf8_lossy(&raw_message)
|
||||
); // TODO
|
||||
|
||||
let ctext = pgp::encrypt_for_broadcast(raw_message, passphrase, sign_key, compress).await?;
|
||||
let ctext =
|
||||
pgp::encrypt_symmetrically(raw_message, shared_secret, sign_key, compress).await?;
|
||||
|
||||
Ok(ctext)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user