Some identity key handling changes

1) Prefetch identity keys when possible

2) Always accept prefetched keys or keys from incoming messages

3) Block sending only if it's a recent change, or if always
   block is enabled

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-05-19 18:01:40 -07:00
parent ca701df1e4
commit d507756821
19 changed files with 476 additions and 248 deletions

View File

@@ -79,7 +79,7 @@ public class TextSecurePreferences {
private static final String UPDATE_APK_DIGEST = "pref_update_apk_digest";
private static final String SIGNED_PREKEY_ROTATION_TIME_PREF = "pref_signed_pre_key_rotation_time";
private static final String IN_THREAD_NOTIFICATION_PREF = "pref_key_inthread_notifications";
private static final String BLOCKING_IDENTITY_CHANGES_PREF = "pref_blocking_identity_changes";
private static final String APPROVAL_IDENTITY_CHANGES_PREF = "pref_approve_identity_changes";
private static final String SHOW_INVITE_REMINDER_PREF = "pref_show_invite_reminder";
public static final String MESSAGE_BODY_TEXT_SIZE_PREF = "pref_message_body_text_size";
@@ -156,12 +156,12 @@ public class TextSecurePreferences {
return getBooleanPreference(context, MULTI_DEVICE_PROVISIONED_PREF, false);
}
public static boolean isBlockingIdentityUpdates(Context context) {
return getBooleanPreference(context, BLOCKING_IDENTITY_CHANGES_PREF, true);
public static boolean isSendingIdentityApprovalRequired(Context context) {
return getBooleanPreference(context, APPROVAL_IDENTITY_CHANGES_PREF, false);
}
public static void setBlockingIdentityUpdates(Context context, boolean value) {
setBooleanPreference(context, BLOCKING_IDENTITY_CHANGES_PREF, value);
public static void setSendingIdentityApprovalRequired(Context context, boolean value) {
setBooleanPreference(context, APPROVAL_IDENTITY_CHANGES_PREF, value);
}
public static void setSignedPreKeyFailureCount(Context context, int value) {