Pink2Dev / Pink2

Pinkcoin 2 Qt wallet and daemon
https://getstarted.with.pink/
MIT License
29 stars 22 forks source link

Can't build with OpenSSL 1.1 #7

Closed crc32a closed 6 years ago

crc32a commented 6 years ago

Building this with OpenSSL 1.1 yields the error messages like src/bignum.h:715:77: error: cannot convert ‘const CBigNum’ to ‘const BIGNUM’ {aka ‘const bignum_st*’} are there instructions on how to compile this on systems with both OpenSSL1.0 and OpenSSL1.1?

MiWCryptoCurrency commented 6 years ago

Hi crc32a,

like many bitcoin derivative codebases, this targets the OpenSSL 1.0, as 1.1 is a breaking API change, as per: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes

In order to use OpenSSL 1.1 API, this will require a refactor of the codebase to use the new API.

If you wish, you can build a container with openssl 1.0 using the dockerfile. Build steps with a standalone openssl 1.0 are in the Circle CI config file: https://github.com/Pink2Dev/Pink2/blob/master/.circleci/config.yml

crc32a commented 6 years ago

Yea I'm actually using a full on VM to build the code now. I'm not thrilled with OpenSSL breaking things in 1.1. I noticed a lot of my old OpenSSL programs don't compile either so I'll be migrating those source files to use GnuTLS I'm not impressed with OpenSSL enough to migrate to 1.1. :(

MiWCryptoCurrency commented 6 years ago

The developer argument for breaking the API was that OpenSSL 1.0 provided too much visibility into the internals -- many apps used to reach into data structures and pull out attributes. This makes it hard for it to change without massively breaking things in future. The newer API makes a lot of these data structures opaque, ideally making it easier to modify internals in future. While GNUTLS, Boring, Libre, etc are also options, this is a technical debt issue with the older OpenSSL codebase that may well effect these also.

Your PR's are welcomed on this issue!

Thanks mate

crc32a commented 6 years ago

Honestly though OpenSSLs odd documentation forced alot of us to blackbox discover the internals of the OpenSSL codebase which lead to us painfully learning how to fetch those internal attributes. I admit I did that a lot that in my code base which is why I'm getting errors in my code now since they are now hiding things. I can only hope OpenSSL is providing accesser and setter functions now so we don't have to tamper with the data structures directly like we did before but it feels kinda of harsh now that things like "sizeof(X509)" are triggering errors as if were not supposed to be able to malloc memory for a list of X509 structures anymore os OpenSSL providing constructors now as well to the point we can't even use our own memory pool utilities like say apache apr? That just seems like an anti C like thing to do. Given the past history of OpenSSLs track record I'll wait for the codebase to stabalize before I consider invest in it again. I appreciate their effort though and wish them the best for now though.

crc32a commented 6 years ago

Too late. I'm already curious about how to port my code to 1.0 to 1.1 and am reading the wiki you posted above. lol