From 1918c30bedb7f15ba38dab566848dc1fdac6368c Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sat, 23 Apr 2016 14:07:08 -0400 Subject: [PATCH] Wire up some of the security answers UI. Still WIP. --- .../ObjC/Mac/MPPasswordWindowController.h | 4 + .../ObjC/Mac/MPPasswordWindowController.m | 24 ++ .../ObjC/Mac/MPPasswordWindowController.xib | 244 +++++++++--------- 3 files changed, 156 insertions(+), 116 deletions(-) diff --git a/MasterPassword/ObjC/Mac/MPPasswordWindowController.h b/MasterPassword/ObjC/Mac/MPPasswordWindowController.h index 7bee11e6..e2259815 100644 --- a/MasterPassword/ObjC/Mac/MPPasswordWindowController.h +++ b/MasterPassword/ObjC/Mac/MPPasswordWindowController.h @@ -45,6 +45,10 @@ @property(nonatomic, strong) IBOutlet NSBox *passwordTypesBox; @property(nonatomic, weak) IBOutlet NSMatrix *passwordTypesMatrix; +@property(nonatomic, strong) IBOutlet NSBox *securityQuestionsBox; +@property(nonatomic, weak) IBOutlet NSTextField *securityQuestionField; +@property(nonatomic, weak) IBOutlet NSTextField *securityAnswerField; + - (BOOL)handleCommand:(SEL)commandSelector; @end diff --git a/MasterPassword/ObjC/Mac/MPPasswordWindowController.m b/MasterPassword/ObjC/Mac/MPPasswordWindowController.m index b92c4321..c8d9c26e 100644 --- a/MasterPassword/ObjC/Mac/MPPasswordWindowController.m +++ b/MasterPassword/ObjC/Mac/MPPasswordWindowController.m @@ -411,6 +411,30 @@ }]; } +- (IBAction)securityQuestions:(id)sender { + + MPSiteModel *site = self.selectedSite; + self.securityQuestionsBox.title = strf( @"Answer to security questions for %@:", site.name ); + + NSAlert *alert = [NSAlert new]; + [alert addButtonWithTitle:@"Copy Answer"]; + [alert addButtonWithTitle:@"Close"]; + [alert setMessageText:@"Security Questions"]; + [alert setAccessoryView:self.securityQuestionsBox]; + [alert layout]; + [alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) { + switch (returnCode) { + case NSAlertFirstButtonReturn: { + // "Copy Answer" button. + [self copyContent:self.securityAnswerField.stringValue]; + break; + } + default: + break; + } + }]; +} + #pragma mark - Private - (BOOL)handleCommand:(SEL)commandSelector { diff --git a/MasterPassword/ObjC/Mac/MPPasswordWindowController.xib b/MasterPassword/ObjC/Mac/MPPasswordWindowController.xib index d632cae7..77ec6fc4 100644 --- a/MasterPassword/ObjC/Mac/MPPasswordWindowController.xib +++ b/MasterPassword/ObjC/Mac/MPPasswordWindowController.xib @@ -15,6 +15,9 @@ + + + @@ -40,10 +43,10 @@ - + - + @@ -71,7 +74,7 @@ - + @@ -107,7 +110,7 @@ - - - + - - - + - - - @@ -513,7 +460,7 @@ - + @@ -770,6 +717,11 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. + + + NSNegateBoolean + + @@ -779,15 +731,10 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. NSNegateBoolean - - - NSNegateBoolean - - - + @@ -800,7 +747,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. - + @@ -890,6 +837,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. + NSNegateBoolean @@ -932,7 +880,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. - + @@ -943,6 +891,11 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. + + + NSNegateBoolean + + @@ -961,11 +914,6 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. NSNegateBoolean - - - NSNegateBoolean - - @@ -980,6 +928,11 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. + + + NSNegateBoolean + + @@ -998,15 +951,10 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. NSNegateBoolean - - - NSNegateBoolean - - - + @@ -1118,7 +1066,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. - + @@ -1129,6 +1077,11 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. + + + NSNegateBoolean + + @@ -1138,11 +1091,6 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. NSNegateBoolean - - - NSNegateBoolean - - @@ -1211,16 +1159,25 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. - + - + - - + + + + + "Personal password" allows you to store your own password. It cannot be regenerated in the event of loss. "Device private password" is similar but will never leave your device: it cannot be synced, backed up or exported. + + + + + + - + @@ -1263,30 +1220,85 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit. - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NSNegateBoolean + + + + + + + + - "Personal password" allows you to store your own password. It cannot be regenerated in the event of loss. "Device private password" is similar but will never leave your device: it cannot be synced, backed up or exported. + Security questions are invasive questions sites often ask you as a password fallback with the assumption that only you will know the true answer. Of course, all your other sites also know and when one gets hacked your private details are out in the wild. Security questions are a privacy invasion and gaping security hole into your accounts. Use these fake generated answers instead to protect yourself. + + + + + + + + + - - - - - - - + + + - - +