Kitura / BlueECC

Elliptic-curve cryptography for Swift
Apache License 2.0
92 stars 35 forks source link

Not compiling, OpenSSL linking issue #31

Open yspreen opened 3 years ago

yspreen commented 3 years ago
Building for iOS Simulator, but linking in dylib built for macOS, file '/usr/local/Cellar/openssl@1.1/1.1.1k/lib/libcrypto.dylib' for architecture x86_64
yspreen commented 3 years ago

That's obviously compiled for simulator. If I instead compile for a physical device, I get different errors:

Undefined symbol: _BN_bin2bn
Undefined symbol: _RSA_set0_key
Undefined symbol: _BIO_s_mem
Undefined symbol: _RSA_set0_crt_params
Undefined symbol: _BIO_read
Undefined symbol: _RSA_set0_factors
Undefined symbol: _PEM_write_bio_PrivateKey
Undefined symbol: _BIO_ctrl
Undefined symbol: _BIO_new
Undefined symbol: _EVP_PKEY_free
Undefined symbol: _RSA_new
Undefined symbol: _EVP_PKEY_assign
Undefined symbol: _PEM_write_bio_PUBKEY
Undefined symbol: _EVP_PKEY_new
yspreen commented 3 years ago

Ah okay, there the warning is again:

Ld: warning: ignoring file /usr/local/Cellar/openssl@1.1/1.1.1k/lib/libcrypto.dylib, building for iOS-arm64 but attempting to link with file built for macOS-x86_64
dannys42 commented 3 years ago

Hi @yspreen, how are you compiling BlueECC? Are you including it in your project via cocoapods or SPM? Also what version of Xcode and macOS are you using?

yspreen commented 3 years ago

Thanks for the reply @dannys42

I'm running Xcode 12.4 (12D4e), compiling via SPM. My macOS is still on Catalina.

yspreen commented 3 years ago

It seems like the issue is actually with ibm-cloud-security/Swift-JWK-to-PEM

So the question becomes: Is there any way to use JWK public keys for signature validation?