@autoreleasepool {
NSDictionary *idmsData = SecEMCSCreateNewiDMSKey(NULL, NULL, @"1234", NULL, NULL);
- [idmsData autorelease];
ok(idmsData);
NSData *emcsKey = SecEMCSCreateDerivedEMCSKey(idmsData, @"1234", NULL);
- [emcsKey autorelease];
ok(emcsKey, "emcs key");
+ if (!emcsKey) @throw @"emacsKey missing";
/*
* change password
*/
NSDictionary *newIdmsData = SecEMCSCreateNewiDMSKey(NULL, emcsKey, @"4321", NULL, NULL);
- [newIdmsData autorelease];
NSData *newEmcsKey = SecEMCSCreateDerivedEMCSKey(newIdmsData, @"4321", NULL);
- [newEmcsKey autorelease];
ok(newEmcsKey, "new emcs key");
ok([newEmcsKey isEqualToData:emcsKey], "key same");
ok([data isEqualToData:[NSData dataWithBytes:"\xa4\x42\x8b\xb0\xb8\x20\xdb\xfa\x58\x84\xab\xe3\x52\x93\xeb\x10" length:16]], "same");
- [data release];
-
data = SecEMCSCreateDerivedEMCSKey(fakeIdmsData, @"4321", NULL);
ok(!data, "KFD2");
}