CryptoPassphrase  Diff

Differences From Artifact [07cb7c3f7e]:

To Artifact [1520eb22e7]:


159
160
161
162
163
164
165


166













167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201

202
203

204
205
206
207
208
209
210
			clearNSMutableString(password);
		}];
	}];
}

- (void)_generateWithCallback: (void (^)(NSMutableString *))block
{


	UIStoryboard *mainStoryboard =













	[UIStoryboard storyboardWithName: @"Main"
				  bundle: nil];
	UIViewController *activityController = [mainStoryboard
	    instantiateViewControllerWithIdentifier: @"activityIndicator"];
	[self.navigationController.view addSubview: activityController.view];

	dispatch_async(dispatch_get_global_queue(
	    DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ {
		id <PasswordGenerator> 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));


		activityController.view.hidden = YES;
		block(password);

	});
}

- (IBAction)remove: (id)sender
{
	UIAlertController *alert = [UIAlertController
	    alertControllerWithTitle: @"Remove Site?"







>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|





<
<
<
<
<
<
<
<
<
<
<
<

<
<
<











>
|
|
>







159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189












190



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
			clearNSMutableString(password);
		}];
	}];
}

- (void)_generateWithCallback: (void (^)(NSMutableString *))block
{
	id <PasswordGenerator> generator;
	char *passphrase;
	UIStoryboard *mainStoryboard;
	UIViewController *activityController;

	if (_legacy)
		generator = [LegacyPasswordGenerator generator];
	else
		generator = [NewPasswordGenerator generator];

	generator.site = _name;
	generator.length = _length;

	passphrase = of_strdup([self.passphraseField.text UTF8String]);
	generator.passphrase = passphrase;

	mainStoryboard = [UIStoryboard storyboardWithName: @"Main"
						   bundle: nil];
	activityController = [mainStoryboard
	    instantiateViewControllerWithIdentifier: @"activityIndicator"];
	[self.navigationController.view addSubview: activityController.view];

	dispatch_async(dispatch_get_global_queue(
	    DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ {












		@try {



			[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));

		dispatch_sync(dispatch_get_main_queue(), ^ {
			activityController.view.hidden = YES;
			block(password);
		});
	});
}

- (IBAction)remove: (id)sender
{
	UIAlertController *alert = [UIAlertController
	    alertControllerWithTitle: @"Remove Site?"