mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 08:12:28 +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
|
#pragma mark Protection
|
||||||
- (BOOL)decryptWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL {
|
- (BOOL)decryptWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL {
|
||||||
self.password = password;
|
self.key = keyFileURL;
|
||||||
|
self.password = [password length] > 0 ? password : nil;
|
||||||
@try {
|
@try {
|
||||||
self.tree = [KdbReaderFactory load:[[self fileURL] path] withPassword:self.passwordHash];
|
self.tree = [KdbReaderFactory load:[[self fileURL] path] withPassword:self.passwordHash];
|
||||||
}
|
}
|
||||||
@@ -139,8 +140,8 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (KdbPassword *)passwordHash {
|
- (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
|
+ (BOOL)autosavesInPlace
|
||||||
|
|||||||
@@ -52,7 +52,13 @@
|
|||||||
MPDocument *document = [[NSDocumentController sharedDocumentController] documentForWindow:[[self view] window]];
|
MPDocument *document = [[NSDocumentController sharedDocumentController] documentForWindow:[[self view] window]];
|
||||||
if(document) {
|
if(document) {
|
||||||
document.key = [self.keyfilePathControl URL];
|
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];
|
id mainWindowController = [[[self view] window] windowController];
|
||||||
[mainWindowController showEntries];
|
[mainWindowController showEntries];
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1065</string>
|
<string>1090</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||||
<key>NSHumanReadableCopyright</key>
|
<key>NSHumanReadableCopyright</key>
|
||||||
|
|||||||
Submodule MiniKeePassLib updated: 8c5d2b6209...5bda74e608
Reference in New Issue
Block a user