From 80a8c392134a451872d2a4f6469152ade084db7a Mon Sep 17 00:00:00 2001 From: Frederic Jacobs Date: Fri, 12 Dec 2014 17:13:38 +0100 Subject: [PATCH] Debug: Logging new password creation. --- Podfile | 3 +-- Podfile.lock | 8 +++----- Pods | 2 +- Signal/src/environment/PropertyListPreferences.m | 1 - Signal/src/textsecure/Storage/TSStorageManager.m | 8 +++++--- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Podfile b/Podfile index ba3526195..8d9c6820e 100644 --- a/Podfile +++ b/Podfile @@ -4,7 +4,6 @@ inhibit_all_warnings! link_with ["Signal", "SignalTests"] -pod 'UICKeyChainStore', :podspec => 'Podspecs/UICKeyChainStore.podspec' pod 'SocketRocket', :git => 'https://github.com/square/SocketRocket.git', :commit => 'd0585af165' pod 'OpenSSL', '~> 1.0.110' pod 'libPhoneNumber-iOS', '~> 0.7' @@ -14,6 +13,6 @@ pod 'TwistedOakCollapsingFutures','~> 1.0' pod 'YapDatabase/SQLCipher' pod 'AFNetworking', '~> 2.5' pod 'Mantle', '~> 1.5' - +pod 'SSKeychain' pod 'JSQMessagesViewController', :git => 'https://github.com/dtsbourg/JSQMessagesViewController', :branch => 'JSignalQ' pod 'DJWActionSheet' diff --git a/Podfile.lock b/Podfile.lock index 56e8c0f0d..8f4d3c06f 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -47,9 +47,9 @@ PODS: - SQLCipher/common (3.1.0) - SQLCipher/fts (3.1.0): - SQLCipher/common + - SSKeychain (1.2.2) - TwistedOakCollapsingFutures (1.0.0): - UnionFind (~> 1.0) - - UICKeyChainStore (1.0.7) - UnionFind (1.0.1) - YapDatabase/common (2.5.4): - CocoaLumberjack (~> 1) @@ -67,8 +67,8 @@ DEPENDENCIES: - OpenSSL (~> 1.0.110) - PastelogKit (~> 1.2) - SocketRocket (from `https://github.com/square/SocketRocket.git`, commit `d0585af165`) + - SSKeychain - TwistedOakCollapsingFutures (~> 1.0) - - UICKeyChainStore (from `Podspecs/UICKeyChainStore.podspec`) - YapDatabase/SQLCipher EXTERNAL SOURCES: @@ -78,8 +78,6 @@ EXTERNAL SOURCES: SocketRocket: :commit: d0585af165 :git: https://github.com/square/SocketRocket.git - UICKeyChainStore: - :podspec: Podspecs/UICKeyChainStore.podspec CHECKOUT OPTIONS: JSQMessagesViewController: @@ -105,8 +103,8 @@ SPEC CHECKSUMS: ProtocolBuffers: a834d6fe4ae0cc94d081b864e4948bdd483ad228 SocketRocket: 9cbe08469513356cddc0afcab1ff160bd190296a SQLCipher: 981110217eb93c2779c34fb59e646a1c1da918d8 + SSKeychain: cc48bd3ad24fcd9125adb9e0d23dd50b8bbd08b9 TwistedOakCollapsingFutures: 07aab84fd3958dc94d55ef705b12857d9fbe61d1 - UICKeyChainStore: eef407137f0397e95a3df32cdf05f7e2ddd99647 UnionFind: 45777a8b6878d3a602af3654cc3a09b87389d356 YapDatabase: c1d6912df1b4a160f7373ee7657d360e29bb00fd diff --git a/Pods b/Pods index 9601c2be9..a8bebaaf7 160000 --- a/Pods +++ b/Pods @@ -1 +1 @@ -Subproject commit 9601c2be9292f740e40d530ec35ea7182d0a8441 +Subproject commit a8bebaaf7290b4aa90621250a3ed64d9cb47da21 diff --git a/Signal/src/environment/PropertyListPreferences.m b/Signal/src/environment/PropertyListPreferences.m index 2847d07de..568adfb9e 100644 --- a/Signal/src/environment/PropertyListPreferences.m +++ b/Signal/src/environment/PropertyListPreferences.m @@ -1,6 +1,5 @@ #import "PropertyListPreferences.h" #import "Constraints.h" -#import #import "TSStorageManager.h" #define SignalDatabaseCollection @"SignalPreferences" diff --git a/Signal/src/textsecure/Storage/TSStorageManager.m b/Signal/src/textsecure/Storage/TSStorageManager.m index 29d09e9bc..955df1f2f 100644 --- a/Signal/src/textsecure/Storage/TSStorageManager.m +++ b/Signal/src/textsecure/Storage/TSStorageManager.m @@ -10,10 +10,10 @@ #import #import #import -#import #import "CryptoTools.h" #import "NSData+Base64.h" +#import #import "TSDatabaseView.h" @@ -138,11 +138,13 @@ static NSString * keychainDBPassAccount = @"TSDatabasePass"; } - (NSString*)databasePassword { - NSString *dbPassword = [UICKeyChainStore stringForKey:keychainDBPassAccount]; + [SSKeychain setAccessibilityType:kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly]; + NSString *dbPassword = [SSKeychain passwordForService:keychainService account:keychainDBPassAccount]; if (!dbPassword) { dbPassword = [[CryptoTools generateSecureRandomData:30] base64EncodedString]; - [UICKeyChainStore setString:dbPassword forKey:keychainDBPassAccount]; + [SSKeychain setPassword:dbPassword forService:keychainService account:keychainDBPassAccount]; + DDLogError(@"Set new password from keychain ..."); } return dbPassword;