refactor: make crate::pgp::symm_encrypt_message non-async

This commit is contained in:
link2xt
2026-06-20 00:36:05 +00:00
committed by l
parent 93a6f35ef7
commit 2aba6aa339
3 changed files with 34 additions and 35 deletions
+5 -2
View File
@@ -83,12 +83,15 @@ impl EncryptHelper {
None
};
let shared_secret = shared_secret.to_string();
let mut raw_message = Vec::new();
let cursor = Cursor::new(&mut raw_message);
mail_to_encrypt.clone().write_part(cursor).ok();
let ctext =
pgp::symm_encrypt_message(raw_message, sign_key, shared_secret, compress).await?;
let ctext = tokio::task::spawn_blocking(move || {
pgp::symm_encrypt_message(raw_message, sign_key, shared_secret, compress)
})
.await??;
Ok(ctext)
}