krb5 commit: Fix build issues with Solaris native compiler

Greg Hudson ghudson at mit.edu
Thu Jan 3 16:16:47 EST 2019


https://github.com/krb5/krb5/commit/ecb03a4c31cf8a6b1bca3459ae56d4122398c18e
commit ecb03a4c31cf8a6b1bca3459ae56d4122398c18e
Author: sashan <anedvedicky at gmail.com>
Date:   Tue Dec 18 12:04:56 2018 +0100

    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 at mit.edu: squashed commits; rewrote commit message; adjusted
    autoconf tests; minor code changes]
    
    ticket: 8769 (new)
    tags: pullup
    target_version: 1.17

 src/configure.in                                   |    4 ++++
 src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c |    2 +-
 src/plugins/preauth/spake/edwards25519.c           |    9 +--------
 src/plugins/preauth/spake/util.c                   |    5 +++--
 src/util/support/Makefile.in                       |    6 +++---
 5 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/src/configure.in b/src/configure.in
index 84529c1..61ef738 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -842,6 +842,10 @@ AC_CHECK_TYPES([struct rt_msghdr], , , [
 #include <net/route.h>
 ])
 
+# 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 4dac242..ee9c028 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 fd228d9..c766c28 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 cbdbbd7..b72ae67 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 b1842da..db7b030 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)


More information about the cvs-krb5 mailing list