Fix internal bugs.
Pass masterKey data safely by ensuring the NSData holder is owned. nameOfType: threw an unrecougnized-type error always, including for recougnized types. Swizzling broke when triggered on multiple levels of the hierarchy.
This commit is contained in:
@@ -95,13 +95,13 @@
|
||||
- (void)storeSavedKeyFor:(MPUserEntity *)user {
|
||||
|
||||
if (user.saveKey) {
|
||||
MPMasterKey masterKey = [self.key keyForAlgorithm:user.algorithm];
|
||||
NSData *masterKey = [self.key keyForAlgorithm:user.algorithm];
|
||||
if (masterKey) {
|
||||
[self forgetSavedKeyFor:user];
|
||||
|
||||
inf( @"Saving key in keychain for user: %@", user.userID );
|
||||
[PearlKeyChain addOrUpdateItemForQuery:[self createKeyQueryforUser:user origin:nil] withAttributes:@{
|
||||
(__bridge id)kSecValueData: [NSData dataWithBytesNoCopy:(void *)masterKey length:MPMasterKeySize]
|
||||
(__bridge id)kSecValueData: masterKey
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user