From 24fc93e9aeb5d0810eb9c7e7d79da019b84035f5 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Thu, 23 May 2013 16:36:24 -0700 Subject: [PATCH] Switch to a more heavily TOFU model for identity keys. 1) There is no longer a concept of "verified" or "unverified." Only "what we saw last time" and "different from last time." 2) Let's eliminate "verify session," since we're all about identity keys now. 3) Mark manually processed key exchanges as processed. --- .../ic_menu_unlock_holo_dark.png | Bin 0 -> 1030 bytes .../ic_menu_unlock_holo_dark.png | Bin 0 -> 596 bytes .../ic_menu_unlock_holo_dark.png | Bin 0 -> 1483 bytes res/layout/receive_key_activity.xml | 95 ++++----- res/layout/review_identities.xml | 30 +-- res/layout/review_identities_fragment.xml | 24 +++ res/menu/conversation_insecure.xml | 2 +- ...d.xml => conversation_secure_identity.xml} | 5 +- ...ml => conversation_secure_no_identity.xml} | 5 +- res/values/strings.xml | 13 +- res/xml/preferences.xml | 8 - .../ApplicationPreferencesActivity.java | 78 +------- .../securesms/ConversationActivity.java | 35 ++-- .../securesms/ConversationItem.java | 1 + .../securesms/DatabaseUpgradeActivity.java | 3 +- .../securesms/IdentityKeyView.java | 39 +++- .../securesms/KeyVerifyingActivity.java | 40 ---- .../securesms/ReceiveKeyActivity.java | 142 +++++--------- .../securesms/ReviewIdentitiesActivity.java | 184 +----------------- .../securesms/ReviewIdentitiesFragment.java | 90 +++++++++ .../securesms/SaveIdentityActivity.java | 123 ------------ .../securesms/VerifyIdentityActivity.java | 40 +--- .../VerifyImportedIdentityActivity.java | 180 ----------------- .../securesms/VerifyKeysActivity.java | 26 +-- .../crypto/AuthenticityCalculator.java | 62 ------ .../securesms/crypto/DecryptingQueue.java | 4 +- .../crypto/KeyExchangeProcessor.java | 27 +-- .../securesms/crypto/KeyUtil.java | 8 + .../securesms/database/DatabaseFactory.java | 55 +++++- .../securesms/database/IdentityDatabase.java | 137 +++++++++---- .../database/keys/SessionRecord.java | 32 +-- .../database/loaders/IdentityLoader.java | 26 +++ .../securesms/service/SmsReceiver.java | 2 +- 33 files changed, 497 insertions(+), 1019 deletions(-) create mode 100644 res/drawable-hdpi/ic_menu_unlock_holo_dark.png create mode 100644 res/drawable-mdpi/ic_menu_unlock_holo_dark.png create mode 100644 res/drawable-xhdpi/ic_menu_unlock_holo_dark.png create mode 100644 res/layout/review_identities_fragment.xml rename res/menu/{conversation_secure_verified.xml => conversation_secure_identity.xml} (74%) rename res/menu/{conversation_secure_unverified.xml => conversation_secure_no_identity.xml} (73%) delete mode 100644 src/org/thoughtcrime/securesms/KeyVerifyingActivity.java create mode 100644 src/org/thoughtcrime/securesms/ReviewIdentitiesFragment.java delete mode 100644 src/org/thoughtcrime/securesms/SaveIdentityActivity.java delete mode 100644 src/org/thoughtcrime/securesms/VerifyImportedIdentityActivity.java delete mode 100644 src/org/thoughtcrime/securesms/crypto/AuthenticityCalculator.java create mode 100644 src/org/thoughtcrime/securesms/database/loaders/IdentityLoader.java diff --git a/res/drawable-hdpi/ic_menu_unlock_holo_dark.png b/res/drawable-hdpi/ic_menu_unlock_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..5dd08281a168c9c31e302f06560846c8d26d309c GIT binary patch literal 1030 zcmV+h1o``kP)l*CBZ#^X zT!>w`2nvF_D~J}mC|W^m<_#(ol4?@Y*v!oRx_Hz4n0YUmnYgoWHS^BB=X=igoclfZ z!QJP-eQHY8+m1b#SD6OVAsvdN8uzG(EBcF@;qR%9JJx*wq*SPi2~P7Ik89KdTQ~Sl z3-QaaTJi5Zu+Izbsu{PrOIyZEA!hL6u0(B+N>s>0AaBI0+o806oFPAUY zJ-rW#X8i@nu|PDuq??uwGERbx#1B3_y_8bv51=}ruYC%E>?``fKXRR*W1QqA&k~U~ zd?B2jYAiC-J3uXoXZ)!KWt(sG3Tg7sq@fm?!+Mza{g@dbZF@*d>93yr={$ zRykMsrLsP0fT=jMHho#=wQd0;yl{MsegNVa4-pJa-lp1a_0N1x1WL?@kv;%wFwPMp zXs|H7)&a2M&u9X0n0^4F7-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$`&P+fpOFg+I}?X52?GV3A$mAAoW%OuCTB1 z3&ftyIPxR_GI-RqpV1<)T^Uw-Gc*ur8(ULrY;pj@lg#Lzkc@un56zQOkfH%ij~~o7 zOsVOwo@IK1k*w^}GHqYpe5%_tQD5`F2}-$v7TE6So9_)2`C|9nJ$Y_va5JKry%`03 l$;So1{y*G`Tk#!@{{!!h{S@Zs3y=T+002ovPDHLkV1lv&uE+oY literal 0 HcmV?d00001 diff --git a/res/layout/receive_key_activity.xml b/res/layout/receive_key_activity.xml index da80ea9d35..d442ff5b67 100644 --- a/res/layout/receive_key_activity.xml +++ b/res/layout/receive_key_activity.xml @@ -1,59 +1,48 @@ - - + - + - - - - - - -