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:
@@ -56,7 +56,7 @@
|
||||
return [algorithm keyIDForKey:[self keyForAlgorithm:algorithm]];
|
||||
}
|
||||
|
||||
- (MPMasterKey)keyForAlgorithm:(id<MPAlgorithm>)algorithm {
|
||||
- (NSData *)keyForAlgorithm:(id<MPAlgorithm>)algorithm {
|
||||
|
||||
@synchronized (self) {
|
||||
NSData *keyData = [self.keyCache objectForKey:algorithm];
|
||||
@@ -66,7 +66,7 @@
|
||||
[self.keyCache setObject:keyData forKey:algorithm];
|
||||
}
|
||||
|
||||
return keyData.length == MPMasterKeySize? keyData.bytes: NULL;
|
||||
return keyData.length == MPMasterKeySize? keyData: NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user