From: sashan Date: Tue, 18 Dec 2018 11:04:56 +0000 (+0100) Subject: Fix build issues with Solaris native compiler X-Git-Tag: krb5-1.18-beta1~202 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F876%2Fhead;p=thirdparty%2Fkrb5.git Fix build issues with Solaris native compiler In the LDAP KDB module, fix an empty initializer. In the SPAKE edwards25519 code, use autoconf tests to determine whether to use the 64-bit code. In the SPAKE update_thash() function, make sure the types of the conditional expression results match exactly. In libkrb5support, link against zap.o now that k5buf.o can use zap() (as of commit 8ee8246c14702dc03b02e31b9fb5b7c2bb674bfb). [ghudson@mit.edu: squashed commits; rewrote commit message; adjusted autoconf tests; minor code changes] ticket: 8769 (new) tags: pullup target_version: 1.17 --- diff --git a/src/configure.in b/src/configure.in index 84529c120c..61ef738dc4 100644 --- a/src/configure.in +++ b/src/configure.in @@ -842,6 +842,10 @@ AC_CHECK_TYPES([struct rt_msghdr], , , [ #include ]) +# Tests for 64-bit edwards25519 code. +AC_CHECK_SIZEOF([size_t]) +AC_CHECK_TYPES([__int128_t, __uint128_t]) + # stuff for util/profile # AC_KRB5_TCL already done diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c index 4dac2420a5..ee9c02814e 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c @@ -628,7 +628,7 @@ update_ldap_mod_auth_ind(krb5_context context, krb5_db_entry *entry, int i = 0; krb5_error_code ret; char *auth_ind = NULL; - char *strval[10] = {}; + char *strval[10] = { 0 }; char *ai, *ai_save = NULL; int sv_num = sizeof(strval) / sizeof(*strval); diff --git a/src/plugins/preauth/spake/edwards25519.c b/src/plugins/preauth/spake/edwards25519.c index fd228d9d46..c766c28702 100644 --- a/src/plugins/preauth/spake/edwards25519.c +++ b/src/plugins/preauth/spake/edwards25519.c @@ -101,18 +101,11 @@ #pragma GCC diagnostic ignored "-Wdeclaration-after-statement" #endif -/* - * These preprocessor conditionals are derived the BoringSSL - * include/openssl/base.h (OPENSSL_64_BIT) and crypto/internal.h - * (BORINGSSL_HAS_UINT128). - */ -#if defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || defined(__aarch64__) || ((defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN)) || defined(__mips__) && defined(__LP64__) -#if !defined(_MSC_VER) || defined(__clang__) +#if SIZEOF_SIZE_T >= 8 && defined(HAVE___INT128_T) && defined(HAVE___UINT128_T) #define BORINGSSL_CURVE25519_64BIT typedef __int128_t int128_t; typedef __uint128_t uint128_t; #endif -#endif #ifndef EDWARDS25519_ASSERTS #define assert_fe(f) diff --git a/src/plugins/preauth/spake/util.c b/src/plugins/preauth/spake/util.c index cbdbbd7acf..b72ae67fdd 100644 --- a/src/plugins/preauth/spake/util.c +++ b/src/plugins/preauth/spake/util.c @@ -78,6 +78,7 @@ update_thash(krb5_context context, groupstate *gstate, int32_t group, krb5_error_code ret; size_t hashlen; krb5_data dlist[3]; + const krb5_data empty = empty_data(); if (thash->length == 0) { /* Initialize the transcript hash to all zeros. */ @@ -91,8 +92,8 @@ update_thash(krb5_context context, groupstate *gstate, int32_t group, /* Set up the data array and hash it with the group's hash function. */ dlist[0] = *thash; - dlist[1] = (data1 != NULL) ? *data1 : empty_data(); - dlist[2] = (data2 != NULL) ? *data2 : empty_data(); + dlist[1] = (data1 != NULL) ? *data1 : empty; + dlist[2] = (data2 != NULL) ? *data2 : empty; return group_hash(context, gstate, group, dlist, 3, (uint8_t *)thash->data); } diff --git a/src/util/support/Makefile.in b/src/util/support/Makefile.in index b1842daf90..db7b030b86 100644 --- a/src/util/support/Makefile.in +++ b/src/util/support/Makefile.in @@ -203,7 +203,7 @@ libkrb5support.exports: $(srcdir)/libkrb5support-fixed.exports Makefile ##DOS## $(RM) libkrb5support.exports ##DOS## $(MV) new-exports libkrb5support.exports -T_K5BUF_OBJS= t_k5buf.o k5buf.o $(PRINTF_ST_OBJ) +T_K5BUF_OBJS= t_k5buf.o k5buf.o zap.o $(PRINTF_ST_OBJ) t_k5buf: $(T_K5BUF_OBJS) $(CC_LINK) -o t_k5buf $(T_K5BUF_OBJS) @@ -223,7 +223,7 @@ path_win.o: $(srcdir)/path.c t_base64: t_base64.o base64.o $(CC_LINK) -o $@ t_base64.o base64.o -T_JSON_OBJS= t_json.o json.o base64.o k5buf.o $(PRINTF_ST_OBJ) +T_JSON_OBJS= t_json.o json.o base64.o k5buf.o zap.o $(PRINTF_ST_OBJ) t_json: $(T_JSON_OBJS) $(CC_LINK) -o $@ $(T_JSON_OBJS) @@ -240,7 +240,7 @@ t_unal: t_unal.o t_utf8: t_utf8.o utf8.o $(CC_LINK) -o t_utf8 t_utf8.o utf8.o -T_UTF16_OBJS= t_utf16.o utf8_conv.o utf8.o k5buf.o $(PRINTF_ST_OBJ) +T_UTF16_OBJS= t_utf16.o utf8_conv.o utf8.o k5buf.o zap.o $(PRINTF_ST_OBJ) t_utf16: $(T_UTF16_OBJS) $(CC_LINK) -o $@ $(T_UTF16_OBJS)