mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 20:32:43 +00:00
Fixed error when setting an empty password.
Fixed error that ignored the keyfile
This commit is contained in:
@@ -103,7 +103,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
|
||||
|
||||
#pragma mark Protection
|
||||
- (BOOL)decryptWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL {
|
||||
self.password = password;
|
||||
self.key = keyFileURL;
|
||||
self.password = [password length] > 0 ? password : nil;
|
||||
@try {
|
||||
self.tree = [KdbReaderFactory load:[[self fileURL] path] withPassword:self.passwordHash];
|
||||
}
|
||||
@@ -139,8 +140,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
|
||||
}
|
||||
|
||||
- (KdbPassword *)passwordHash {
|
||||
// TODO: Use defaults to determine Encoding?
|
||||
return [[[KdbPassword alloc] initWithPassword:self.password passwordEncoding:NSUTF8StringEncoding keyFile:[self.key path]] autorelease];
|
||||
|
||||
return [[[KdbPassword alloc] initWithPassword:self.password passwordEncoding:NSUTF8StringEncoding keyFileURL:self.key] autorelease];
|
||||
}
|
||||
|
||||
+ (BOOL)autosavesInPlace
|
||||
|
||||
@@ -52,7 +52,13 @@
|
||||
MPDocument *document = [[NSDocumentController sharedDocumentController] documentForWindow:[[self view] window]];
|
||||
if(document) {
|
||||
document.key = [self.keyfilePathControl URL];
|
||||
document.password = [self.passwordTextField stringValue];
|
||||
NSString *password = [self.passwordTextField stringValue];
|
||||
if([password length] > 0) {
|
||||
document.password = password;
|
||||
}
|
||||
else {
|
||||
document.password = nil;
|
||||
}
|
||||
}
|
||||
id mainWindowController = [[[self view] window] windowController];
|
||||
[mainWindowController showEntries];
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1065</string>
|
||||
<string>1090</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
Submodule MiniKeePassLib updated: 8c5d2b6209...5bda74e608
Reference in New Issue
Block a user