Index: .gitignore ================================================================== --- .gitignore +++ .gitignore @@ -1,3 +1,8 @@ *.o *~ scrypt-pwgen +iOS/DerivedData +iOS/ObjFW.framework +iOS/ObjFW_Bridge.framework +iOS/scrypt-pwgen.xcodeproj/project.xcworkspace +iOS/scrypt-pwgen.xcodeproj/xcuserdata ADDED iOS/AddSiteController.h Index: iOS/AddSiteController.h ================================================================== --- iOS/AddSiteController.h +++ iOS/AddSiteController.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2016, Jonathan Schleifer + * + * https://heap.zone/git/?p=scrypt-pwgen.git + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +@import UIKit; + +#import "MainViewController.h" + +@interface AddSiteController: UITableViewController +@property (retain, nonatomic) IBOutlet UITextField *nameField; +@property (retain, nonatomic) IBOutlet UITextField *lengthField; +@property (retain, nonatomic) IBOutlet UISwitch *legacySwitch; +@property (retain) MainViewController *mainViewController; + +- (IBAction)done: (id)sender; +- (IBAction)cancel: (id)sender; +@end ADDED iOS/AddSiteController.m Index: iOS/AddSiteController.m ================================================================== --- iOS/AddSiteController.m +++ iOS/AddSiteController.m @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2016, Jonathan Schleifer + * + * https://heap.zone/git/?p=scrypt-pwgen.git + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +@import ObjFW_Bridge; + +#import "AddSiteController.h" + +static void +showAlert(UIViewController *controller, NSString *title, NSString *message) +{ + UIAlertController *alert = [UIAlertController + alertControllerWithTitle: title + message: message + preferredStyle: UIAlertControllerStyleAlert]; + [alert addAction: + [UIAlertAction actionWithTitle: @"OK" + style: UIAlertActionStyleDefault + handler: nil]]; + + [controller presentViewController: alert + animated: YES + completion: nil]; +} + +@implementation AddSiteController +- (void)dealloc +{ + [_nameField release]; + [_lengthField release]; + [_legacySwitch release]; + [_mainViewController release]; + + [super dealloc]; +} + +- (IBAction)done: (id)sender +{ + OFString *name = [self.nameField.text OFObject]; + OFString *lengthStr = [self.lengthField.text OFObject]; + bool lengthValid = true; + size_t length; + + if ([name length] == 0) { + showAlert(self, @"Name missing", @"Please enter a name."); + return; + } + + @try { + length = (size_t)[lengthStr decimalValue]; + + if (length < 3 || length > 64) + lengthValid = false; + } @catch (OFInvalidFormatException *e) { + lengthValid = false; + } + + if (!lengthValid) { + showAlert(self, @"Invalid length", + @"Please enter a number between 3 and 64."); + return; + } + + if ([self.mainViewController.siteStorage hasSite: name]) { + showAlert(self, @"Site Already Exists", + @"Please pick a name that does not exist yet."); + return; + } + + [self.mainViewController.siteStorage + setSite: name + length: length + legacy: self.legacySwitch.enabled]; + + [self.mainViewController.tableView reloadData]; + + [self.navigationController popViewControllerAnimated: YES]; +} + +- (IBAction)cancel: (id)sender +{ + [self.navigationController popViewControllerAnimated: YES]; +} +@end ADDED iOS/AppDelegate.h Index: iOS/AppDelegate.h ================================================================== --- iOS/AppDelegate.h +++ iOS/AppDelegate.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2016, Jonathan Schleifer + * + * https://heap.zone/git/?p=scrypt-pwgen.git + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +@import UIKit; + +@interface AppDelegate: UIResponder +@property (strong, nonatomic) UIWindow *window; +@end ADDED iOS/AppDelegate.m Index: iOS/AppDelegate.m ================================================================== --- iOS/AppDelegate.m +++ iOS/AppDelegate.m @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2016, Jonathan Schleifer + * + * https://heap.zone/git/?p=scrypt-pwgen.git + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#import "AppDelegate.h" + +@implementation AppDelegate +@end ADDED iOS/Assets.xcassets/AppIcon.appiconset/Contents.json Index: iOS/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================================== --- iOS/Assets.xcassets/AppIcon.appiconset/Contents.json +++ iOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,48 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} ADDED iOS/Base.lproj/LaunchScreen.storyboard Index: iOS/Base.lproj/LaunchScreen.storyboard ================================================================== --- iOS/Base.lproj/LaunchScreen.storyboard +++ iOS/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ADDED iOS/Base.lproj/Main.storyboard Index: iOS/Base.lproj/Main.storyboard ================================================================== --- iOS/Base.lproj/Main.storyboard +++ iOS/Base.lproj/Main.storyboard @@ -0,0 +1,418 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ADDED iOS/Info.plist Index: iOS/Info.plist ================================================================== --- iOS/Info.plist +++ iOS/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + ADDED iOS/MainViewController.h Index: iOS/MainViewController.h ================================================================== --- iOS/MainViewController.h +++ iOS/MainViewController.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2016, Jonathan Schleifer + * + * https://heap.zone/git/?p=scrypt-pwgen.git + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +@import UIKit; + +#import "SiteStorage.h" + +@interface MainViewController: UIViewController +@property (retain) SiteStorage *siteStorage; +@property (retain, nonatomic) IBOutlet UITableView *tableView; +@end ADDED iOS/MainViewController.m Index: iOS/MainViewController.m ================================================================== --- iOS/MainViewController.m +++ iOS/MainViewController.m @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2016, Jonathan Schleifer + * + * https://heap.zone/git/?p=scrypt-pwgen.git + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +@import ObjFW_Bridge; + +#import "MainViewController.h" + +#import "AddSiteController.h" +#import "ShowDetailsController.h" + +@implementation MainViewController +- (void)viewDidLoad +{ + _siteStorage = [[SiteStorage alloc] init]; +} + +- (void)dealloc +{ + [_siteStorage release]; + [_tableView release]; + + [super dealloc]; +} + +- (NSInteger)tableView: (UITableView*)tableView + numberOfRowsInSection: (NSInteger)section +{ + return [self.siteStorage sitesCount]; +} + +- (UITableViewCell*)tableView: (UITableView*)tableView + cellForRowAtIndexPath: (NSIndexPath*)indexPath +{ + UITableViewCell *cell = [tableView + dequeueReusableCellWithIdentifier: @"site"]; + + if (cell == nil) + cell = [[[UITableViewCell alloc] + initWithStyle: UITableViewCellStyleDefault + reuseIdentifier: @"site"] autorelease]; + + cell.textLabel.text = [self.siteStorage.sites[indexPath.row] NSObject]; + + return cell; +} + +- (void)tableView: (UITableView*)tableView + didSelectRowAtIndexPath: (NSIndexPath*)indexPath +{ + [self performSegueWithIdentifier: @"showDetails" + sender: self]; +} + +- (void)prepareForSegue: (UIStoryboardSegue*)segue + sender: (id)sender +{ + if ([segue.identifier isEqual: @"addSite"] || + [segue.identifier isEqual: @"showDetails"]) + [segue.destinationViewController setMainViewController: self]; +} +@end ADDED iOS/ShowDetailsController.h Index: iOS/ShowDetailsController.h ================================================================== --- iOS/ShowDetailsController.h +++ iOS/ShowDetailsController.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016, Jonathan Schleifer + * + * https://heap.zone/git/?p=scrypt-pwgen.git + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +@import UIKit; + +#import "MainViewController.h" + +@interface ShowDetailsController: UITableViewController +{ + OFString *_name; + size_t _length; + bool _legacy; +} + +@property (retain, nonatomic) IBOutlet UITextField *nameField; +@property (retain, nonatomic) IBOutlet UITextField *lengthField; +@property (retain, nonatomic) IBOutlet UISwitch *legacySwitch; +@property (retain, nonatomic) IBOutlet UITextField *passphraseField; +@property (retain) MainViewController *mainViewController; +@end ADDED iOS/ShowDetailsController.m Index: iOS/ShowDetailsController.m ================================================================== --- iOS/ShowDetailsController.m +++ iOS/ShowDetailsController.m @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2016, Jonathan Schleifer + * + * https://heap.zone/git/?p=scrypt-pwgen.git + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +@import ObjFW; +@import ObjFW_Bridge; + +#import "ShowDetailsController.h" + +#import "SiteStorage.h" +#import "PasswordGenerator.h" +#import "NewPasswordGenerator.h" +#import "LegacyPasswordGenerator.h" + +@interface ShowDetailsController () +- (NSMutableString*)_generate; +- (void)_generateAndCopy; +- (void)_generateAndShow; +@end + +static void +clearNSMutableString(NSMutableString *string) +{ + /* + * NSMutableString does not offer a way to zero the string. + * This is in the hope that setting a single character at an index just + * replaces that character in memory, and thus allows us to zero the + * password. + */ + for (NSUInteger i = 0 ; i < string.length; i++) + [string replaceCharactersInRange: NSMakeRange(i, 1) + withString: @" "]; +} + +@implementation ShowDetailsController +- (void)dealloc +{ + [_name release]; + [_nameField release]; + [_lengthField release]; + [_legacySwitch release]; + [_passphraseField release]; + + [super dealloc]; +} + +- (void)viewWillAppear: (BOOL)animated +{ + SiteStorage *siteStorage = self.mainViewController.siteStorage; + NSInteger row = + self.mainViewController.tableView.indexPathForSelectedRow.row; + + [_name release]; + _name = [siteStorage.sites[row] retain]; + _length = [siteStorage lengthForSite: _name]; + _legacy = [siteStorage isSiteLegacy: _name]; + + self.nameField.text = [_name NSObject]; + self.lengthField.text = [NSString stringWithFormat: @"%zu", _length]; + self.legacySwitch.enabled = _legacy; +} + +- (void)viewDidAppear: (BOOL)animated +{ + [self.passphraseField becomeFirstResponder]; +} + +- (BOOL)textFieldShouldReturn: (UITextField*)textField +{ + [textField resignFirstResponder]; + return NO; +} + +- (void)tableView: (UITableView*)tableView + didSelectRowAtIndexPath: (NSIndexPath*)indexPath +{ + [self.passphraseField resignFirstResponder]; + [tableView deselectRowAtIndexPath: indexPath + animated: YES]; + + if (indexPath.section == 3) { + switch (indexPath.row) { + case 0: + [self _generateAndCopy]; + break; + case 1: + [self _generateAndShow]; + break; + } + } +} + +- (void)_generateAndCopy +{ + NSMutableString *password = [self _generate]; + + UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard]; + pasteBoard.string = password; + + clearNSMutableString(password); + + UIAlertController *alert = [UIAlertController + alertControllerWithTitle: @"Password Generated" + message: @"The password has been copied into the " + @"clipboard." + preferredStyle: UIAlertControllerStyleAlert]; + [alert addAction: + [UIAlertAction actionWithTitle: @"OK" + style: UIAlertActionStyleDefault + handler: nil]]; + + [self presentViewController: alert + animated: YES + completion: nil]; +} + +- (void)_generateAndShow +{ + NSMutableString *password = [self _generate]; + + UIAlertController *alert = [UIAlertController + alertControllerWithTitle: @"Generated Passphrase" + message: password + preferredStyle: UIAlertControllerStyleAlert]; + [alert addAction: + [UIAlertAction actionWithTitle: @"OK" + style: UIAlertActionStyleDefault + handler: nil]]; + + [self presentViewController: alert + animated: YES + completion: ^ { + clearNSMutableString(password); + }]; +} + +- (NSMutableString*)_generate +{ + id generator; + char *passphrase; + + if (_legacy) + generator = [LegacyPasswordGenerator generator]; + else + generator = [NewPasswordGenerator generator]; + + generator.site = _name; + generator.length = _length; + + passphrase = of_strdup([self.passphraseField.text UTF8String]); + @try { + self.passphraseField.text = @""; + generator.passphrase = passphrase; + + [generator derivePassword]; + } @finally { + of_explicit_memset(passphrase, 0, strlen(passphrase)); + free(passphrase); + } + + NSMutableString *password = [NSMutableString + stringWithUTF8String: (char*)generator.output]; + of_explicit_memset(generator.output, 0, + strlen((char*)generator.output)); + + return password; +} +@end ADDED iOS/SiteStorage.h Index: iOS/SiteStorage.h ================================================================== --- iOS/SiteStorage.h +++ iOS/SiteStorage.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2016, Jonathan Schleifer + * + * https://heap.zone/git/?p=scrypt-pwgen.git + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +@import ObjFW; + +@interface SiteStorage: OFObject +{ + OFString *_path; + OFMutableDictionary *> + *_storage; + OFArray *_sites; +} + +- (OFArray*)sites; +- (size_t)sitesCount; +- (bool)hasSite: (OFString*)name; +- (size_t)lengthForSite: (OFString*)name; +- (bool)isSiteLegacy: (OFString*)name; +- (void)setSite: (OFString*)site + length: (size_t)length + legacy: (bool)legacy; +- (void)removeSite: (OFString*)name; +@end ADDED iOS/SiteStorage.m Index: iOS/SiteStorage.m ================================================================== --- iOS/SiteStorage.m +++ iOS/SiteStorage.m @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2016, Jonathan Schleifer + * + * https://heap.zone/git/?p=scrypt-pwgen.git + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +@import ObjFW; + +/* For literals and boxing. */ +@compatibility_alias NSDictionary OFDictionary; +@compatibility_alias NSNumber OFNumber; + +#import "SiteStorage.h" + +@interface SiteStorage () +- (void)_update; +@end + +static OFNumber *lengthField, *legacyField; + +@implementation SiteStorage ++ (void)initialize +{ + lengthField = [@(UINT8_C(0)) retain]; + legacyField = [@(UINT8_C(1)) retain]; +} + +- init +{ + self = [super init]; + + @try { + void *pool = objc_autoreleasePoolPush(); + OFFileManager *fileManager = [OFFileManager defaultManager]; + OFString *userDataPath = [OFSystemInfo userDataPath]; + + if (![fileManager directoryExistsAtPath: userDataPath]) + [fileManager createDirectoryAtPath: userDataPath]; + + _path = [[userDataPath stringByAppendingPathComponent: + @"sites.msgpack"] retain]; + + @try { + _storage = [[[OFDataArray + dataArrayWithContentsOfFile: _path] + messagePackValue] mutableCopy]; + } @catch (id e) { + _storage = [[OFMutableDictionary alloc] init]; + } + + _sites = [[[_storage allKeys] sortedArray] retain]; + + objc_autoreleasePoolPop(pool); + } @catch (id e) { + [self release]; + @throw e; + } + + return self; +} + +- (void)dealloc +{ + [_path release]; + [_storage release]; + [_sites release]; + + [super dealloc]; +} + +- (OFArray*)sites +{ + void *pool = objc_autoreleasePoolPush(); + OFArray *sites = [[_storage allKeys] sortedArray]; + + [sites retain]; + objc_autoreleasePoolPop(pool); + return [sites autorelease]; +} + +- (size_t)sitesCount +{ + return [_storage count]; +} + +- (bool)hasSite: (OFString*)name +{ + return (_storage[name] != nil); +} + +- (size_t)lengthForSite: (OFString*)name +{ + OFDictionary *site = _storage[name]; + + if (site == nil) + @throw [OFInvalidArgumentException exception]; + + return [site[lengthField] sizeValue]; +} + +- (bool)isSiteLegacy: (OFString*)name +{ + OFDictionary *site = _storage[name]; + + if (site == nil) + @throw [OFInvalidArgumentException exception]; + + return [site[legacyField] boolValue]; +} + +- (void)setSite: (OFString*)site + length: (size_t)length + legacy: (bool)legacy +{ + void *pool = objc_autoreleasePoolPush(); + + _storage[site] = @{ + lengthField: @(length), + legacyField: @(legacy) + }; + [self _update]; + + objc_autoreleasePoolPop(pool); +} + +- (void)removeSite: (OFString*)name +{ + [_storage removeObjectForKey: name]; + [self _update]; +} + +- (void)_update +{ + void *pool = objc_autoreleasePoolPush(); + + [[_storage messagePackRepresentation] writeToFile: _path]; + + [_sites release]; + _sites = [[[_storage allKeys] sortedArray] retain]; + + objc_autoreleasePoolPop(pool); +} +@end ADDED iOS/main.m Index: iOS/main.m ================================================================== --- iOS/main.m +++ iOS/main.m @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2016, Jonathan Schleifer + * + * https://heap.zone/git/?p=scrypt-pwgen.git + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +@import ObjFW; +@import UIKit; + +#import "AppDelegate.h" + +@interface OFAppDelegate: OFObject +@end + +OF_APPLICATION_DELEGATE(OFAppDelegate) + +@implementation OFAppDelegate +- (void)applicationDidFinishLaunching +{ + int *argc; + char ***argv; + int status; + + [[OFApplication sharedApplication] + getArgumentCount: &argc + andArgumentValues: &argv]; + + status = UIApplicationMain(*argc, *argv, nil, + NSStringFromClass([AppDelegate class])); + + [OFApplication terminateWithStatus: status]; +} +@end ADDED iOS/scrypt-pwgen.xcodeproj/project.pbxproj Index: iOS/scrypt-pwgen.xcodeproj/project.pbxproj ================================================================== --- iOS/scrypt-pwgen.xcodeproj/project.pbxproj +++ iOS/scrypt-pwgen.xcodeproj/project.pbxproj @@ -0,0 +1,404 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 4B0719251DAA78D80065997A /* ShowDetailsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B0719241DAA78D80065997A /* ShowDetailsController.m */; }; + 4B2E52E11DA942840040D091 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2E52E01DA942840040D091 /* main.m */; }; + 4B2E52E41DA942840040D091 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2E52E31DA942840040D091 /* AppDelegate.m */; }; + 4B2E52E71DA942840040D091 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B2E52E61DA942840040D091 /* MainViewController.m */; }; + 4B2E52EA1DA942840040D091 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4B2E52E81DA942840040D091 /* Main.storyboard */; }; + 4B2E52EC1DA942840040D091 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4B2E52EB1DA942840040D091 /* Assets.xcassets */; }; + 4B2E52EF1DA942840040D091 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4B2E52ED1DA942840040D091 /* LaunchScreen.storyboard */; }; + 4BA115D21DA9432D007ED4EA /* LegacyPasswordGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA115CE1DA9432D007ED4EA /* LegacyPasswordGenerator.m */; settings = {COMPILER_FLAGS = "-fconstant-string-class=OFConstantString -fno-constant-cfstrings"; }; }; + 4BA115D31DA9432D007ED4EA /* NewPasswordGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BA115D01DA9432D007ED4EA /* NewPasswordGenerator.m */; settings = {COMPILER_FLAGS = "-fconstant-string-class=OFConstantString -fno-constant-cfstrings"; }; }; + 4BA115D61DA94390007ED4EA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BA115D51DA94390007ED4EA /* UIKit.framework */; }; + 4BB3CDF41DA967C100FEE5ED /* ObjFW.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BB3CDF31DA967C100FEE5ED /* ObjFW.framework */; }; + 4BB3CDF51DA967C100FEE5ED /* ObjFW.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4BB3CDF31DA967C100FEE5ED /* ObjFW.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 4BB3CDFD1DA9764300FEE5ED /* AddSiteController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB3CDFC1DA9764300FEE5ED /* AddSiteController.m */; }; + 4BF4ADEA1DA9A3DB0073B995 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BF4ADE91DA9A3DB0073B995 /* Foundation.framework */; }; + 4BF4ADED1DA9A6B00073B995 /* SiteStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BF4ADEC1DA9A6B00073B995 /* SiteStorage.m */; settings = {COMPILER_FLAGS = "-fconstant-string-class=OFConstantString -fno-constant-cfstrings"; }; }; + 4BF720731DA9C6E3001340C3 /* ObjFW_Bridge.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BF720721DA9C6E3001340C3 /* ObjFW_Bridge.framework */; }; + 4BF720741DA9C6E3001340C3 /* ObjFW_Bridge.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4BF720721DA9C6E3001340C3 /* ObjFW_Bridge.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 4BB3CDF61DA967C100FEE5ED /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 4BF720741DA9C6E3001340C3 /* ObjFW_Bridge.framework in Embed Frameworks */, + 4BB3CDF51DA967C100FEE5ED /* ObjFW.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 4B0719231DAA78D80065997A /* ShowDetailsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShowDetailsController.h; sourceTree = ""; }; + 4B0719241DAA78D80065997A /* ShowDetailsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShowDetailsController.m; sourceTree = ""; }; + 4B2E52DC1DA942840040D091 /* scrypt-pwgen.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "scrypt-pwgen.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 4B2E52E01DA942840040D091 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 4B2E52E21DA942840040D091 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 4B2E52E31DA942840040D091 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 4B2E52E51DA942840040D091 /* MainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; + 4B2E52E61DA942840040D091 /* MainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; + 4B2E52E91DA942840040D091 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 4B2E52EB1DA942840040D091 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 4B2E52EE1DA942840040D091 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 4B2E52F01DA942840040D091 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 4BA115CD1DA9432D007ED4EA /* LegacyPasswordGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LegacyPasswordGenerator.h; path = ../LegacyPasswordGenerator.h; sourceTree = ""; }; + 4BA115CE1DA9432D007ED4EA /* LegacyPasswordGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LegacyPasswordGenerator.m; path = ../LegacyPasswordGenerator.m; sourceTree = ""; }; + 4BA115CF1DA9432D007ED4EA /* NewPasswordGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NewPasswordGenerator.h; path = ../NewPasswordGenerator.h; sourceTree = ""; }; + 4BA115D01DA9432D007ED4EA /* NewPasswordGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NewPasswordGenerator.m; path = ../NewPasswordGenerator.m; sourceTree = ""; }; + 4BA115D11DA9432D007ED4EA /* PasswordGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PasswordGenerator.h; path = ../PasswordGenerator.h; sourceTree = ""; }; + 4BA115D51DA94390007ED4EA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 4BB3CDF31DA967C100FEE5ED /* ObjFW.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ObjFW.framework; sourceTree = ""; }; + 4BB3CDFB1DA9764300FEE5ED /* AddSiteController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddSiteController.h; sourceTree = ""; }; + 4BB3CDFC1DA9764300FEE5ED /* AddSiteController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddSiteController.m; sourceTree = ""; }; + 4BF4ADE91DA9A3DB0073B995 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 4BF4ADEB1DA9A6B00073B995 /* SiteStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SiteStorage.h; sourceTree = ""; }; + 4BF4ADEC1DA9A6B00073B995 /* SiteStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SiteStorage.m; sourceTree = ""; }; + 4BF720721DA9C6E3001340C3 /* ObjFW_Bridge.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ObjFW_Bridge.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 4B2E52D91DA942840040D091 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4BF4ADEA1DA9A3DB0073B995 /* Foundation.framework in Frameworks */, + 4BA115D61DA94390007ED4EA /* UIKit.framework in Frameworks */, + 4BB3CDF41DA967C100FEE5ED /* ObjFW.framework in Frameworks */, + 4BF720731DA9C6E3001340C3 /* ObjFW_Bridge.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 4B2E52D31DA942840040D091 = { + isa = PBXGroup; + children = ( + 4BA115CC1DA9431D007ED4EA /* scrypt-pwgen */, + 4B2E52DE1DA942840040D091 /* iOS */, + 4B2E52DD1DA942840040D091 /* Products */, + 4BA115D41DA94390007ED4EA /* Frameworks */, + ); + sourceTree = ""; + }; + 4B2E52DD1DA942840040D091 /* Products */ = { + isa = PBXGroup; + children = ( + 4B2E52DC1DA942840040D091 /* scrypt-pwgen.app */, + ); + name = Products; + sourceTree = ""; + }; + 4B2E52DE1DA942840040D091 /* iOS */ = { + isa = PBXGroup; + children = ( + 4B2E52EB1DA942840040D091 /* Assets.xcassets */, + 4BB3CDFB1DA9764300FEE5ED /* AddSiteController.h */, + 4BB3CDFC1DA9764300FEE5ED /* AddSiteController.m */, + 4B2E52E21DA942840040D091 /* AppDelegate.h */, + 4B2E52E31DA942840040D091 /* AppDelegate.m */, + 4B2E52F01DA942840040D091 /* Info.plist */, + 4B2E52ED1DA942840040D091 /* LaunchScreen.storyboard */, + 4B2E52E81DA942840040D091 /* Main.storyboard */, + 4B2E52E51DA942840040D091 /* MainViewController.h */, + 4B2E52E61DA942840040D091 /* MainViewController.m */, + 4B0719231DAA78D80065997A /* ShowDetailsController.h */, + 4B0719241DAA78D80065997A /* ShowDetailsController.m */, + 4BF4ADEB1DA9A6B00073B995 /* SiteStorage.h */, + 4BF4ADEC1DA9A6B00073B995 /* SiteStorage.m */, + 4B2E52E01DA942840040D091 /* main.m */, + ); + name = iOS; + sourceTree = ""; + }; + 4BA115CC1DA9431D007ED4EA /* scrypt-pwgen */ = { + isa = PBXGroup; + children = ( + 4BA115CD1DA9432D007ED4EA /* LegacyPasswordGenerator.h */, + 4BA115CE1DA9432D007ED4EA /* LegacyPasswordGenerator.m */, + 4BA115CF1DA9432D007ED4EA /* NewPasswordGenerator.h */, + 4BA115D01DA9432D007ED4EA /* NewPasswordGenerator.m */, + 4BA115D11DA9432D007ED4EA /* PasswordGenerator.h */, + ); + name = "scrypt-pwgen"; + sourceTree = ""; + }; + 4BA115D41DA94390007ED4EA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 4BB3CDF31DA967C100FEE5ED /* ObjFW.framework */, + 4BF720721DA9C6E3001340C3 /* ObjFW_Bridge.framework */, + 4BF4ADE91DA9A3DB0073B995 /* Foundation.framework */, + 4BA115D51DA94390007ED4EA /* UIKit.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 4B2E52DB1DA942840040D091 /* scrypt-pwgen */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4B2E52F31DA942840040D091 /* Build configuration list for PBXNativeTarget "scrypt-pwgen" */; + buildPhases = ( + 4B2E52D81DA942840040D091 /* Sources */, + 4B2E52D91DA942840040D091 /* Frameworks */, + 4B2E52DA1DA942840040D091 /* Resources */, + 4BB3CDF61DA967C100FEE5ED /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "scrypt-pwgen"; + productName = "scrypt-pwgen"; + productReference = 4B2E52DC1DA942840040D091 /* scrypt-pwgen.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 4B2E52D41DA942840040D091 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0800; + ORGANIZATIONNAME = "Jonathan Schleifer"; + TargetAttributes = { + 4B2E52DB1DA942840040D091 = { + CreatedOnToolsVersion = 8.0; + DevelopmentTeam = MXKNFCKFL6; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 4B2E52D71DA942840040D091 /* Build configuration list for PBXProject "scrypt-pwgen" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 4B2E52D31DA942840040D091; + productRefGroup = 4B2E52DD1DA942840040D091 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 4B2E52DB1DA942840040D091 /* scrypt-pwgen */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 4B2E52DA1DA942840040D091 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4B2E52EF1DA942840040D091 /* LaunchScreen.storyboard in Resources */, + 4B2E52EC1DA942840040D091 /* Assets.xcassets in Resources */, + 4B2E52EA1DA942840040D091 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 4B2E52D81DA942840040D091 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4BB3CDFD1DA9764300FEE5ED /* AddSiteController.m in Sources */, + 4B2E52E41DA942840040D091 /* AppDelegate.m in Sources */, + 4BA115D21DA9432D007ED4EA /* LegacyPasswordGenerator.m in Sources */, + 4B2E52E71DA942840040D091 /* MainViewController.m in Sources */, + 4BA115D31DA9432D007ED4EA /* NewPasswordGenerator.m in Sources */, + 4B0719251DAA78D80065997A /* ShowDetailsController.m in Sources */, + 4BF4ADED1DA9A6B00073B995 /* SiteStorage.m in Sources */, + 4B2E52E11DA942840040D091 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 4B2E52E81DA942840040D091 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4B2E52E91DA942840040D091 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 4B2E52ED1DA942840040D091 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4B2E52EE1DA942840040D091 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 4B2E52F11DA942840040D091 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 4B2E52F21DA942840040D091 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 4B2E52F41DA942840040D091 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_OBJC_ARC = NO; + DEVELOPMENT_TEAM = MXKNFCKFL6; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + INFOPLIST_FILE = Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "zone.heap.scrypt-pwgen"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 4B2E52F51DA942840040D091 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_OBJC_ARC = NO; + DEVELOPMENT_TEAM = MXKNFCKFL6; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + INFOPLIST_FILE = Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "zone.heap.scrypt-pwgen"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 4B2E52D71DA942840040D091 /* Build configuration list for PBXProject "scrypt-pwgen" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4B2E52F11DA942840040D091 /* Debug */, + 4B2E52F21DA942840040D091 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4B2E52F31DA942840040D091 /* Build configuration list for PBXNativeTarget "scrypt-pwgen" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4B2E52F41DA942840040D091 /* Debug */, + 4B2E52F51DA942840040D091 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 4B2E52D41DA942840040D091 /* Project object */; +}