]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix build issues with Solaris native compiler 876/head
authorsashan <anedvedicky@gmail.com>
Tue, 18 Dec 2018 11:04:56 +0000 (12:04 +0100)
committerGreg Hudson <ghudson@mit.edu>
Thu, 3 Jan 2019 19:40:10 +0000 (14:40 -0500)
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

src/configure.in
src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c
src/plugins/preauth/spake/edwards25519.c
src/plugins/preauth/spake/util.c
src/util/support/Makefile.in

index 84529c120c5b9f1b4b5c72a5e5b5af0eb97dd9f9..61ef738dc4e7e860a472221d0aa03c20a9a69713 100644 (file)
@@ -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
index 4dac2420a578bfcdf9c9f55d2179759c88480035..ee9c02814edf00130b02008922e0f8b27377ebe2 100644 (file)
@@ -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);
 
index fd228d9d46c13e8a9a31943aac73123b86424b92..c766c287023d863062a4904d7a845de320f99991 100644 (file)
 #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)
index cbdbbd7acf3f969f18fd2582de19b7e248ffcb80..b72ae67fddd180adb421217686d86c48119ad1ae 100644 (file)
@@ -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);
 }
index b1842daf9007ef1da3b57375dd31423903d316d0..db7b030b864ca723cb8f378e1fa253a8dad33af2 100644 (file)
@@ -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)