1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-17 23:55:32 +00:00

[ssl] Allow older versions of openssl. Refs #37

This commit is contained in:
Witold Filipczyk 2019-12-06 18:50:31 +01:00
parent 51dd9e7e6e
commit e8cb012ada
3 changed files with 12 additions and 0 deletions

View File

@ -1125,6 +1125,9 @@ else
EL_CONFIG(CONFIG_OPENSSL, [OpenSSL])
chosen_ssl_library="OpenSSL"
AC_CHECK_FUNCS(RAND_bytes)
AC_CHECK_FUNCS(ASN1_STRING_get0_data)
CFLAGS="$CFLAGS_X"
AC_SUBST(OPENSSL_CFLAGS)
fi

View File

@ -247,7 +247,12 @@ static int
match_uri_host_ip(const unsigned char *uri_host,
ASN1_OCTET_STRING *cert_host_asn1)
{
#ifdef HAVE_ASN1_STRING_GET0_DATA
const unsigned char *cert_host_addr = ASN1_STRING_get0_data(cert_host_asn1);
#else
const unsigned char *cert_host_addr = ASN1_STRING_data(cert_host_asn1);
#endif
struct in_addr uri_host_in;
#ifdef CONFIG_IPV6
struct in6_addr uri_host_in6;

View File

@ -470,7 +470,11 @@ void
random_nonce(unsigned char buf[], size_t size)
{
#ifdef USE_OPENSSL
#ifdef HAVE_RAND_BYTES
RAND_bytes(buf, size);
#else
RAND_pseudo_bytes(buf, size);
#endif
#elif defined(CONFIG_GNUTLS)
gcry_create_nonce(buf, size);
#else