Page MenuHomePhabricator

OpenSSL 1.1.1b compile errors
Closed, ResolvedPublic

Description

Hello,

i get a compiler error when i try to compile the libssh master branch ( or the 0.8.7 ) with the OpenSSL 1.1.1b.

/libssh/src/libcrypto.c:689:102: error: 'block128_f' undeclared (first use in this function); did you mean 'clockid_t'?
CRYPTO_ctr128_encrypt(in, out, len, &cipher->aes_key->key, cipher->aes_key->IV, tmp_buffer, &num, (block128_f)AES_encrypt);

Apparently, no OpenSSL version will be supported longer than 2019 except for the 1.1.1.

Note: The latest stable version is the 1.1.1 series. This is also our Long Term Support (LTS) version, supported until 11th September 2023. Our previous LTS version > (1.0.2 series) will continue to be supported until 31st December 2019 (security fixes only during the last year of support). The 1.1.0 series is currently only receiving security fixes and will go out of support on 11th September 2019. All users of 1.0.2 and 1.1.0 are encouraged to upgrade to 1.1.1 as soon as possible. The 0.9.8, 1.0.0 and 1.0.1 versions are now out of support and should not be used.

Openssl source

Event Timeline

asn assigned this task to Jakuje.Thu, Feb 28, 9:21 AM
asn added a subscriber: asn.

Jakub, could you check once OpenSSL 1.1.1b is in rawhide?

Building with openssl-1.1.1a-1.fc29.x86_64 works fine so the support window is not a problem.

The change was probably in the b release, which probably changed something that prevents building libssh. I will check that once I will get the new update in rawhide.

I just tested with Fedora 29 with the latest OpenSSL 1.1.1b (openssl-1.1.1b-2.fc29.x86_64) and I am able to build the libssh without any problem. Can you clarify on what OS are you trying to compile and you see these errors?

I compile the OpenSSL and the libSSH on a Windows 8.1 system with the mingw64 ( MSYS2 ).

For this I use the official git repository

git clone git://git.openssl.org/openssl.git
git checkout -f tags/OpenSSL_1_1_1b
git clean -fd

perl Configure -g mingw64 -fPIC no-shared no-asm --prefix=$baseDir/openssl/debug && make clean && make depend && make -j8 && make install

By the way: With OpenSSL 1.1.1a I get the same error.

asn added a comment.Tue, Mar 12, 1:10 PM

Do we need to add:

#include <openssl/modes.h>

in src/libcrypto.c?

@davidwed could you check?

This comment was removed by davidwed.
This comment was removed by davidwed.

Your fix for the "libcrypto.c" worked, thanks :-).

Also you have to link the crypt32 library under Windows from OpenSSL version 1.1.0 on.

Here is a patch containing your and my changes. Now the build runs without any errors.

asn added a comment.Wed, Mar 13, 10:24 AM

Why do you need to link against crypt32, can you post the error?

asn added a comment.Wed, Mar 13, 10:27 AM

Is that only happening with static linking?

asn added a comment.Wed, Mar 13, 10:31 AM

You seem to statically link openssl, that's why you need to link crypt32.dll. This means it isn't our problem. See

https://github.com/openssl/openssl/blob/master/NOTES.WIN

Section: Linking your application

asn added a comment.Wed, Mar 13, 10:49 AM

Please open a new bug if there is an issue with libssh and openssl linking on Windows and provide details there. Thanks!

All is fine, I just hadn't considered that I linked the Openssl statically :-).

Thanks for the quick help.

chcg added a subscriber: chcg.Wed, Mar 20, 7:13 PM

See https://travis-ci.org/ashkulz/NppFTP/jobs/504958471, also for NppFTP with 0.8.7 this issue could be observed for mingw64 4.8.4 build with setting -DWITH_STATIC_LIB=ON for https://github.com/ashkulz/NppFTP/pull/246. The same constellation build with MSVC seems to have no such issue, see https://ci.appveyor.com/project/ashkulz/nppftp/builds/22995813