From 2dba4c87ba2ad96dc01fcaaddeba93075bc5d85a Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Wed, 27 Jun 2012 14:57:05 +0200 Subject: [PATCH] Small build fixes. [FIXED] Linker warning about PIE. [UPDATED] Login failed is no longer recorded when login attempt was not using a password (noisy). --- MasterPassword-iOS.xcodeproj/project.pbxproj | 6 ------ .../xcschemes/MasterPassword (Development).xcscheme | 6 +++--- MasterPassword/MPAppDelegate_Key.m | 10 ++++++---- MasterPassword/MPTypes.m | 3 ++- MasterPassword/iOS/MPSearchDelegate.h | 2 +- MasterPassword/iOS/MPUnlockViewController.m | 12 ++++++------ MasterPassword/iOS/MainStoryboard_iPhone.storyboard | 5 ----- 7 files changed, 18 insertions(+), 26 deletions(-) diff --git a/MasterPassword-iOS.xcodeproj/project.pbxproj b/MasterPassword-iOS.xcodeproj/project.pbxproj index 80858c0e..39935768 100644 --- a/MasterPassword-iOS.xcodeproj/project.pbxproj +++ b/MasterPassword-iOS.xcodeproj/project.pbxproj @@ -4324,7 +4324,6 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Maarten Billemont (DWGU95U4ZD)"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -4384,7 +4383,6 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Maarten Billemont"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "ADHOC=1", @@ -4439,7 +4437,6 @@ "$(inherited)", "\"$(SRCROOT)/Crashlytics\"", ); - GCC_DYNAMIC_NO_PIC = YES; GCC_PREFIX_HEADER = "MasterPassword/iOS/MasterPassword-Prefix.pch"; INFOPLIST_FILE = "MasterPassword/iOS/MasterPassword-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.0; @@ -4462,7 +4459,6 @@ "$(inherited)", "\"$(SRCROOT)/Crashlytics\"", ); - GCC_DYNAMIC_NO_PIC = YES; GCC_PREFIX_HEADER = "MasterPassword/iOS/MasterPassword-Prefix.pch"; INFOPLIST_FILE = "MasterPassword/iOS/MasterPassword-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.0; @@ -4533,7 +4529,6 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Maarten Billemont"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "APPSTORE=1", @@ -4588,7 +4583,6 @@ "$(inherited)", "\"$(SRCROOT)/Crashlytics\"", ); - GCC_DYNAMIC_NO_PIC = YES; GCC_PREFIX_HEADER = "MasterPassword/iOS/MasterPassword-Prefix.pch"; INFOPLIST_FILE = "MasterPassword/iOS/MasterPassword-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.0; diff --git a/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword (Development).xcscheme b/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword (Development).xcscheme index ae7cf536..59535f3b 100644 --- a/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword (Development).xcscheme +++ b/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword (Development).xcscheme @@ -40,11 +40,11 @@ diff --git a/MasterPassword/MPAppDelegate_Key.m b/MasterPassword/MPAppDelegate_Key.m index abed621a..195c184b 100644 --- a/MasterPassword/MPAppDelegate_Key.m +++ b/MasterPassword/MPAppDelegate_Key.m @@ -128,12 +128,14 @@ static NSDictionary *keyQuery(MPUserEntity *user) { // No more methods left, fail if key still not known. if (!tryKey) { - inf(@"Login failed for: %@", user.userID); - + if (password) { + inf(@"Login failed for: %@", user.userID); + #ifdef TESTFLIGHT_SDK_VERSION - [TestFlight passCheckpoint:MPCheckpointSignInFailed]; + [TestFlight passCheckpoint:MPCheckpointSignInFailed]; #endif - [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointSignInFailed attributes:nil]; + [[LocalyticsSession sharedLocalyticsSession] tagEvent:MPCheckpointSignInFailed attributes:nil]; + } return NO; } diff --git a/MasterPassword/MPTypes.m b/MasterPassword/MPTypes.m index f883ce11..c418e67f 100644 --- a/MasterPassword/MPTypes.m +++ b/MasterPassword/MPTypes.m @@ -18,6 +18,7 @@ NSData *keyForPassword(NSString *password, NSString *username) { uint32_t nusernameLength = htonl(username.length); + NSDate *start = [NSDate date]; NSData *key = [PearlSCrypt deriveKeyWithLength:MP_dkLen fromPassword:[password dataUsingEncoding:NSUTF8StringEncoding] usingSalt:[NSData dataByConcatenatingDatas: [@"com.lyndir.masterpassword" dataUsingEncoding:NSUTF8StringEncoding], @@ -26,7 +27,7 @@ NSData *keyForPassword(NSString *password, NSString *username) { [username dataUsingEncoding:NSUTF8StringEncoding], nil] N:MP_N r:MP_r p:MP_p]; - trc(@"User: %@, password: %@ derives to key ID: %@", username, password, [keyIDForKey(key) encodeHex]); + trc(@"User: %@, password: %@ derives to key ID: %@ (took %0.2f)", username, password, [keyIDForKey(key) encodeHex], -[start timeIntervalSinceNow]); return key; } diff --git a/MasterPassword/iOS/MPSearchDelegate.h b/MasterPassword/iOS/MPSearchDelegate.h index be40352f..beb9b54c 100644 --- a/MasterPassword/iOS/MPSearchDelegate.h +++ b/MasterPassword/iOS/MPSearchDelegate.h @@ -23,7 +23,7 @@ @property (strong, nonatomic) UILabel *tipView; @property (weak, nonatomic) IBOutlet id delegate; -@property (weak, nonatomic) IBOutlet UISearchDisplayController *searchDisplayController; +@property (strong, nonatomic) IBOutlet UISearchDisplayController *searchDisplayController; @property (weak, nonatomic) IBOutlet UIView *searchTipContainer; @end diff --git a/MasterPassword/iOS/MPUnlockViewController.m b/MasterPassword/iOS/MPUnlockViewController.m index 02031e3c..d7eaf403 100644 --- a/MasterPassword/iOS/MPUnlockViewController.m +++ b/MasterPassword/iOS/MPUnlockViewController.m @@ -418,15 +418,15 @@ BOOL unlocked = [[MPAppDelegate get] signInAsUser:self.selectedUser usingMasterPassword:self.passwordField.text]; dispatch_async(dispatch_get_main_queue(), ^{ - if (unlocked) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (long)(NSEC_PER_SEC * 0.5f)), dispatch_get_main_queue(), ^{ - [self dismissViewControllerAnimated:YES completion:nil]; - }); - } else + if (unlocked) + [self dismissViewControllerAnimated:YES completion:nil]; + + else { if (self.passwordField.text.length) [self setPasswordTip:@"Incorrect password."]; - [self setSpinnerActive:NO]; + [self setSpinnerActive:NO]; + } }); }); } diff --git a/MasterPassword/iOS/MainStoryboard_iPhone.storyboard b/MasterPassword/iOS/MainStoryboard_iPhone.storyboard index de7b085e..f4c63c6c 100644 --- a/MasterPassword/iOS/MainStoryboard_iPhone.storyboard +++ b/MasterPassword/iOS/MainStoryboard_iPhone.storyboard @@ -936,10 +936,6 @@ L4m3P4sSw0rD - @@ -1336,7 +1332,6 @@ L4m3P4sSw0rD -