diff --git a/python/tests/test_account.py b/python/tests/test_account.py index be8735db2..b24ebb367 100644 --- a/python/tests/test_account.py +++ b/python/tests/test_account.py @@ -462,5 +462,6 @@ class TestOnlineAccount: msg = ac2.get_message_by_id(ev[2]) assert msg.is_setup_message() print("*************** Incoming ASM File at: ", msg.filename) + print("*************** Setup Code: ", setup_code) msg.continue_key_transfer(setup_code) assert ac1.get_info()["fingerprint"] == ac2.get_info()["fingerprint"] diff --git a/src/dc_imex.rs b/src/dc_imex.rs index 22b81c891..5ae71c5c0 100644 --- a/src/dc_imex.rs +++ b/src/dc_imex.rs @@ -362,10 +362,10 @@ pub unsafe fn dc_continue_key_transfer( } || *filename.offset(0isize) as libc::c_int == 0i32 { - dc_log_error( + error!( context, - 0i32, - b"Message is no Autocrypt Setup Message.\x00" as *const u8 as *const libc::c_char, + 0, + "Message is no Autocrypt Setup Message.", ); } else if 0 == dc_read_file( @@ -377,28 +377,26 @@ pub unsafe fn dc_continue_key_transfer( || filecontent.is_null() || filebytes <= 0 { - dc_log_error( + error!( context, - 0i32, - b"Cannot read Autocrypt Setup Message file.\x00" as *const u8 - as *const libc::c_char, + 0, + "Cannot read Autocrypt Setup Message file.", ); } else { norm_sc = dc_normalize_setup_code(context, setup_code); if norm_sc.is_null() { - dc_log_warning( + warn!( context, - 0i32, - b"Cannot normalize Setup Code.\x00" as *const u8 as *const libc::c_char, + 0, + "Cannot normalize Setup Code.", ); } else { armored_key = dc_decrypt_setup_file(context, norm_sc, filecontent); if armored_key.is_null() { - dc_log_warning( + warn!( context, - 0i32, - b"Cannot decrypt Autocrypt Setup Message.\x00" as *const u8 - as *const libc::c_char, + 0, + "Cannot decrypt Autocrypt Setup Message.", ); } else if !(0 == set_self_key(context, armored_key, 1i32)) { /*set default*/ @@ -433,6 +431,8 @@ unsafe fn set_self_key( let mut buf_base64: *const libc::c_char = 0 as *const libc::c_char; 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; + info!(context, 0, "armored key: {}", as_str(armored)); + buf = dc_strdup(armored); if 0 == dc_split_armored_data( buf, @@ -446,10 +446,10 @@ unsafe fn set_self_key( ) != 0i32 || buf_base64.is_null() { - dc_log_warning( + warn!( context, - 0i32, - b"File does not contain a private key.\x00" as *const u8 as *const libc::c_char, + 0, + "File does not contain a private key.", ); } else { if let Some((private_key, public_key)) = Key::from_base64( @@ -568,6 +568,7 @@ pub unsafe fn dc_decrypt_setup_file( let mut indx: size_t = 0i32 as size_t; let mut payload: *mut libc::c_char = 0 as *mut libc::c_char; + info!(_context, 0, "trying to decrypt ASM file"); fc_buf = dc_strdup(filecontent); if !(0 == dc_split_armored_data(