Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ def __init__(self, deltachat: DeltaChat) -> None:

def get_unconfigured_account(self) -> Account:
"""Create a new unconfigured account."""
account = self.deltachat.add_account()
account.set_config("verified_one_on_one_chats", "1")
return account
return self.deltachat.add_account()

def get_unconfigured_bot(self) -> Bot:
"""Create a new unconfigured bot."""
Expand Down
10 changes: 0 additions & 10 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,16 +413,6 @@ pub enum Config {
#[strum(props(default = "172800"))]
GossipPeriod,

/// Deprecated 2025-07. Feature flag for verified 1:1 chats; the UI should set it
/// to 1 if it supports verified 1:1 chats.
/// Regardless of this setting, `chat.is_protected()` returns true while the key is verified,
/// and when the key changes, an info message is posted into the chat.
/// 0=Nothing else happens when the key changes.
/// 1=After the key changed, `can_send()` returns false
/// until `chat_id.accept()` is called.
#[strum(props(default = "0"))]
VerifiedOneOnOneChats,

/// Row ID of the key in the `keypairs` table
/// used for signatures, encryption to self and included in `Autocrypt` header.
KeyId,
Expand Down
6 changes: 0 additions & 6 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1054,12 +1054,6 @@ impl Context {
"gossip_period",
self.get_config_int(Config::GossipPeriod).await?.to_string(),
);
res.insert(
"verified_one_on_one_chats", // deprecated 2025-07
self.get_config_bool(Config::VerifiedOneOnOneChats)
.await?
.to_string(),
);
res.insert(
"webxdc_realtime_enabled",
self.get_config_bool(Config::WebxdcRealtimeEnabled)
Expand Down
109 changes: 45 additions & 64 deletions src/imex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,75 +928,56 @@ mod tests {

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_export_and_import_backup() -> Result<()> {
for set_verified_oneonone_chats in [true, false] {
let backup_dir = tempfile::tempdir().unwrap();

let context1 = TestContext::new_alice().await;
assert!(context1.is_configured().await?);
if set_verified_oneonone_chats {
context1
.set_config_bool(Config::VerifiedOneOnOneChats, true)
.await?;
}
let backup_dir = tempfile::tempdir().unwrap();

let context2 = TestContext::new().await;
assert!(!context2.is_configured().await?);
assert!(has_backup(&context2, backup_dir.path()).await.is_err());
let context1 = TestContext::new_alice().await;
assert!(context1.is_configured().await?);

// export from context1
assert!(
imex(&context1, ImexMode::ExportBackup, backup_dir.path(), None)
.await
.is_ok()
);
let _event = context1
.evtracker
.get_matching(|evt| matches!(evt, EventType::ImexProgress(1000)))
.await;

// import to context2
let backup = has_backup(&context2, backup_dir.path()).await?;

// Import of unencrypted backup with incorrect "foobar" backup passphrase fails.
assert!(
imex(
&context2,
ImexMode::ImportBackup,
backup.as_ref(),
Some("foobar".to_string())
)
let context2 = TestContext::new().await;
assert!(!context2.is_configured().await?);
assert!(has_backup(&context2, backup_dir.path()).await.is_err());

// export from context1
assert!(
imex(&context1, ImexMode::ExportBackup, backup_dir.path(), None)
.await
.is_err()
);
.is_ok()
);
let _event = context1
.evtracker
.get_matching(|evt| matches!(evt, EventType::ImexProgress(1000)))
.await;

assert!(
imex(&context2, ImexMode::ImportBackup, backup.as_ref(), None)
.await
.is_ok()
);
let _event = context2
.evtracker
.get_matching(|evt| matches!(evt, EventType::ImexProgress(1000)))
.await;
// import to context2
let backup = has_backup(&context2, backup_dir.path()).await?;

assert!(context2.is_configured().await?);
assert_eq!(
context2.get_config(Config::Addr).await?,
Some("alice@example.org".to_string())
);
assert_eq!(
context2
.get_config_bool(Config::VerifiedOneOnOneChats)
.await?,
false
);
assert_eq!(
context1
.get_config_bool(Config::VerifiedOneOnOneChats)
.await?,
set_verified_oneonone_chats
);
}
// Import of unencrypted backup with incorrect "foobar" backup passphrase fails.
assert!(
imex(
&context2,
ImexMode::ImportBackup,
backup.as_ref(),
Some("foobar".to_string())
)
.await
.is_err()
);

assert!(
imex(&context2, ImexMode::ImportBackup, backup.as_ref(), None)
.await
.is_ok()
);
let _event = context2
.evtracker
.get_matching(|evt| matches!(evt, EventType::ImexProgress(1000)))
.await;

assert!(context2.is_configured().await?);
assert_eq!(
context2.get_config(Config::Addr).await?,
Some("alice@example.org".to_string())
);
Ok(())
}

Expand Down
10 changes: 0 additions & 10 deletions src/securejoin/securejoin_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ async fn test_setup_contact_ex(case: SetupContactCase) {
}
_ => alice_auto_submitted_hdr = "Auto-Submitted: auto-replied",
};
for t in [&alice, &bob] {
t.set_config_bool(Config::VerifiedOneOnOneChats, true)
.await
.unwrap();
}

assert_eq!(
Chatlist::try_load(&alice, 0, None, None)
Expand Down Expand Up @@ -702,11 +697,6 @@ async fn test_lost_contact_confirm() {
let mut tcm = TestContextManager::new();
let alice = tcm.alice().await;
let bob = tcm.bob().await;
for t in [&alice, &bob] {
t.set_config_bool(Config::VerifiedOneOnOneChats, true)
.await
.unwrap();
}

let qr = get_securejoin_qr(&alice, None).await.unwrap();
join_securejoin(&bob.ctx, &qr).await.unwrap();
Expand Down
24 changes: 0 additions & 24 deletions src/tests/verified_chats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ async fn check_verified_oneonone_chat_protection_not_broken(by_classical_email:
let mut tcm = TestContextManager::new();
let alice = tcm.alice().await;
let bob = tcm.bob().await;
enable_verified_oneonone_chats(&[&alice, &bob]).await;

tcm.execute_securejoin(&alice, &bob).await;

Expand Down Expand Up @@ -89,7 +88,6 @@ async fn test_create_verified_oneonone_chat() -> Result<()> {
let alice = tcm.alice().await;
let bob = tcm.bob().await;
let fiona = tcm.fiona().await;
enable_verified_oneonone_chats(&[&alice, &bob, &fiona]).await;

tcm.execute_securejoin(&alice, &bob).await;
tcm.execute_securejoin(&bob, &fiona).await;
Expand Down Expand Up @@ -151,7 +149,6 @@ async fn test_create_verified_oneonone_chat() -> Result<()> {
drop(fiona);

let fiona_new = tcm.unconfigured().await;
enable_verified_oneonone_chats(&[&fiona_new]).await;
fiona_new.configure_addr("fiona@example.net").await;
e2ee::ensure_secret_key_exists(&fiona_new).await?;

Expand Down Expand Up @@ -181,7 +178,6 @@ async fn test_missing_key_reexecute_securejoin() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = &tcm.alice().await;
let bob = &tcm.bob().await;
enable_verified_oneonone_chats(&[alice, bob]).await;
let chat_id = tcm.execute_securejoin(bob, alice).await;
let chat = Chat::load_from_db(bob, chat_id).await?;
assert!(chat.is_protected());
Expand All @@ -206,7 +202,6 @@ async fn test_create_unverified_oneonone_chat() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = tcm.alice().await;
let bob = tcm.bob().await;
enable_verified_oneonone_chats(&[&alice, &bob]).await;

// A chat with an unknown contact should be created unprotected
let chat = alice.create_chat(&bob).await;
Expand Down Expand Up @@ -246,7 +241,6 @@ async fn test_degrade_verified_oneonone_chat() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = tcm.alice().await;
let bob = tcm.bob().await;
enable_verified_oneonone_chats(&[&alice, &bob]).await;

mark_as_verified(&alice, &bob).await;

Expand Down Expand Up @@ -361,7 +355,6 @@ async fn test_mdn_doesnt_disable_verification() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = tcm.alice().await;
let bob = tcm.bob().await;
enable_verified_oneonone_chats(&[&alice, &bob]).await;
bob.set_config_bool(Config::MdnsEnabled, true).await?;

// Alice & Bob verify each other
Expand All @@ -386,7 +379,6 @@ async fn test_outgoing_mua_msg() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = tcm.alice().await;
let bob = tcm.bob().await;
enable_verified_oneonone_chats(&[&alice, &bob]).await;

mark_as_verified(&alice, &bob).await;
mark_as_verified(&bob, &alice).await;
Expand Down Expand Up @@ -423,7 +415,6 @@ async fn test_outgoing_encrypted_msg() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = &tcm.alice().await;
let bob = &tcm.bob().await;
enable_verified_oneonone_chats(&[alice]).await;

mark_as_verified(alice, bob).await;
let chat_id = alice.create_chat(bob).await.id;
Expand All @@ -449,7 +440,6 @@ async fn test_reply() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = tcm.alice().await;
let bob = tcm.bob().await;
enable_verified_oneonone_chats(&[&alice, &bob]).await;

if verified {
mark_as_verified(&alice, &bob).await;
Expand Down Expand Up @@ -492,7 +482,6 @@ async fn test_message_from_old_dc_setup() -> Result<()> {
let alice = &tcm.alice().await;
let bob_old = &tcm.unconfigured().await;

enable_verified_oneonone_chats(&[alice, bob_old]).await;
bob_old.configure_addr("bob@example.net").await;
mark_as_verified(bob_old, alice).await;
let chat = bob_old.create_chat(alice).await;
Expand All @@ -503,7 +492,6 @@ async fn test_message_from_old_dc_setup() -> Result<()> {

tcm.section("Bob reinstalls DC");
let bob = &tcm.bob().await;
enable_verified_oneonone_chats(&[bob]).await;

mark_as_verified(alice, bob).await;
mark_as_verified(bob, alice).await;
Expand Down Expand Up @@ -535,7 +523,6 @@ async fn test_verify_then_verify_again() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = tcm.alice().await;
let bob = tcm.bob().await;
enable_verified_oneonone_chats(&[&alice, &bob]).await;

mark_as_verified(&alice, &bob).await;
mark_as_verified(&bob, &alice).await;
Expand All @@ -546,7 +533,6 @@ async fn test_verify_then_verify_again() -> Result<()> {
tcm.section("Bob reinstalls DC");
drop(bob);
let bob_new = tcm.unconfigured().await;
enable_verified_oneonone_chats(&[&bob_new]).await;
bob_new.configure_addr("bob@example.net").await;
e2ee::ensure_secret_key_exists(&bob_new).await?;

Expand Down Expand Up @@ -599,7 +585,6 @@ async fn test_verified_member_added_reordering() -> Result<()> {
let alice = &tcm.alice().await;
let bob = &tcm.bob().await;
let fiona = &tcm.fiona().await;
enable_verified_oneonone_chats(&[alice, bob, fiona]).await;

let alice_fiona_contact_id = alice.add_or_lookup_contact_id(fiona).await;

Expand Down Expand Up @@ -651,7 +636,6 @@ async fn test_no_unencrypted_name_if_encrypted() -> Result<()> {
bob.set_config(Config::Displayname, Some("Bob Smith"))
.await?;
if verified {
enable_verified_oneonone_chats(&[&bob]).await;
mark_as_verified(&bob, &alice).await;
} else {
tcm.send_recv_accept(&alice, &bob, "hi").await;
Expand Down Expand Up @@ -882,11 +866,3 @@ async fn assert_verified(this: &TestContext, other: &TestContext, protected: Pro
protected == ProtectionStatus::Protected
);
}

async fn enable_verified_oneonone_chats(test_contexts: &[&TestContext]) {
for t in test_contexts {
t.set_config_bool(Config::VerifiedOneOnOneChats, true)
.await
.unwrap()
}
}