Following the previous release, I received word that Apple had added a new kind of sales receipt which is used for IAP testing. This release adds support for those.
- NEW: Added support for indefinite length encoding for containers
- NEW: Added support for decoding date strings with a UTC offset instead of Z.
For first change was done in DTFoundation which contains DTASN1, our ASN.1 decoder. When writing an ASN.1 file you would normally know all lengths of all containers and primitive values and so you could specify the length following each tag. Apple was doing so in all sales receipts so far and we didn’t have any issue with it.
In Xcode 12, Apple added a new way of testing In-App purchases (see Introducing StoreKit Testing in Xcode WWDC 2020 talk for more info). This broke parsing.
They started using indefinite length encoding for various container elements, including but not limited to the PKCS7 container. Once I had implemented that, I found that they also had a certain date with
+0300 as timezone, instead of
Z (for UTC) as we had previously encountered. So I needed to add this variant as well.
The update was tagged on GitHub (which also serves as new release for Swift Package Manager) and is also available via Cocoapods.
Also published on Medium.