Skip to content

Commit

Permalink
Use OPENSSL_VERSION_NUMBER for version detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Nov 1, 2013
1 parent 2735a59 commit c16e47f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion autoconf/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,6 @@ if test "x$support_crypto" != "xno" -o "x$support_tls" != "xno"; then

if test "$have_openssl" = "yes"; then
AC_DEFINE(HAVE_OPENSSL, 1, [Define to 1 if OpenSSL library is available])
AC_CHECK_LIB(crypto, EVP_PKEY_encrypt_old, AC_DEFINE(HAVE_OPENSSLv1, 1, [Set if have OpenSSL version 1.x]))
fi

if test "$support_crypto" != "no" -a "$have_openssl" = "yes"; then
Expand Down
2 changes: 1 addition & 1 deletion src/lib/crypto_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/*
* For OpenSSL version 1.x, EVP_PKEY_encrypt no longer exists. It was not an official API.
*/
#ifdef HAVE_OPENSSLv1
#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
#define EVP_PKEY_encrypt EVP_PKEY_encrypt_old
#define EVP_PKEY_decrypt EVP_PKEY_decrypt_old
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tls_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
extname = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ext)));

if (bstrcmp(extname, "subjectAltName")) {
#ifdef HAVE_OPENSSLv1
#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
const X509V3_EXT_METHOD *method;
#else
X509V3_EXT_METHOD *method;
Expand Down

0 comments on commit c16e47f

Please sign in to comment.