From d57c75fb248a185c66e2f098c4dbfb1fe4b3634b Mon Sep 17 00:00:00 2001 From: Dan Breslau Date: Mon, 12 Sep 2016 16:05:29 -0400 Subject: [PATCH] Updates to try to fix undefined symbol errors --- libeap/Makefile.am | 8 +++++++- libeap/src/crypto/crypto.h | 10 ++++++++++ libeap/src/utils/eloop.h | 9 +++++++++ mech_eap/util.h | 13 ++----------- mech_eap/util_oid.c | 12 ++++++++++++ 5 files changed, 40 insertions(+), 12 deletions(-) diff --git a/libeap/Makefile.am b/libeap/Makefile.am index 890a9ea..55d7819 100644 --- a/libeap/Makefile.am +++ b/libeap/Makefile.am @@ -99,6 +99,7 @@ AM_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH AM_CFLAGS += -DCONFIG_INTERNAL_SHA1 AM_CFLAGS += -DEAP_TLS_OPENSSL AM_CFLAGS += -DPKCS12_FUNCS +AM_CFLAGS += -DCONFIG_CRYPTO_INTERNAL AM_CFLAGS += -DCONFIG_SHA256 UTILS_SRCS = src/utils/base64.c \ @@ -111,11 +112,12 @@ UTILS_SRCS = src/utils/base64.c \ src/utils/wpabuf.c \ src/utils/os_unix.c \ src/utils/radius_utils.c \ -src/utils/radius_utils.h \ + src/utils/radius_utils.h \ src/utils/base64.h \ src/utils/build_config.h \ src/utils/common.h \ src/utils/eloop.h \ + src/utils/eloop.c \ src/utils/includes.h \ src/utils/ip_addr.h \ src/utils/list.h \ @@ -145,6 +147,7 @@ CRYPTO_SRCS = \ src/crypto/aes-siv.h \ src/crypto/aes-unwrap.c \ src/crypto/aes-wrap.c \ + src/crypto/tls_openssl.c \ src/crypto/aes.h \ src/crypto/aes_i.h \ src/crypto/aes_wrap.h \ @@ -160,6 +163,8 @@ CRYPTO_SRCS = \ src/crypto/milenage.h \ src/crypto/ms_funcs.c \ src/crypto/ms_funcs.h \ + src/crypto/random.c \ + src/crypto/random.h \ src/crypto/rc4.c \ src/crypto/sha1.c \ src/crypto/sha1-internal.c \ @@ -167,6 +172,7 @@ CRYPTO_SRCS = \ src/crypto/sha1-prf.c \ src/crypto/sha1-tlsprf.c \ src/crypto/sha1-tprf.c \ + src/crypto/sha256-internal.c \ src/crypto/sha256-prf.c \ src/crypto/sha256-tlsprf.c \ src/crypto/sha256.c \ diff --git a/libeap/src/crypto/crypto.h b/libeap/src/crypto/crypto.h index 534c4bd..368bacf 100644 --- a/libeap/src/crypto/crypto.h +++ b/libeap/src/crypto/crypto.h @@ -21,6 +21,11 @@ #ifndef CRYPTO_H #define CRYPTO_H +#ifdef __cplusplus +extern "C" { +#endif + + /** * md4_vector - MD4 hash for data vector * @num_elem: Number of elements in the data vector @@ -806,4 +811,9 @@ int crypto_ec_point_cmp(const struct crypto_ec *e, const struct crypto_ec_point *a, const struct crypto_ec_point *b); + +#ifdef __cplusplus +} +#endif + #endif /* CRYPTO_H */ diff --git a/libeap/src/utils/eloop.h b/libeap/src/utils/eloop.h index 07b8c0d..00233a0 100644 --- a/libeap/src/utils/eloop.h +++ b/libeap/src/utils/eloop.h @@ -17,6 +17,11 @@ #ifndef ELOOP_H #define ELOOP_H +#ifdef __cplusplus +extern "C" { +#endif + + /** * ELOOP_ALL_CTX - eloop_cancel_timeout() magic number to match all timeouts */ @@ -356,4 +361,8 @@ int eloop_terminated(void); */ void eloop_wait_for_read_sock(int sock); +#ifdef __cplusplus +} +#endif + #endif /* ELOOP_H */ diff --git a/mech_eap/util.h b/mech_eap/util.h index 62b9f22..f1b4597 100644 --- a/mech_eap/util.h +++ b/mech_eap/util.h @@ -655,17 +655,8 @@ duplicateOidSet(OM_uint32 *minor, const gss_OID_set src, gss_OID_set *dst); -static inline int -oidEqual(const gss_OID_desc *o1, const gss_OID_desc *o2) -{ - if (o1 == GSS_C_NO_OID) - return (o2 == GSS_C_NO_OID); - else if (o2 == GSS_C_NO_OID) - return (o1 == GSS_C_NO_OID); - else - return (o1->length == o2->length && - memcmp(o1->elements, o2->elements, o1->length) == 0); -} +extern int +oidEqual(const gss_OID_desc *o1, const gss_OID_desc *o2); /* util_ordering.c */ OM_uint32 diff --git a/mech_eap/util_oid.c b/mech_eap/util_oid.c index 096c9f8..7a24f5a 100644 --- a/mech_eap/util_oid.c +++ b/mech_eap/util_oid.c @@ -204,3 +204,15 @@ duplicateOidSet(OM_uint32 *minor, return major; } + +int +oidEqual(const gss_OID_desc *o1, const gss_OID_desc *o2) +{ + if (o1 == GSS_C_NO_OID) + return (o2 == GSS_C_NO_OID); + else if (o2 == GSS_C_NO_OID) + return (o1 == GSS_C_NO_OID); + else + return (o1->length == o2->length && + memcmp(o1->elements, o2->elements, o1->length) == 0); +} -- 2.1.4