Closed PaulWagener closed 7 years ago
Thank you for reporting this, Paul!
I'm going to start looking into this soon (I'm super slow these days, just bogged down with [insert life event here], haha). But I do want this to work with Swift 4, so I intend to explore a bit more.
The info you provided gives me a few ideas - if you discover anything additional that might help me or others solve this one, feel free to continue the dialogue!
Ok, I've figured out a way. It turns out that a step that is on your blog (but not in this repository) is mandatory for it to compile.
I included the two files pkcs7_union_accessors.h
and pkcs7_union_accessors.c
that are described here. And included them in the bridging header:
#include "pkcs7_union_accessors.h"
#import <openssl/pkcs7.h>
#import <openssl/objects.h>
#import <openssl/sha.h>
#import <openssl/x509.h>
After those steps the whole project compiles and works as advertised.
Oh my goodness. I'm so sorry -- I'm going to add the bridging header to the repo and document that a little better.
When I wrote the series, there was literally a year between when I started and when I finished, so I had just forgotten about the bridging header requirement.
Sorry to raise an old issue. But is there a way this can be resolved without statically-linking OpenSSL? https://github.com/IBM-Swift/OpenSSL
I'm currently working on a SwiftyStorekit project and want to integrate SwiftyLocalReceiptValidator for offline checking of the receipt (so also waiting for the result of issue #1 ).
When following the instructions written at https://www.andrewcbancroft.com/2015/09/21/openssl-for-ios-swift-the-easy-way/ with OpenSSL 1.0.210, Swift 4 and Xcode 9 I seem to hit a few new roadblocks. There are a lot of undeclared references, I've managed to solve most of them by including a few extra headers in the bridging header:
But that still leaves one undeclared reference: the pkcs7_d_sign () function at https://github.com/andrewcbancroft/SwiftyLocalReceiptValidator/blob/master/ReceiptValidator.swift#L174
I can't seem to find any mention of this function in the OpenSSL headers, and when searching online I only get references to Swift receipt validation. My guess is that this function was removed in the last two years, could you help me with a workaround?