Open vizvamitra opened 7 years ago
def verify_signature(base64_encoded_receipt)
cert = OpenSSL::X509::Certificate.new(root_cert)
cert_store = OpenSSL::X509::Store.new
cert_store.add_cert(cert)
receipt = Base64.decode64(base64_encoded_receipt)
begin
signature = OpenSSL::PKCS7.new(receipt)
# note that I don't use NOVERIFY flag here, so the entire
# certificate chain will be verified against a CA store
signature.verify([cert], cert_store, nil)
rescue ArgumentError
false
end
end
# Certificate was downloaded from here:
# https://www.apple.com/certificateauthority/
def root_cert
<<-CERT.gsub(/^\s*/m, '')
-----BEGIN CERTIFICATE-----
MIIEuzCCA6OgAwIBAgIBAjANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQGEwJVUzET
MBEGA1UEChMKQXBwbGUgSW5jLjEmMCQGA1UECxMdQXBwbGUgQ2VydGlmaWNhdGlv
biBBdXRob3JpdHkxFjAUBgNVBAMTDUFwcGxlIFJvb3QgQ0EwHhcNMDYwNDI1MjE0
MDM2WhcNMzUwMjA5MjE0MDM2WjBiMQswCQYDVQQGEwJVUzETMBEGA1UEChMKQXBw
bGUgSW5jLjEmMCQGA1UECxMdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx
FjAUBgNVBAMTDUFwcGxlIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
ggEKAoIBAQDkkakJH5HbHkdQ6wXtXnmELes2oldMVeyLGYne+Uts9QerIjAC6Bg+
+FAJ039BqJj50cpmnCRrEdCju+QbKsMflZ56DKRHi1vUFjczy8QPTc4UadHJGXL1
XQ7Vf1+b8iUDulWPTV0N8WQ1IxVLFVkds5T39pyez1C6wVhQZ48ItCD3y6wsIG9w
tj8BMIy3Q88PnT3zK0koGsj+zrW5DtleHNbLPbU6rfQPDgCSC7EhFi501TwN22IW
q6NxkkdTVcGvL0Gz+PvjcM3mo0xFfh9Ma1CWQYnEdGILEINBhzOKgbEwWOxaBDKM
aLOPHd5lc/9nXmW8Sdh2nzMUZaF3lMktAgMBAAGjggF6MIIBdjAOBgNVHQ8BAf8E
BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUK9BpR5R2Cf70a40uQKb3
R01/CF4wHwYDVR0jBBgwFoAUK9BpR5R2Cf70a40uQKb3R01/CF4wggERBgNVHSAE
ggEIMIIBBDCCAQAGCSqGSIb3Y2QFATCB8jAqBggrBgEFBQcCARYeaHR0cHM6Ly93
d3cuYXBwbGUuY29tL2FwcGxlY2EvMIHDBggrBgEFBQcCAjCBthqBs1JlbGlhbmNl
IG9uIHRoaXMgY2VydGlmaWNhdGUgYnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0
YW5jZSBvZiB0aGUgdGhlbiBhcHBsaWNhYmxlIHN0YW5kYXJkIHRlcm1zIGFuZCBj
b25kaXRpb25zIG9mIHVzZSwgY2VydGlmaWNhdGUgcG9saWN5IGFuZCBjZXJ0aWZp
Y2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudHMuMA0GCSqGSIb3DQEBBQUAA4IBAQBc
NplMLXi37Yyb3PN3m/J20ncwT8EfhYOFG5k9RzfyqZtAjizUsZAS2L70c5vu0mQP
y3lPNNiiPvl4/2vIB+x9OYOLUyDTOMSxv5pPCmv/K/xZpwUJfBdAVhEedNO3iyM7
R6PVbyTi69G3cN8PReEnyvFteO3ntRcXqNx+IjXKJdXZD9Zr1KIkIxH3oayPc4Fg
xhtbCS+SsvhESPBgOJ4V9T0mZyCKM2r3DYLP3uujL/lTaltkwGMzd/c6ByxW69oP
IQ7aunMZT7XZNn/Bh1XZp5m5MkL72NVxnn6hUrcbvZNCJBIqxw8dtk2cXmPIS4AX
UKqK1drk/NAJBzewdXUh
-----END CERTIFICATE-----
CERT
end
Also here is a receipt I've found somewhere in the internet with one of the embedded certificates outdated. You don't check the certificate chain, so both #verify
and #signature_valid?
will return true while the implementation suggested by Apple will fail:
MIJDbAYJKoZIhvcNAQcCoIJDXTCCQ1kCAQExCzAJBgUrDgMCGgUAMIIzDAYJKo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CSqGSIb3DQEBAQUABIIBAAV8tyQOUd036Fsl8yNWg1i8yAtStrzHc29bw3nQA/pVLaVkZ0mfAuRjfKajhfKavKETdeKPYGTSPipHe7xoguuXOHFOUZkjlxew/fd/U6/zQHk3dmxPBTcp9c8ehJdqkqRsjmMQQI/HRtfagTxaNWL7OxrYRFSYALiuZ8LnUyS/aFKtaZxQ2Y5Lg3EV2TiA9bU0nE4gJRSPEDTmVpriZHLU5umjf97wU4jtInlzuYPz7rBWA1fDBb7o6k6ahZPcE1EdsDRMIcm+3zHPxIfNGiseklUjsGA/L3euYW76ebJi5pA+zURuoCzgyQKPr90S8GRRlxOu3WKiFGAS+4BAPHM=
Hi @vizvamitra,
Thanks for opening this issue. It was something I struggled with when I created this library.
The initial problem I had was related to expired apple certificates.
OpenSSL::PKCS7::NOVERIFY
needs to be used to extract the payload, which includes the creation_date. If the certificate is expired, the verify method will fail.
This library should check the certificate chain and verify the certificate expiry in the context of the creation_date
. I will look into this as soon as I can, but in the mean time please feel free to open a pull request, I appreciate any help I can get. Thanks!
@vizvamitra What does Apple validation server return when you check this receipt? I think an outdated certificate is not an issue if the signature was made before expiration. Receipts signed with the certificate that expired in 2016 should still be valid.
Hello there. I have some questions about your unified receipts verification procedure.
Reading your gem's sources I've noticed that when the ItunesReceiptDecoder::Decode::UnifiedReceipt is being created you don't check (here) whether the certificates embedded into the receipt's pkcs7 container were issued by Apple.
Instead you've separated certificate validation to a
#signature_valid?
method. In this video at 19:00 a guy from Apple describes the signature verification procedure. I've implemented it in ruby, the code is listed in a comment below. The procedure you use in#signature_valid?
method is different.So my questions are: