[gnutls-help] Compiling gnutls on solaris

dev dev at cor0.com
Thu Sep 25 15:29:21 CEST 2014


On Solaris 10 the build process does not get very far at all :

/usr/local/bin/gmake  all-recursive
gmake[1]: Entering directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001'
Making all in gl
gmake[2]: Entering directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/gl'
  GEN      byteswap.h
  GEN      c++defs.h
  GEN      arg-nonnull.h
  GEN      warn-on-use.h
  GEN      netdb.h
  GEN      stdalign.h
  GEN      stdint.h
  GEN      stdio.h
  GEN      stdlib.h
  GEN      string.h
  GEN      strings.h
  GEN      sys/socket.h
  GEN      sys/stat.h
  GEN      sys/time.h
  GEN      sys/types.h
  GEN      sys/uio.h
  GEN      time.h
  GEN      unistd.h
  GEN      wchar.h
/usr/local/bin/gmake  all-recursive
gmake[3]: Entering directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/gl'
Making all in tests
gmake[4]: Entering directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/gl/tests'
  GEN      c++defs.h
  GEN      arg-nonnull.h
  GEN      warn-on-use.h
  GEN      fcntl.h
  GEN      inttypes.h
/usr/local/bin/gmake  all-recursive
gmake[5]: Entering directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/gl/tests'
Making all in .
gmake[6]: Entering directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/gl/tests'
gmake[6]: Nothing to be done for `all-am'.
gmake[6]: Leaving directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/gl/tests'
gmake[5]: Leaving directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/gl/tests'
gmake[4]: Leaving directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/gl/tests'
gmake[4]: Entering directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/gl'
  CC       base64.lo
  CC       c-ctype.lo
  CC       hash-pjw-bare.lo
  CC       read-file.lo
  CC       sys_socket.lo
  CC       u64.lo
  CC       unistd.lo
  CC       xsize.lo
  CC       asnprintf.lo
  CC       getdelim.lo
  CC       getline.lo
  CC       memmem.lo
  CC       printf-args.lo
  CC       printf-parse.lo
  CC       strndup.lo
  CC       strnlen.lo
  CC       strverscmp.lo
  CC       vasnprintf.lo
  CCLD     libgnu.la
gmake[4]: Leaving directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/gl'
gmake[3]: Leaving directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/gl'
gmake[2]: Leaving directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/gl'
Making all in lib
gmake[2]: Entering directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/lib'
/usr/local/bin/gmake  all-recursive
gmake[3]: Entering directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/lib'
Making all in includes
gmake[4]: Entering directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/lib/includes'
gmake[4]: Nothing to be done for `all'.
gmake[4]: Leaving directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/lib/includes'
Making all in x509
gmake[4]: Entering directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/lib/x509'
  CC       common.lo
  CC       key_encode.lo
  CC       key_decode.lo
  CC       crl.lo
  CC       crl_write.lo
  CC       crq.lo
"crq.c", line 654: warning: statement not reached
"crq.c", line 1921: warning: statement not reached
"crq.c", line 1978: warning: statement not reached
  CC       dn.lo
  CC       extensions.lo
"extensions.c", line 489: warning: statement not reached
  CC       mpi.lo
  CC       output.lo
"output.c", line 266: warning: statement not reached
  CC       pbkdf2-sha1.lo
  CC       pkcs12.lo
  CC       pkcs12_bag.lo
  CC       pkcs12_encr.lo
"pkcs12_encr.c", line 140: warning: enum type mismatch: arg #1
  CC       pkcs7.lo
  CC       privkey.lo
  CC       privkey_pkcs8.lo
  CC       privkey_openssl.lo
  CC       rfc2818_hostname.lo
  CC       sign.lo
  CC       verify.lo
  CC       x509.lo
"x509.c", line 2954: warning: argument #3 is incompatible with
prototype:
        prototype: pointer to unsigned int :
"./../includes/gnutls/x509-ext.h", line 64
        argument : pointer to enum gnutls_x509_subject_alt_name_t
{GNUTLS_SAN_OTHERNAME_XMPP(1000), GNUTLS_SAN_DN(6),
GNUTLS_SAN_OTHERNAME(5), GNUTLS_SAN_IPADDRESS(4), GNUTLS_SAN_URI(3),
GNUTLS_SAN_RFC822NAME(2), GNUTLS_SAN_DNSNAME(1)}
  CC       x509_dn.lo
  CC       x509_write.lo
  CC       name_constraints.lo
  CC       verify-high.lo
  CC       verify-high2.lo
"verify-high2.c", line 312: error: undefined struct/union member: d_type
"verify-high2.c", line 312: error: undefined symbol: DT_REG
"verify-high2.c", line 312: error: improper member use: d_type
"verify-high2.c", line 312: error: undefined symbol: DT_LNK
"verify-high2.c", line 312: error: improper member use: d_type
"verify-high2.c", line 312: error: undefined symbol: DT_UNKNOWN
c99: acomp failed for verify-high2.c
gmake[4]: *** [verify-high2.lo] Error 1
gmake[4]: Leaving directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/lib/x509'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/lib'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001/lib'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory
`/usr/local/build/gnutls-3.3.8_SunOS5.10_sparcv9_001'
gmake: *** [all] Error 2
node000 $


So, there you have it.


Between gnutls-3.3.5 and 3.3.8 there have been a pile of changes to that
file :


node000 $ diff -nu
../gnutls-3.3.5_SunOS5.10_sparcv9_001/lib/x509/verify-high2.c
./lib/x509/verify-high2.c
--- ../gnutls-3.3.5_SunOS5.10_sparcv9_001/lib/x509/verify-high2.c
      Mon Jun 16 16:59:00 2014
+++ ./lib/x509/verify-high2.c   Fri Sep 12 16:31:50 2014
@@ -1,5 +1,6 @@
 /*
- * Copyright (C) 2012 Free Software Foundation, Inc.
+ * Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ * Copyright (C) 2014 Nikos Mavrogiannopoulos
  *
  * Author: Nikos Mavrogiannopoulos
  *
@@ -33,6 +34,8 @@
 #include "verify-high.h"
 #include "read-file.h"

+#include <dirent.h>
+
 /* Convenience functions for verify-high functionality
  */

@@ -283,6 +286,100 @@
        free(cas.data);

        return ret;
+}
+
+static
+int load_dir_certs(const char *dirname,
+                         gnutls_x509_trust_list_t list,
+                         unsigned int tl_flags, unsigned int tl_vflags,
+                         unsigned type, unsigned crl)
+{
+       DIR *dirp;
+       struct dirent *d;
+       int ret;
+       int r = 0;
+       char path[GNUTLS_PATH_MAX];
+
+       dirp = opendir(dirname);
+       if (dirp != NULL) {
+               do {
+#ifdef _WIN32
+                       d = readdir(dirp);
+                       if (d != NULL) {
+#else
+                       struct dirent e;
+                       ret = readdir_r(dirp, &e, &d);
+                       if (ret == 0 && d != NULL && (d->d_type ==
DT_REG || d->d_type == DT_LNK || d->d_type == DT_UNKNOWN)) {
+#endif
+                               snprintf(path, sizeof(path), "%s/%s",
+                                        dirname, d->d_name);
+
+                               if (crl != 0) {
+                                       ret =
+
                                          gnutls_x509_trust_list_add_trust_file
+                                           (list, NULL, path, type,
tl_flags,
+                                            tl_vflags);
+                               } else {
+                                       ret =
+
                                          gnutls_x509_trust_list_add_trust_file
+                                           (list, path, NULL, type,
tl_flags,
+                                            tl_vflags);
+                               }
+                               if (ret >= 0)
+                                       r += ret;
+                       }
+               }
+               while (d != NULL);
+               closedir(dirp);
+       }
+
+       return r;
+}
+
+/**
+ * gnutls_x509_trust_list_add_trust_dir:
+ * @list: The structure of the list
+ * @ca_dir: A directory containing the CAs (optional)
+ * @crl_dir: A directory containing a list of CRLs (optional)
+ * @type: The format of the certificates
+ * @tl_flags: GNUTLS_TL_*
+ * @tl_vflags: gnutls_certificate_verify_flags if flags specifies
GNUTLS_TL_VERIFY_CRL
+ *
+ * This function will add the given certificate authorities
+ * to the trusted list. Only directories are accepted by
+ * this function.
+ *
+ * Returns: The number of added elements is returned.
+ *
+ * Since: 3.3.6
+ **/
+int
+gnutls_x509_trust_list_add_trust_dir(gnutls_x509_trust_list_t list,
+                                     const char *ca_dir,
+                                     const char *crl_dir,
+                                     gnutls_x509_crt_fmt_t type,
+                                     unsigned int tl_flags,
+                                     unsigned int tl_vflags)
+{
+       int ret = 0;
+
+       if (ca_dir != NULL) {
+               int r = 0;
+               r = load_dir_certs(ca_dir, list, tl_flags, tl_vflags,
type, 0);
+
+               if (r >= 0)
+                       ret += r;
+       }
+
+       if (crl_dir) {
+               int r = 0;
+               r = load_dir_certs(crl_dir, list, tl_flags, tl_vflags,
type, 1);
+
+               if (r >= 0)
+                       ret += r;
+       }
+
+       return ret;
 }

 /**


So this will take time to sort out as usual.

dev



More information about the Gnutls-help mailing list