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.
This commit is contained in:
Moxie Marlinspike
2013-05-23 16:36:24 -07:00
parent ef7977128b
commit 24fc93e9ae
33 changed files with 497 additions and 1019 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1,59 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView android:id="@+id/ScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:background="@drawable/background_pattern_repeat">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dip">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center">
<TextView android:id="@+id/description_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="17dip"
android:layout_marginBottom="5dip" />
<TextView android:id="@+id/signature_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="17dip"
android:textStyle="italic"
android:layout_marginBottom="10dip" />
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button android:id="@+id/verify_session_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/receive_key_activity__session"
android:visibility="gone"
android:gravity="center" />
<LinearLayout android:paddingRight="16dip"
android:paddingLeft="16dip"
android:paddingTop="10dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<Button android:id="@+id/verify_identity_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/receive_key_activity__identities"
android:visibility="gone"
android:gravity="center" />
<Button android:id="@+id/ok_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/receive_key_activity__complete_exchange"
android:gravity="center"/>
<Button android:id="@+id/cancel_button"
android:text="@android:string/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
<TextView style="@style/Registration.Description"
android:id="@+id/description_text"
android:layout_width="fill_parent"
android:layout_marginBottom="16dip"
android:layout_marginTop="16dip"
android:text="@string/receive_key_activity__the_signature_on_this_key_exchange_is_different"/>
<LinearLayout android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_marginBottom="7dip"
android:orientation="horizontal">
<Button android:id="@+id/cancel_button"
android:text="@android:string/cancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<Button android:id="@+id/ok_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/receive_key_activity__complete"/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
</ScrollView>

View File

@@ -1,24 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingLeft="16dip"
android:paddingRight="16dip">
<ListView android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawSelectorOnTop="false"
android:scrollbarStyle="insideOverlay"
android:fadingEdgeLength="16dip" />
<TextView android:id="@id/android:empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/review_identities__you_don_t_currently_have_any_identity_keys_in_your_trust_database"
android:textAppearance="?android:attr/textAppearanceMedium"
android:padding="20dip" />
</LinearLayout>
<fragment android:id="@+id/fragment_content"
android:name="org.thoughtcrime.securesms.ReviewIdentitiesFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingLeft="16dip"
android:paddingRight="16dip">
<ListView android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawSelectorOnTop="false"
android:scrollbarStyle="insideOverlay"
android:fadingEdgeLength="16dip" />
<TextView android:id="@id/android:empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/review_identities__you_don_t_currently_have_any_identity_keys_in_your_trust_database"
android:textAppearance="?android:attr/textAppearanceMedium"
android:padding="20dip" />
</LinearLayout>

View File

@@ -2,7 +2,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="Security"
android:id="@+id/menu_security"
android:icon="@drawable/ic_menu_lock_holo_dark"
android:icon="@drawable/ic_menu_unlock_holo_dark"
android:showAsAction="ifRoom">
<menu>
<item android:title="@string/conversation_insecure__menu_start_secure_session"

View File

@@ -2,12 +2,9 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="@string/conversation_secure_verified__menu_security"
android:id="@+id/menu_security"
android:icon="@drawable/ic_menu_lock_verified_holo_dark"
android:icon="@drawable/ic_menu_lock_holo_dark"
android:showAsAction="ifRoom">
<menu>
<item android:title="@string/conversation_secure_verified__menu_verify_session"
android:id="@+id/menu_verify_session" />
<item android:title="@string/conversation_secure_verified__menu_verify_recipient"
android:id="@+id/menu_verify_recipient"/>

View File

@@ -2,15 +2,12 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="@string/conversation_secure_verified__menu_security"
android:id="@+id/menu_security"
android:icon="@drawable/ic_menu_lock_unverified_holo_dark"
android:icon="@drawable/ic_menu_lock_holo_dark"
android:showAsAction="ifRoom">
<menu>
<item android:title="@string/conversation_secure_verified__menu_verify_session"
android:id="@+id/menu_verify_session" />
<item android:title="@string/conversation_secure_verified__menu_verify_recipient"
android:id="@+id/menu_verify_recipient"/>
<item android:title="@string/conversation_secure_verified__menu_abort_secure_session"
android:id="@+id/menu_abort_session"/>

View File

@@ -316,8 +316,13 @@
<!-- receive_key_activity -->
<string name="receive_key_activity__session">Session</string>
<string name="receive_key_activity__identities">Identities</string>
<string name="receive_key_activity__complete_exchange">Complete Exchange</string>
<string name="receive_key_activity__complete">Complete</string>
<string name="receive_key_activity__the_signature_on_this_key_exchange_is_different">The
signature on this key exchange is different than what you\'ve previously received from this
contact. This could either mean that someone is trying to intercept your communication, or
that this contact simply re-installed TextSecure and now has a new identity key.
</string>
<!-- recipients_panel -->
<string name="recipients_panel__to">To</string>
@@ -473,7 +478,6 @@
<string name="conversation_list__menu_search">Search</string>
<!-- conversation_secure_verified -->
<!-- conversation_secure_unverified -->
<string name="conversation_secure_verified__menu_security">Security</string>
<string name="conversation_secure_verified__menu_verify_session">Verify Session</string>
<string name="conversation_secure_verified__menu_verify_recipient">Verify Recipient</string>
@@ -508,6 +512,9 @@
<!-- verify_keys -->
<string name="verify_keys__menu_verified">Verified</string>
<string name="ReceiveKeyActivity_you_may_wish_to_verify_this_contact">You may wish to verify
this contact.
</string>
<!-- Misc. piggybacking -->

View File

@@ -123,14 +123,6 @@
android:title="@string/preferences__view_my_identity_key"
android:summary="@string/preferences__view_my_identity_key"/>
<Preference android:key="pref_export_identity"
android:title="@string/preferences__export_my_identity_key"
android:summary="@string/preferences__export_my_identity_key"/>
<Preference android:key="pref_import_identity"
android:title="@string/preferences__import_contacts_key"
android:summary="@string/preferences__import_an_identity_key_from_a_contact"/>
<Preference android:key="pref_manage_identity"
android:title="@string/preferences__manage_identity_keys"
android:summary="@string/preferences__manage_configured_identity_keys"/>