Support openssl3
We need a few tweaks to support openssl3. Over at conda-forge they tried building and got errors, expand below to see them.
Build errors
_pypy_openssl.c:2312:7: error: 'EVP_PKEY_CTX_set_rsa_oaep_md' redeclared as different kind of symbol
2312 | int (*EVP_PKEY_CTX_set_rsa_oaep_md)(EVP_PKEY_CTX *, EVP_MD *) = NULL;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/openssl/x509.h:36,
from include/openssl/ct.h:29,
from _pypy_openssl.c:645:
include/openssl/rsa.h:158:5: note: previous declaration of 'EVP_PKEY_CTX_set_rsa_oaep_md' was here
158 | int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *ctx, const EVP_MD *md);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
_pypy_openssl.c:2319:7: error: 'EVP_PKEY_CTX_set0_rsa_oaep_label' redeclared as different kind of symbol
2319 | int (*EVP_PKEY_CTX_set0_rsa_oaep_label)(EVP_PKEY_CTX *, unsigned char *,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/openssl/x509.h:36,
from include/openssl/ct.h:29,
from _pypy_openssl.c:645:
include/openssl/rsa.h:164:5: note: previous declaration of 'EVP_PKEY_CTX_set0_rsa_oaep_label' was here
164 | int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, void *label, int llen);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_pypy_openssl.c: In function '_cffi_const_CRYPTO_MEM_CHECK_DISABLE':
_pypy_openssl.c:7060:12: error: 'CRYPTO_MEM_CHECK_DISABLE' undeclared (first use in this function); did you mean '_cffi_const_CRYPTO_MEM_CHECK_DISABLE'?
7060 | int n = (CRYPTO_MEM_CHECK_DISABLE) <= 0;
| ^~~~~~~~~~~~~~~~~~~~~~~~
| _cffi_const_CRYPTO_MEM_CHECK_DISABLE
_pypy_openssl.c:7060:12: note: each undeclared identifier is reported only once for each function it appears in
_pypy_openssl.c: In function '_cffi_const_CRYPTO_MEM_CHECK_ENABLE':
_pypy_openssl.c:7067:12: error: 'CRYPTO_MEM_CHECK_ENABLE' undeclared (first use in this function); did you mean '_cffi_const_CRYPTO_MEM_CHECK_ENABLE'?
7067 | int n = (CRYPTO_MEM_CHECK_ENABLE) <= 0;
| ^~~~~~~~~~~~~~~~~~~~~~~
| _cffi_const_CRYPTO_MEM_CHECK_ENABLE
_pypy_openssl.c: In function '_cffi_const_CRYPTO_MEM_CHECK_OFF':
_pypy_openssl.c:7074:12: error: 'CRYPTO_MEM_CHECK_OFF' undeclared (first use in this function)
7074 | int n = (CRYPTO_MEM_CHECK_OFF) <= 0;
| ^~~~~~~~~~~~~~~~~~~~
_pypy_openssl.c: In function '_cffi_const_CRYPTO_MEM_CHECK_ON':
_pypy_openssl.c:7081:12: error: 'CRYPTO_MEM_CHECK_ON' undeclared (first use in this function)
7081 | int n = (CRYPTO_MEM_CHECK_ON) <= 0;
| ^~~~~~~~~~~~~~~~~~~
_pypy_openssl.c: In function '_cffi_const_EVP_R_KEYGEN_FAILURE':
_pypy_openssl.c:7833:12: error: 'EVP_R_KEYGEN_FAILURE' undeclared (first use in this function)
7833 | int n = (EVP_R_KEYGEN_FAILURE) <= 0;
| ^~~~~~~~~~~~~~~~~~~~
_pypy_openssl.c: In function '_cffi_d_BIO_s_datagram':
_pypy_openssl.c:12473:10: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
12473 | return BIO_s_datagram();
| ^~~~~~~~~~~~~~~~
_pypy_openssl.c: In function '_cffi_d_BIO_s_file':
_pypy_openssl.c:12499:10: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
12499 | return BIO_s_file();
| ^~~~~~~~~~~~
_pypy_openssl.c: In function '_cffi_d_BIO_s_mem':
_pypy_openssl.c:12525:10: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
12525 | return BIO_s_mem();
| ^~~~~~~~~~~
_pypy_openssl.c: In function '_cffi_d_CRYPTO_mem_ctrl':
_pypy_openssl.c:15457:10: warning: implicit declaration of function 'CRYPTO_mem_ctrl'; did you mean 'CRYPTO_memcmp'? [-Wimplicit-function-declaration]
15457 | return CRYPTO_mem_ctrl(x0);
| ^~~~~~~~~~~~~~~
| CRYPTO_memcmp
_pypy_openssl.c: In function '_cffi_d_ERR_GET_FUNC':
_pypy_openssl.c:21094:10: warning: implicit declaration of function 'ERR_GET_FUNC'; did you mean 'ERR_GET_LIB'? [-Wimplicit-function-declaration]
21094 | return ERR_GET_FUNC(x0);
| ^~~~~~~~~~~~
| ERR_GET_LIB
_pypy_openssl.c: In function '_cffi_d_FIPS_mode':
_pypy_openssl.c:25768:10: warning: implicit declaration of function 'FIPS_mode' [-Wimplicit-function-declaration]
25768 | return FIPS_mode();
| ^~~~~~~~~
_pypy_openssl.c: In function '_cffi_d_FIPS_mode_set':
_pypy_openssl.c:25794:10: warning: implicit declaration of function 'FIPS_mode_set' [-Wimplicit-function-declaration]
25794 | return FIPS_mode_set(x0);
| ^~~~~~~~~~~~~
_pypy_openssl.c: In function '_cffi_d_OCSP_resp_get0_certs':
_pypy_openssl.c:28882:10: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
28882 | return OCSP_resp_get0_certs(x0);
| ^~~~~~~~~~~~~~~~~~~~~~~~