CryptoPassphrase  Check-in [af661fbcc5]

Overview
Comment:iOS: Get the length from the generator

This fixes reading over the buffer if it is not zero terminated.
Fortunately, this was almost always the case by pure luck.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: af661fbcc54e9f67445b5d4a95457b14e8fddc6d81bbafe54b7ac47410007518
User & Date: js 2017-10-21 20:04:45
Context
2017-10-21
20:07
iOS: Allow all orientations check-in: 1a36714841 user: js tags: trunk
20:04
iOS: Get the length from the generator check-in: af661fbcc5 user: js tags: trunk
18:45
Add iPad icon check-in: d444c9ace7 user: js tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to iOS/ShowDetailsController.m.

196
197
198
199
200
201
202
203
204


205
206
207
208
209
210
211
212
213
		@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);
		});
	});
}







|
|
>
>
|
<







196
197
198
199
200
201
202
203
204
205
206
207

208
209
210
211
212
213
214
		@try {
			[generator derivePassword];
		} @finally {
			of_explicit_memset(passphrase, 0, strlen(passphrase));
			free(passphrase);
		}

		NSMutableString *password = [[[NSMutableString alloc]
		    initWithBytes: (char *)generator.output
			   length: generator.length
			 encoding: NSUTF8StringEncoding] autorelease];
		of_explicit_memset(generator.output, 0, generator.length);


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