Kitura / BlueRSA

RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).
Apache License 2.0
131 stars 58 forks source link

Illegal Instruction (core dumped) createPublicKey(...) on Ubuntu #57

Open geertberkers opened 4 years ago

geertberkers commented 4 years ago

BlueRSA failed to create data from base64 string on Ubuntu. The illegal instruction is from the forced unwrap of the Data object, which is nil. Running on MacOS this works without any problems.

Screenshot 2019-11-12 13 25 01

I added extra Log lines in CryptorRSAKey to find this bug.

Screenshot 2019-11-12 13 21 23

geertberkers commented 4 years ago

Found this: https://stackoverflow.com/a/58819331/4713369

And the problem is solved for me when using: let data = Data(base64Encoded: base64, options: .ignoreUnknownCharacters)!

geertberkers commented 4 years ago

I'm not sure, but this might also be a fix for #52 ?