Fix build issue against LibreSSL #4
Merged
SlavekB
merged 1 commits from feat/libressl
into master
4 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'feat/libressl'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Previous error(s) was:
At first glance it looked fine, at second glance the use of conditions is suspiciously inconsistent – they contradict each other. Please examine it.
{
if(type) {
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
This is weird. Makes sense the condition older openssl || libressl or condition newer openssl && !libressl – as are above. But the condition older openssl && !libressl is suspicious.
type = getType(mode);
r.resize(0);
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
This is suspicious, just like the previous one.
Reversing the condition is obviously wrong.
}
int res = EVP_BytesToKey(loctype, EVP_sha1(), (unsigned char *)salt.data(), (unsigned char *)data.data(), data.size(), 1, kp, ip);
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
#if OPENSSL_VERSION_NUMBER < 0x10100000L
Reversing this condition is meaningless.
EVP_CIPHER_meth_free
documentation says: The functions described here were added in OpenSSL 1.1.0. Reversing this condition is thus in direct contradiction and causes FTBFS.There are still broken conditions for which it is necessary to revert it to the original sense.
unsigned char *kp = 0;
unsigned char *ip = 0;
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER >= 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
It is undesirable to reverse the meaning of this condition for the OpenSSL version.
{
if(type) {
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#if OPENSSL_VERSION_NUMBER >= 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
It is undesirable to reverse the meaning of this condition for the OpenSSL version.
Well, now I'm happy with the result – finally – I know I have high demands. However – one more requirement. There's no point in having so many commits. Please squash it into a single commit.
All ready. Thanks for the patience. :-)
It looks good, I have no further objections.
@selk: That looks much better than before. Keep up your efforts. 👍
It's good you look at this LibreSSL, musl and other things and test them.
9cd1493c36
.