Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update LibreSSL support #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
#endif

#ifndef HAVE_I2D_RE_X509_REQ_TBS
#define HAVE_I2D_RE_X509_REQ_TBS OPENSSL_PREREQ(1,1,0)
#define HAVE_I2D_RE_X509_REQ_TBS (OPENSSL_PREREQ(1,1,0) || LIBRESSL_PREREQ(3,5,1))
#endif

#ifndef HAVE_RSA_GET0_CRT_PARAMS
Expand Down Expand Up @@ -376,7 +376,7 @@
#endif

#ifndef HAVE_SSL_CTX_SET_GROUPS_LIST
#if OPENSSL_PREREQ(1,1,1)
#if (OPENSSL_PREREQ(1,1,1) || LIBRESSL_PREREQ(2,7,1))
#define HAVE_SSL_CTX_SET_GROUPS_LIST 1
#elif HAVE_SSL_CTX_SET_CURVES_LIST
#define SSL_CTX_set1_groups_list SSL_CTX_set1_curves_list
Expand All @@ -387,7 +387,7 @@
#endif

#ifndef HAVE_SSL_CTX_SET_GROUPS_LIST
#define HAVE_SSL_CTX_SET_GROUPS_LIST OPENSSL_PREREQ(1,1,1)
#define HAVE_SSL_CTX_SET_GROUPS_LIST (OPENSSL_PREREQ(1,1,1) || LIBRESSL_PREREQ(2,7,1))
#endif

#ifndef HAVE_SSL_CTX_SET_ECDH_AUTO
Expand Down Expand Up @@ -423,7 +423,7 @@
#endif

#ifndef HAVE_SSL_CTX_CERT_STORE
#define HAVE_SSL_CTX_CERT_STORE (!OPENSSL_PREREQ(1,1,0))
#define HAVE_SSL_CTX_CERT_STORE (!OPENSSL_PREREQ(1,1,0) && !LIBRESSL_PREREQ(2,0,0))
#endif

#ifndef HAVE_SSL_CTX_SET_TLSEXT_STATUS_TYPE
Expand Down Expand Up @@ -491,7 +491,7 @@
#endif

#ifndef HAVE_SSL_SET_GROUPS_LIST
#if OPENSSL_PREREQ(1,1,1)
#if (OPENSSL_PREREQ(1,1,1) || LIBRESSL_PREREQ(2,7,1))
#define HAVE_SSL_SET_GROUPS_LIST 1
#elif HAVE_SSL_SET_CURVES_LIST
#define SSL_set1_groups_list SSL_set1_curves_list
Expand Down Expand Up @@ -582,7 +582,7 @@
#endif

#ifndef HAVE_X509_STORE_REFERENCES
#define HAVE_X509_STORE_REFERENCES (!OPENSSL_PREREQ(1,1,0))
#define HAVE_X509_STORE_REFERENCES (!OPENSSL_PREREQ(1,1,0) && !LIBRESSL_PREREQ(2,0,0))
#endif

#ifndef HAVE_X509_STORE_UP_REF
Expand Down Expand Up @@ -1986,7 +1986,11 @@ static size_t compat_SSL_SESSION_get_master_key(const SSL_SESSION *session, unsi
#define SSL_client_version(...) EXPAND( compat_SSL_client_version(__VA_ARGS__) )

static int compat_SSL_client_version(const SSL *ssl) {
#if LIBRESSL_PREREQ(2,5,2)
return SSL_version(ssl);
#else
return ssl->client_version;
#endif
} /* compat_SSL_client_version() */
#endif

Expand Down