Macros not found: EVP_PKEY_set1_tls_encodedpoint and EVP_PKEY_id
bortzmeyer opened this issue · comments
...
[ 57%] Built target picotls-openssl
[ 58%] Building C object CMakeFiles/cli.dir/t/cli.c.o
[ 59%] Building C object CMakeFiles/cli.dir/lib/pembase64.c.o
[ 60%] Linking C executable cli
/usr/bin/ld: libpicotls-openssl.a(openssl.c.o): in function `evp_keyex_on_exchange':
/home/stephane/tmp/DoQ/picotls/lib/openssl.c:509: undefined reference to `EVP_PKEY_set1_tls_encodedpoint'
/usr/bin/ld: libpicotls-openssl.a(openssl.c.o): in function `lookup_signature_schemes':
/home/stephane/tmp/DoQ/picotls/lib/openssl.c:133: undefined reference to `EVP_PKEY_id'
/usr/bin/ld: libpicotls-openssl.a(openssl.c.o): in function `verify_sign':
/home/stephane/tmp/DoQ/picotls/lib/openssl.c:1099: undefined reference to `EVP_PKEY_id'
/usr/bin/ld: /home/stephane/tmp/DoQ/picotls/lib/openssl.c:1117: undefined reference to `EVP_PKEY_id'
/usr/bin/ld: libpicotls-openssl.a(openssl.c.o): in function `do_sign':
/home/stephane/tmp/DoQ/picotls/lib/openssl.c:715: undefined reference to `EVP_PKEY_id'
/usr/bin/ld: /home/stephane/tmp/DoQ/picotls/lib/openssl.c:730: undefined reference to `EVP_PKEY_id'
/usr/bin/ld: libpicotls-openssl.a(openssl.c.o): in function `evp_keyex_init':
/home/stephane/tmp/DoQ/picotls/lib/openssl.c:566: undefined reference to `EVP_PKEY_get1_tls_encodedpoint'
/usr/bin/ld: libpicotls-openssl.a(openssl.c.o): in function `ptls_openssl_create_key_exchange':
/home/stephane/tmp/DoQ/picotls/lib/openssl.c:646: undefined reference to `EVP_PKEY_id'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/cli.dir/build.make:117: cli] Error 1
make[1]: *** [CMakeFiles/Makefile2:207: CMakeFiles/cli.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
According to the documentation, they are deprecated and should not be used.
% openssl version
OpenSSL 3.0.3 3 May 2022 (Library: OpenSSL 3.0.3 3 May 2022)
I tested pull request #382 but it does not seem it fixes the problem.
Could not reproduce the issue.
I presume that the error is due to the compiler referring to an older version of OpenSSL, while the linker is referring to 3.0.3.
The linker is complaining that EVP_PKEY_get1_tls_encodedpoint
can be found, which is now a macro in OpenSSL 3.0.3. This symbol used to be a function in older versions of OpenSSL. As the compiler is not complaining for lack of the function prototype, it is most likely that the compiler was provided an older version of OpenSSL header files that has the function prototype.