rebase fixes

This commit is contained in:
dignifiedquire
2019-07-06 13:49:24 +02:00
parent 813aae08a3
commit d3e521ded0
2 changed files with 5 additions and 11 deletions

View File

@@ -389,11 +389,6 @@ fn set_self_key(
armored_c: *const libc::c_char, armored_c: *const libc::c_char,
set_default: libc::c_int, set_default: libc::c_int,
) -> libc::c_int { ) -> libc::c_int {
let mut success = 0;
let mut stmt: *mut sqlite3_stmt = 0 as *mut sqlite3_stmt;
let mut self_addr: *mut libc::c_char = 0 as *mut libc::c_char;
assert!(!armored_c.is_null(), "invalid buffer"); assert!(!armored_c.is_null(), "invalid buffer");
let armored = as_str(armored_c); let armored = as_str(armored_c);
@@ -450,10 +445,10 @@ fn set_self_key(
return 0; return 0;
} }
match preferencrypt.as_str() { match preferencrypt.map(|s| s.as_str()) {
"" => 0, Some("") => 0,
"nopreference" => dc_sqlite3_set_config_int(context, &context.sql, "e2ee_enabled", 0), Some("nopreference") => dc_sqlite3_set_config_int(context, &context.sql, "e2ee_enabled", 0),
"mutual" => dc_sqlite3_set_config_int(context, &context.sql, "e2ee_enabled", 1), Some("mutual") => dc_sqlite3_set_config_int(context, &context.sql, "e2ee_enabled", 1),
_ => 1, _ => 1,
} }
} }

View File

@@ -458,8 +458,7 @@ i8pcjGO+IZffvyZJVRWfVooBJmWWbPB1pueo3tx8w3+fcuzpxz+RLFKaPyqXO+dD
#[test] #[test]
#[ignore] // is too expensive #[ignore] // is too expensive
fn test_ascii_roundtrip() { fn test_ascii_roundtrip() {
let (public_key, private_key) = let (public_key, private_key) = crate::pgp::dc_pgp_create_keypair("hello").unwrap();
crate::pgp::dc_pgp_create_keypair(CString::new("hello").unwrap().as_ptr()).unwrap();
let s = public_key.to_armored_string(None).unwrap(); let s = public_key.to_armored_string(None).unwrap();
let (public_key2, _) = let (public_key2, _) =