From c454f850030989c1e1daeb71bbd38c0f8bb4baed Mon Sep 17 00:00:00 2001 From: Michael Schwarz Date: Mon, 28 Aug 2023 13:08:33 +0200 Subject: [PATCH] Skip verifyAuthenticity check of receipt data --- Sources/AppReceiptValidator/AppReceiptValidator.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/AppReceiptValidator/AppReceiptValidator.swift b/Sources/AppReceiptValidator/AppReceiptValidator.swift index c4b3caf..f650a52 100644 --- a/Sources/AppReceiptValidator/AppReceiptValidator.swift +++ b/Sources/AppReceiptValidator/AppReceiptValidator.swift @@ -156,7 +156,9 @@ private extension AppReceiptValidator { guard let receiptData = pkcs7.mainBlock.findOid(.pkcs7data)?.parent?.sub?.last?.sub(0)?.rawValue else { throw Error.receiptNotSigned } try self.verifyCertificates(pkcs7: pkcs7, appleRootCertificateData: appleRootCertificateData) - try self.verifyAuthenticity(x509Certificate: appStoreCertFromReceipt, receiptData: receiptData, signatureData: signatureData) + // FIX THIS: Skip this check as `SecKeyVerifySignature` cannot handle new receipt correctly. + // https://developer.apple.com/documentation/technotes/tn3138-handling-app-store-receipt-signing-certificate-changes# + // try self.verifyAuthenticity(x509Certificate: appStoreCertFromReceipt, receiptData: receiptData, signatureData: signatureData) } func verifyCertificates(pkcs7: ASN1Decoder.PKCS7, appleRootCertificateData: Data) throws {