php-src icon indicating copy to clipboard operation
php-src copied to clipboard

openssl.c - ignores opensslconf.h & fails to link

Open fsbruva opened this issue 4 years ago • 1 comments

Description

If openssl 1.1.1n is configured & built with any combination of the Configure [no-<cipher> ...] options:

no-md2
no-md4
no-md5
no-rmd160

While building php 8.0.18, linking results in this output (or similar):

ld: error: undefined symbol: EVP_md4
>>> referenced by openssl.c
>>>               ext/openssl/openssl.o:(php_openssl_get_evp_md_from_algo)
>>> did you mean: EVP_md5
>>> defined in: /usr/local/lib/libcrypto.so

But I expected this output instead:

Build complete.
Don't forget to run 'make test'.

This has two causes. First is that the existing precompiler test for MD2 merely checks for the presence of the include/openssl/md2.h file, rather than the actual capabilities of the compiled library. The second cause is that openssl.c does not consult include/openssl/opensslconf.h for the other listed options. I have a patch, and will submit a PR once I get the bug number.

PHP Version

8.0.18

Operating System

FreeBSD 12.3-RELEASE

fsbruva avatar Apr 23 '22 15:04 fsbruva

Fixed except no-md5 which was removed in OpenSSL 1.1.0. It actually did not even work with OpenSSL 1.0.2. And we still have default MD5 alg for SPKI.

bukka avatar Oct 22 '22 22:10 bukka