I can easily verify the on device receipt hash using OpenSSL on iOS. However, it's failing on Catalyst.
The following code chunk works perfectly on iOS and has for several years. I reported this: FB7470452
- (BOOL)verifyReceiptHash
{
NSUUID *uuid = [UIDevice currentDevice].identifierForVendor;
unsigned char uuidBytes[16];
[uuid getUUIDBytes:uuidBytes];
NSMutableData *data = [NSMutableData data];
[data appendBytes:uuidBytes length:sizeof(uuidBytes)];
[data appendData:self.opaqueValue];
[data appendData:self.bundleIdentifierData];
NSMutableData *expectedHash = [NSMutableData dataWithLength:SHA_DIGEST_LENGTH]; //20
SHA1((const uint8_t*)data.bytes, data.length, (uint8_t*)expectedHash.mutableBytes);
return [expectedHash isEqualToData:self.receiptHash];
}
I'm not certain [UIDevice currentDevice].identifierForVendor is returning the correct UUID. Even when using a chunk of code to get the correct UUID (matches up in with system information), the verify still fails.
Is there something special about Catalyst?