Skip to content

Commit

Permalink
Fix more OpenSSL versioning issues
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Jan 23, 2019
1 parent 2f4660e commit a645278
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/lib/eap/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ USES_APPLE_DEPRECATED_API /* OpenSSL API has been deprecated by Apple */

#include <freeradius-devel/util/sha1.h>
#include <freeradius-devel/tls/base.h>
#include <freeradius-devel/tls/missing.h>

#include "tls.h"
#include "base.h"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tls/attrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/**
* $Id$
* @file attrs.h
* @file src/lib/tls/attrs.h
* @brief Attribute definitions used by the FreeRADIUS OpenSSL wrapper library
*
* @copyright 2018 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
Expand Down
7 changes: 6 additions & 1 deletion src/lib/util/hmac_md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ RCSID("$Id$")
#include <freeradius-devel/util/thread_local.h>

#ifdef HAVE_OPENSSL_EVP_H
# include <freeradius-devel/tls/base.h>
# include <openssl/hmac.h>

#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
# define EVP_MD_CTX_new EVP_MD_CTX_create
# define EVP_MD_CTX_free EVP_MD_CTX_destroy
# define EVP_MD_CTX_reset EVP_MD_CTX_cleanup
#endif

fr_thread_local_setup(HMAC_CTX *, md5_hmac_ctx)

static void _hmac_md5_ctx_free_on_exit(void *arg)
Expand Down
11 changes: 10 additions & 1 deletion src/lib/util/hmac_sha1.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,18 @@ unsigned int sha1_data_problems = 0;
#endif

#ifdef HAVE_OPENSSL_EVP_H
# include <freeradius-devel/tls/base.h>
# include <openssl/hmac.h>

/*
* This shim needs to be here to avoid the explicit
* dependency on our TLS library.
*/
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
# define EVP_MD_CTX_new EVP_MD_CTX_create
# define EVP_MD_CTX_free EVP_MD_CTX_destroy
# define EVP_MD_CTX_reset EVP_MD_CTX_cleanup
#endif

fr_thread_local_setup(HMAC_CTX *, sha1_hmac_ctx)

static void _hmac_sha1_ctx_free_on_exit(void *arg)
Expand Down
1 change: 1 addition & 0 deletions src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ USES_APPLE_DEPRECATED_API /* OpenSSL API has been deprecated by Apple */

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/tls/base.h>
#include <freeradius-devel/tls/missing.h>
#include <freeradius-devel/server/module.h>

#include "eap_pwd.h"
Expand Down
2 changes: 2 additions & 0 deletions src/modules/rlm_wimax/rlm_wimax.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ USES_APPLE_DEPRECATED_API /* OpenSSL API has been deprecated by Apple */
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module.h>
#include <freeradius-devel/tls/base.h>
#include <freeradius-devel/tls/missing.h>

/*
* FIXME: Add check for this header to configure.ac
*/
Expand Down

0 comments on commit a645278

Please sign in to comment.