mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 07:16:31 +03:00
fixes #661 and also contains a cleanup of config access (only for e2ee and mdns)
This commit is contained in:
10
src/imex.rs
10
src/imex.rs
@@ -195,13 +195,9 @@ pub fn render_setup_file(context: &Context, passphrase: &str) -> Result<String>
|
||||
let self_addr = e2ee::ensure_secret_key_exists(context)?;
|
||||
let private_key = Key::from_self_private(context, self_addr, &context.sql)
|
||||
.ok_or(format_err!("Failed to get private key."))?;
|
||||
let ac_headers = match context
|
||||
.sql
|
||||
.get_config_int(context, Config::E2eeEnabled)
|
||||
.unwrap_or(1)
|
||||
{
|
||||
0 => None,
|
||||
_ => Some(("Autocrypt-Prefer-Encrypt", "mutual")),
|
||||
let ac_headers = match context.get_config_bool(Config::E2eeEnabled) {
|
||||
false => None,
|
||||
true => Some(("Autocrypt-Prefer-Encrypt", "mutual")),
|
||||
};
|
||||
let private_key_asc = private_key.to_asc(ac_headers);
|
||||
let encr = dc_pgp_symm_encrypt(&passphrase, private_key_asc.as_bytes())?;
|
||||
|
||||
Reference in New Issue
Block a user