a few patches for gnupg-2.0.4

Peter O'Gorman gnupg-devel at mlists.thewrittenword.com
Fri May 11 04:01:14 CEST 2007


Hi,

We just built gnupg-2.0.4, thanks. We did make some changes though.
HP-UX 10.20 does not have dlopen() and its gmtime_r returns 0 on
success.

Added a configure test to see if #pragma weak works, and another test
for socklen_t (we could have used to socklen_t test from gnulib, but
this one seemed somehow better at the time).

Tru64-4.0 does not have snprintf and IRIX6.5 does not have strsep, we
added these gnulib modules (patches not attached, do you want them?).

AIX-4.3.3 compiler does not like ',' at the end of enum.

Some older compilers did not like the key_rsa_valid.string construct,
replaced with #define.

HP-UX compilers bailed when they saw 'static const char const
*charsets[]', so we removed a const.

IRIX and other compilers refuse to do pointer math on void* pointers.
'The expression must be a pointer to a complete object type.'

Some compilers bailed with the extra semi-colon in 'int error;;'

We wanted to do a configure check for __func__, but it seems as
though the file asschk.c does not #include <config.h> and may be
meant as a standalone? So we used preprocessor defines to get it
compiling. SUNPRO_C on solaris2.6 did not like the #define die.

We built with curl support everywhere and found that some libraries
were not added in this case.

Thank you,
Peter
-------------- next part --------------
Index: configure.ac
===================================================================
--- configure.ac.orig	2007-05-10 22:09:34.587106000 +0000
+++ configure.ac	2007-05-10 22:09:38.765314000 +0000
@@ -459,8 +459,14 @@
 AC_SYS_LARGEFILE
 GNUPG_CHECK_FAQPROG
 GNUPG_CHECK_USTAR
-
-
+GPG_TYPE_SOCKLEN_T
+AC_CACHE_CHECK([for pragma weak],[gpg_cv_pragma_weak],[
+AC_TRY_COMPILE([
+#pragma weak pth_fork
+],[],[gpg_cv_pragma_weak=yes],[gpg_cv_pragma_weak=no])])
+if test "x$gpg_cv_pragma_weak" = "xyes"; then
+AC_DEFINE([HAVE_PRAGMA_WEAK],[1],[define if pragma weak works])
+fi
 try_gettext=yes
 have_dosish_system=no
 have_w32_system=no
@@ -625,7 +611,7 @@
 #
 gnupg_dlopen_save_libs="$LIBS"
 LIBS=""
-AC_SEARCH_LIBS(dlopen, c dl,,,)
+AC_SEARCH_LIBS(dlopen, c dl,,[AC_SEARCH_LIBS(shl_load, dld,,,)],)
 DL_LIBS=$LIBS
 AC_SUBST(DL_LIBS)
 LIBS="$gnupg_dlopen_save_libs"
@@ -890,7 +876,7 @@
 #
 AC_HEADER_STDC
 AC_CHECK_HEADERS([string.h unistd.h langinfo.h termio.h locale.h getopt.h])
-AC_CHECK_HEADERS([pty.h pwd.h inttypes.h])
+AC_CHECK_HEADERS([pty.h pwd.h inttypes.h dlfcn.h dl.h])
 AC_HEADER_TIME
 
 
@@ -986,7 +972,7 @@
 #
 gl_SOURCE_BASE([gl])
 gl_M4_BASE([gl/m4])
-gl_MODULES([setenv mkdtemp vasprintf xsize])
+gl_MODULES([setenv mkdtemp vasprintf xsize snprintf strsep])
 gl_INIT
 
 
Index: keyserver/Makefile.am
===================================================================
--- keyserver/Makefile.am.orig	2007-05-10 22:09:34.828908000 +0000
+++ keyserver/Makefile.am	2007-05-11 00:25:45.228451000 +0000
@@ -45,7 +45,6 @@
                       $(NETLIBS) $(other_libs)
 
 gpg2keys_finger_SOURCES = gpgkeys_finger.c ksutil.c ksutil.h no-libgcrypt.c
-gpg2keys_finger_CPPFLAGS = $(AM_CPPFLAGS)
 gpg2keys_finger_LDADD = $(common_libs) $(GPG_ERROR_LIBS) \
                         $(NETLIBS) $(other_libs)
 
@@ -61,11 +60,15 @@
 gpg2keys_hkp_CPPFLAGS = $(AM_CPPFLAGS)
 gpg2keys_hkp_LDADD = $(common_libs) $(GPG_ERROR_LIBS) $(NETLIBS) $(DNSLIBS) \
 	             $(other_libs) 
+gpg2keys_finger_CPPFLAGS = $(AM_CPPFLAGS)
 else
 gpg2keys_curl_CPPFLAGS = $(LIBCURL_CPPFLAGS) $(AM_CPPFLAGS)
-gpg2keys_curl_LDADD = $(LIBCURL) $(GETOPT)
+gpg2keys_curl_LDADD = $(common_libs) $(LIBCURL)  $(GPG_ERROR_LIBS) $(GETOPT) \
+		$(NETLIBS) $(DNSLIBS) $(other_libs)
 gpg2keys_hkp_CPPFLAGS = $(LIBCURL_CPPFLAGS) $(AM_CPPFLAGS)
-gpg2keys_hkp_LDADD = $(LIBCURL) $(GETOPT)
+gpg2keys_hkp_LDADD = $(common_libs) $(LIBCURL)  $(GPG_ERROR_LIBS) $(GETOPT) \
+		$(NETLIBS) $(DNSLIBS) $(other_libs)
+gpg2keys_finger_CPPFLAGS = $(LIBCURL_CPPFLAGS) $(AM_CPPFLAGS)
 endif
 
 # Make sure that all libs are build before we use them.  This is
Index: tests/asschk.c
===================================================================
--- tests/asschk.c.orig	2007-05-10 22:09:34.865014000 +0000
+++ tests/asschk.c	2007-05-10 22:09:38.944579000 +0000
@@ -121,13 +121,13 @@
 # if __GNUC__ >= 2
 #  define __func__ __FUNCTION__
 # else
-/* Let's try our luck here.  Some systems may provide __func__ without
-   providing __STDC_VERSION__ 199901L.  */
-#  if 0
 #   define __func__ "<unknown>"
-#  endif
+#   define _NO_REDEF_DIE_ 
 # endif
 #endif
+#if __SUNPRO_C<=0x530
+#   define _NO_REDEF_DIE_
+#endif
 
 #define spacep(p) (*(p) == ' ' || *(p) == '\t')
 
@@ -138,7 +138,7 @@
   LINE_ERR,
   LINE_STAT,
   LINE_DATA,
-  LINE_END,
+  LINE_END
 } LINETYPE;
 
 typedef enum {
@@ -200,9 +200,9 @@
 
   exit (1);
 }
-
+#ifndef _NO_REDEF_DIE_
 #define die(format, args...) (die) ("%s: " format, __func__ , ##args)
-
+#endif
 static void
 err (const char *format, ...)
 {
@@ -310,7 +310,7 @@
 	{
 	  int i;
 
-	  printf ("%s: read \"", __FUNCTION__);
+	  printf ("%s: read \"",__func__);
 	  for (i = 0; i < n; i ++)
 	    putc (buf[i], stdout);
 	  printf ("\"\n");
Index: agent/learncard.c
===================================================================
--- agent/learncard.c.orig	2007-05-10 22:09:34.901120000 +0000
+++ agent/learncard.c	2007-05-10 22:09:38.985453000 +0000
@@ -78,7 +78,7 @@
 typedef struct sinfo_s *SINFO;  
 
 struct sinfo_cb_parm_s {
-  int error;;
+  int error;
   SINFO info;
 };
 
Index: scd/app-openpgp.c
===================================================================
--- scd/app-openpgp.c.orig	2007-05-10 22:09:34.997628000 +0000
+++ scd/app-openpgp.c	2007-05-10 22:09:39.034018000 +0000
@@ -2223,13 +2223,13 @@
   else if (indatalen == (15 + 20) && hashalgo == GCRY_MD_SHA1
            && !memcmp (indata, sha1_prefix, 15))
     {
-      indata += 15;
+      indata = (char *)indata + 15;
       indatalen -= 15;
     }
   else if (indatalen == (15 + 20) && hashalgo == GCRY_MD_RMD160
            && !memcmp (indata, rmd160_prefix, 15))
     {
-      indata += 15;
+      indata = (char *)indata + 15;
       indatalen -= 15;
     }
   else
Index: m4/socklen.m4
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ m4/socklen.m4	2007-05-10 22:09:39.225443000 +0000
@@ -0,0 +1,42 @@
+dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Albert Chin, Windows fixes from Simon Josefsson.
+
+dnl Check for socklen_t: historically on BSD it is an int, and in
+dnl POSIX 1g it is a type of its own, but some platforms use different
+dnl types for the argument to getsockopt, getpeername, etc.  So we
+dnl have to test to find something that will work.
+
+dnl Windows fixes removed for db. Functions renamed, basic check
+dnl remains the same though.
+
+AC_DEFUN([GPG_TYPE_SOCKLEN_T],[
+   AC_CHECK_HEADERS_ONCE(sys/socket.h)
+     AC_MSG_CHECKING([for socklen_t or equivalent])
+      AC_CACHE_VAL([gpg_cv_socklen_t_equiv],[
+       gpg_cv_socklen_t_equiv=
+	   for t in socklen_t int size_t "unsigned int" "long int" "unsigned long int"; do
+	     AC_TRY_COMPILE(
+       [#include <sys/types.h>
+         #if HAVE_SYS_SOCKET_H
+         # include <sys/socket.h>
+         #elif HAVE_WS2TCPIP_H
+         # include <ws2tcpip.h>
+         #endif],
+        [$t len;
+         getpeername (0, 0, &len);],
+	       [gpg_cv_socklen_t_equiv="$t"])
+	     test "$gpg_cv_socklen_t_equiv" != "" && break
+	   done
+      ])
+      if test "$gpg_cv_socklen_t_equiv" = ""; then
+	AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
+      fi
+      AC_MSG_RESULT([$gpg_cv_socklen_t_equiv])
+	  if test "$gpg_cv_socklen_t_equiv" != "socklen_t"; then
+      AC_DEFINE_UNQUOTED([socklen_t], [$gpg_cv_socklen_t_equiv],
+	[type to use in place of socklen_t if not defined])
+	  fi])
Index: common/exechelp.c
===================================================================
--- common/exechelp.c.orig	2007-05-10 22:09:35.045872000 +0000
+++ common/exechelp.c	2007-05-10 22:09:39.251034000 +0000
@@ -61,7 +61,7 @@
    here. Using a weak symbol works but is not portable - we should
    provide a an explicit dummy pth module instead of using the
    pragma.  */ 
-#ifndef _WIN32
+#ifdef HAVE_PRAGMA_WEAK 
 #pragma weak pth_fork
 #pragma weak pth_waitpid
 #endif
Index: jnlib/Makefile.am
===================================================================
--- jnlib/Makefile.am.orig	2007-05-10 22:09:36.314332000 +0000
+++ jnlib/Makefile.am	2007-05-10 22:09:41.405833000 +0000
@@ -24,7 +24,7 @@
 
 EXTRA_DIST = README
 
-AM_CPPFLAGS = -I$(top_srcdir)/intl
+AM_CPPFLAGS = -I$(top_srcdir)/gl -I../gl  -I$(top_srcdir)/intl
 
 # We need libgcrypt because libjnlib-config includes gcrypt.h
 AM_CFLAGS = $(LIBGCRYPT_CFLAGS)
Index: agent/t-protect.c
===================================================================
--- agent/t-protect.c.orig	2007-05-10 22:09:34.949440000 +0000
+++ agent/t-protect.c	2007-05-10 22:09:41.443167000 +0000
@@ -48,97 +48,93 @@
     const char *string;
   };
   /* Valid RSA key.  */
-  struct key_spec key_rsa_valid =
-    {
-      "\x28\x31\x31\x3A\x70\x72\x69\x76\x61\x74\x65\x2D\x6B\x65\x79\x28\x33\x3A\x72\x73"
-      "\x61\x28\x31\x3A\x6E\x31\x32\x39\x3A\x00\xB6\xB5\x09\x59\x6A\x9E\xCA\xBC\x93\x92"
-      "\x12\xF8\x91\xE6\x56\xA6\x26\xBA\x07\xDA\x85\x21\xA9\xCA\xD4\xC0\x8E\x64\x0C\x04"
-      "\x05\x2F\xBB\x87\xF4\x24\xEF\x1A\x02\x75\xA4\x8A\x92\x99\xAC\x9D\xB6\x9A\xBE\x3D"
-      "\x01\x24\xE6\xC7\x56\xB1\xF7\xDF\xB9\xB8\x42\xD6\x25\x1A\xEA\x6E\xE8\x53\x90\x49"
-      "\x5C\xAD\xA7\x3D\x67\x15\x37\xFC\xE5\x85\x0A\x93\x2F\x32\xBA\xB6\x0A\xB1\xAC\x1F"
-      "\x85\x2C\x1F\x83\xC6\x25\xE7\xA7\xD7\x0C\xDA\x9E\xF1\x6D\x5C\x8E\x47\x73\x9D\x77"
-      "\xDF\x59\x26\x1A\xBE\x84\x54\x80\x7F\xF4\x41\xE1\x43\xFB\xD3\x7F\x85\x45\x29\x28"
-      "\x31\x3A\x65\x33\x3A\x01\x00\x01\x29\x28\x31\x3A\x64\x31\x32\x38\x3A\x07\x7A\xD3"
-      "\xDE\x28\x42\x45\xF4\x80\x6A\x1B\x82\xB7\x9E\x61\x6F\xBD\xE8\x21\xC8\x2D\x69\x1A"
-      "\x65\x66\x5E\x57\xB5\xFA\xD3\xF3\x4E\x67\xF4\x01\xE7\xBD\x2E\x28\x69\x9E\x89\xD9"
-      "\xC4\x96\xCF\x82\x19\x45\xAE\x83\xAC\x7A\x12\x31\x17\x6A\x19\x6B\xA6\x02\x7E\x77"
-      "\xD8\x57\x89\x05\x5D\x50\x40\x4A\x7A\x2A\x95\xB1\x51\x2F\x91\xF1\x90\xBB\xAE\xF7"
-      "\x30\xED\x55\x0D\x22\x7D\x51\x2F\x89\xC0\xCD\xB3\x1A\xC0\x6F\xA9\xA1\x95\x03\xDD"
-      "\xF6\xB6\x6D\x0B\x42\xB9\x69\x1B\xFD\x61\x40\xEC\x17\x20\xFF\xC4\x8A\xE0\x0C\x34"
-      "\x79\x6D\xC8\x99\xE5\x29\x28\x31\x3A\x70\x36\x35\x3A\x00\xD5\x86\xC7\x8E\x5F\x1B"
-      "\x4B\xF2\xE7\xCD\x7A\x04\xCA\x09\x19\x11\x70\x6F\x19\x78\x8B\x93\xE4\x4E\xE2\x0A"
-      "\xAF\x46\x2E\x83\x63\xE9\x8A\x72\x25\x3E\xD8\x45\xCC\xBF\x24\x81\xBB\x35\x1E\x85"
-      "\x57\xC8\x5B\xCF\xFF\x0D\xAB\xDB\xFF\x8E\x26\xA7\x9A\x09\x38\x09\x6F\x27\x29\x28"
-      "\x31\x3A\x71\x36\x35\x3A\x00\xDB\x0C\xDF\x60\xF2\x6F\x2A\x29\x6C\x88\xD6\xBF\x9F"
-      "\x8E\x5B\xE4\x5C\x0D\xDD\x71\x3C\x96\xCC\x73\xEB\xCB\x48\xB0\x61\x74\x09\x43\xF2"
-      "\x1D\x2A\x93\xD6\xE4\x2A\x72\x11\xE7\xF0\x2A\x95\xDC\xED\x6C\x39\x0A\x67\xAD\x21"
-      "\xEC\xF7\x39\xAE\x8A\x0C\xA4\x6F\xF2\xEB\xB3\x29\x28\x31\x3A\x75\x36\x34\x3A\x33"
-      "\x14\x91\x95\xF1\x69\x12\xDB\x20\xA4\x8D\x02\x0D\xBC\x3B\x9E\x38\x81\xB3\x9D\x72"
-      "\x2B\xF7\x93\x78\xF6\x34\x0F\x43\x14\x8A\x6E\x9F\xC5\xF5\x3E\x28\x53\xB7\x38\x7B"
-      "\xA4\x44\x3B\xA5\x3A\x52\xFC\xA8\x17\x3D\xE6\xE8\x5B\x42\xF9\x78\x3D\x4A\x78\x17"
+#define key_rsa_valid \
+      "\x28\x31\x31\x3A\x70\x72\x69\x76\x61\x74\x65\x2D\x6B\x65\x79\x28\x33\x3A\x72\x73" \
+      "\x61\x28\x31\x3A\x6E\x31\x32\x39\x3A\x00\xB6\xB5\x09\x59\x6A\x9E\xCA\xBC\x93\x92" \
+      "\x12\xF8\x91\xE6\x56\xA6\x26\xBA\x07\xDA\x85\x21\xA9\xCA\xD4\xC0\x8E\x64\x0C\x04" \
+      "\x05\x2F\xBB\x87\xF4\x24\xEF\x1A\x02\x75\xA4\x8A\x92\x99\xAC\x9D\xB6\x9A\xBE\x3D" \
+      "\x01\x24\xE6\xC7\x56\xB1\xF7\xDF\xB9\xB8\x42\xD6\x25\x1A\xEA\x6E\xE8\x53\x90\x49" \
+      "\x5C\xAD\xA7\x3D\x67\x15\x37\xFC\xE5\x85\x0A\x93\x2F\x32\xBA\xB6\x0A\xB1\xAC\x1F" \
+      "\x85\x2C\x1F\x83\xC6\x25\xE7\xA7\xD7\x0C\xDA\x9E\xF1\x6D\x5C\x8E\x47\x73\x9D\x77" \
+      "\xDF\x59\x26\x1A\xBE\x84\x54\x80\x7F\xF4\x41\xE1\x43\xFB\xD3\x7F\x85\x45\x29\x28" \
+      "\x31\x3A\x65\x33\x3A\x01\x00\x01\x29\x28\x31\x3A\x64\x31\x32\x38\x3A\x07\x7A\xD3" \
+      "\xDE\x28\x42\x45\xF4\x80\x6A\x1B\x82\xB7\x9E\x61\x6F\xBD\xE8\x21\xC8\x2D\x69\x1A" \
+      "\x65\x66\x5E\x57\xB5\xFA\xD3\xF3\x4E\x67\xF4\x01\xE7\xBD\x2E\x28\x69\x9E\x89\xD9" \
+      "\xC4\x96\xCF\x82\x19\x45\xAE\x83\xAC\x7A\x12\x31\x17\x6A\x19\x6B\xA6\x02\x7E\x77" \
+      "\xD8\x57\x89\x05\x5D\x50\x40\x4A\x7A\x2A\x95\xB1\x51\x2F\x91\xF1\x90\xBB\xAE\xF7" \
+      "\x30\xED\x55\x0D\x22\x7D\x51\x2F\x89\xC0\xCD\xB3\x1A\xC0\x6F\xA9\xA1\x95\x03\xDD" \
+      "\xF6\xB6\x6D\x0B\x42\xB9\x69\x1B\xFD\x61\x40\xEC\x17\x20\xFF\xC4\x8A\xE0\x0C\x34" \
+      "\x79\x6D\xC8\x99\xE5\x29\x28\x31\x3A\x70\x36\x35\x3A\x00\xD5\x86\xC7\x8E\x5F\x1B" \
+      "\x4B\xF2\xE7\xCD\x7A\x04\xCA\x09\x19\x11\x70\x6F\x19\x78\x8B\x93\xE4\x4E\xE2\x0A" \
+      "\xAF\x46\x2E\x83\x63\xE9\x8A\x72\x25\x3E\xD8\x45\xCC\xBF\x24\x81\xBB\x35\x1E\x85" \
+      "\x57\xC8\x5B\xCF\xFF\x0D\xAB\xDB\xFF\x8E\x26\xA7\x9A\x09\x38\x09\x6F\x27\x29\x28" \
+      "\x31\x3A\x71\x36\x35\x3A\x00\xDB\x0C\xDF\x60\xF2\x6F\x2A\x29\x6C\x88\xD6\xBF\x9F" \
+      "\x8E\x5B\xE4\x5C\x0D\xDD\x71\x3C\x96\xCC\x73\xEB\xCB\x48\xB0\x61\x74\x09\x43\xF2" \
+      "\x1D\x2A\x93\xD6\xE4\x2A\x72\x11\xE7\xF0\x2A\x95\xDC\xED\x6C\x39\x0A\x67\xAD\x21" \
+      "\xEC\xF7\x39\xAE\x8A\x0C\xA4\x6F\xF2\xEB\xB3\x29\x28\x31\x3A\x75\x36\x34\x3A\x33" \
+      "\x14\x91\x95\xF1\x69\x12\xDB\x20\xA4\x8D\x02\x0D\xBC\x3B\x9E\x38\x81\xB3\x9D\x72" \
+      "\x2B\xF7\x93\x78\xF6\x34\x0F\x43\x14\x8A\x6E\x9F\xC5\xF5\x3E\x28\x53\xB7\x38\x7B" \
+      "\xA4\x44\x3B\xA5\x3A\x52\xFC\xA8\x17\x3D\xE6\xE8\x5B\x42\xF9\x78\x3D\x4A\x78\x17" \
       "\xD0\x68\x0B\x29\x29\x29\x00"
-    };
+
   /* This RSA key is missing the last closing brace.  */
-  struct key_spec key_rsa_bogus_0 =
-    {
-      "\x28\x31\x31\x3A\x70\x72\x69\x76\x61\x74\x65\x2D\x6B\x65\x79\x28\x33\x3A\x72\x73"
-      "\x61\x28\x31\x3A\x6E\x31\x32\x39\x3A\x00\xB6\xB5\x09\x59\x6A\x9E\xCA\xBC\x93\x92"
-      "\x12\xF8\x91\xE6\x56\xA6\x26\xBA\x07\xDA\x85\x21\xA9\xCA\xD4\xC0\x8E\x64\x0C\x04"
-      "\x05\x2F\xBB\x87\xF4\x24\xEF\x1A\x02\x75\xA4\x8A\x92\x99\xAC\x9D\xB6\x9A\xBE\x3D"
-      "\x01\x24\xE6\xC7\x56\xB1\xF7\xDF\xB9\xB8\x42\xD6\x25\x1A\xEA\x6E\xE8\x53\x90\x49"
-      "\x5C\xAD\xA7\x3D\x67\x15\x37\xFC\xE5\x85\x0A\x93\x2F\x32\xBA\xB6\x0A\xB1\xAC\x1F"
-      "\x85\x2C\x1F\x83\xC6\x25\xE7\xA7\xD7\x0C\xDA\x9E\xF1\x6D\x5C\x8E\x47\x73\x9D\x77"
-      "\xDF\x59\x26\x1A\xBE\x84\x54\x80\x7F\xF4\x41\xE1\x43\xFB\xD3\x7F\x85\x45\x29\x28"
-      "\x31\x3A\x65\x33\x3A\x01\x00\x01\x29\x28\x31\x3A\x64\x31\x32\x38\x3A\x07\x7A\xD3"
-      "\xDE\x28\x42\x45\xF4\x80\x6A\x1B\x82\xB7\x9E\x61\x6F\xBD\xE8\x21\xC8\x2D\x69\x1A"
-      "\x65\x66\x5E\x57\xB5\xFA\xD3\xF3\x4E\x67\xF4\x01\xE7\xBD\x2E\x28\x69\x9E\x89\xD9"
-      "\xC4\x96\xCF\x82\x19\x45\xAE\x83\xAC\x7A\x12\x31\x17\x6A\x19\x6B\xA6\x02\x7E\x77"
-      "\xD8\x57\x89\x05\x5D\x50\x40\x4A\x7A\x2A\x95\xB1\x51\x2F\x91\xF1\x90\xBB\xAE\xF7"
-      "\x30\xED\x55\x0D\x22\x7D\x51\x2F\x89\xC0\xCD\xB3\x1A\xC0\x6F\xA9\xA1\x95\x03\xDD"
-      "\xF6\xB6\x6D\x0B\x42\xB9\x69\x1B\xFD\x61\x40\xEC\x17\x20\xFF\xC4\x8A\xE0\x0C\x34"
-      "\x79\x6D\xC8\x99\xE5\x29\x28\x31\x3A\x70\x36\x35\x3A\x00\xD5\x86\xC7\x8E\x5F\x1B"
-      "\x4B\xF2\xE7\xCD\x7A\x04\xCA\x09\x19\x11\x70\x6F\x19\x78\x8B\x93\xE4\x4E\xE2\x0A"
-      "\xAF\x46\x2E\x83\x63\xE9\x8A\x72\x25\x3E\xD8\x45\xCC\xBF\x24\x81\xBB\x35\x1E\x85"
-      "\x57\xC8\x5B\xCF\xFF\x0D\xAB\xDB\xFF\x8E\x26\xA7\x9A\x09\x38\x09\x6F\x27\x29\x28"
-      "\x31\x3A\x71\x36\x35\x3A\x00\xDB\x0C\xDF\x60\xF2\x6F\x2A\x29\x6C\x88\xD6\xBF\x9F"
-      "\x8E\x5B\xE4\x5C\x0D\xDD\x71\x3C\x96\xCC\x73\xEB\xCB\x48\xB0\x61\x74\x09\x43\xF2"
-      "\x1D\x2A\x93\xD6\xE4\x2A\x72\x11\xE7\xF0\x2A\x95\xDC\xED\x6C\x39\x0A\x67\xAD\x21"
-      "\xEC\xF7\x39\xAE\x8A\x0C\xA4\x6F\xF2\xEB\xB3\x29\x28\x31\x3A\x75\x36\x34\x3A\x33"
-      "\x14\x91\x95\xF1\x69\x12\xDB\x20\xA4\x8D\x02\x0D\xBC\x3B\x9E\x38\x81\xB3\x9D\x72"
-      "\x2B\xF7\x93\x78\xF6\x34\x0F\x43\x14\x8A\x6E\x9F\xC5\xF5\x3E\x28\x53\xB7\x38\x7B"
-      "\xA4\x44\x3B\xA5\x3A\x52\xFC\xA8\x17\x3D\xE6\xE8\x5B\x42\xF9\x78\x3D\x4A\x78\x17"
+#define key_rsa_bogus_0 \
+      "\x28\x31\x31\x3A\x70\x72\x69\x76\x61\x74\x65\x2D\x6B\x65\x79\x28\x33\x3A\x72\x73" \
+      "\x61\x28\x31\x3A\x6E\x31\x32\x39\x3A\x00\xB6\xB5\x09\x59\x6A\x9E\xCA\xBC\x93\x92" \
+      "\x12\xF8\x91\xE6\x56\xA6\x26\xBA\x07\xDA\x85\x21\xA9\xCA\xD4\xC0\x8E\x64\x0C\x04" \
+      "\x05\x2F\xBB\x87\xF4\x24\xEF\x1A\x02\x75\xA4\x8A\x92\x99\xAC\x9D\xB6\x9A\xBE\x3D" \
+      "\x01\x24\xE6\xC7\x56\xB1\xF7\xDF\xB9\xB8\x42\xD6\x25\x1A\xEA\x6E\xE8\x53\x90\x49" \
+      "\x5C\xAD\xA7\x3D\x67\x15\x37\xFC\xE5\x85\x0A\x93\x2F\x32\xBA\xB6\x0A\xB1\xAC\x1F" \
+      "\x85\x2C\x1F\x83\xC6\x25\xE7\xA7\xD7\x0C\xDA\x9E\xF1\x6D\x5C\x8E\x47\x73\x9D\x77" \
+      "\xDF\x59\x26\x1A\xBE\x84\x54\x80\x7F\xF4\x41\xE1\x43\xFB\xD3\x7F\x85\x45\x29\x28" \
+      "\x31\x3A\x65\x33\x3A\x01\x00\x01\x29\x28\x31\x3A\x64\x31\x32\x38\x3A\x07\x7A\xD3" \
+      "\xDE\x28\x42\x45\xF4\x80\x6A\x1B\x82\xB7\x9E\x61\x6F\xBD\xE8\x21\xC8\x2D\x69\x1A" \
+      "\x65\x66\x5E\x57\xB5\xFA\xD3\xF3\x4E\x67\xF4\x01\xE7\xBD\x2E\x28\x69\x9E\x89\xD9" \
+      "\xC4\x96\xCF\x82\x19\x45\xAE\x83\xAC\x7A\x12\x31\x17\x6A\x19\x6B\xA6\x02\x7E\x77" \
+      "\xD8\x57\x89\x05\x5D\x50\x40\x4A\x7A\x2A\x95\xB1\x51\x2F\x91\xF1\x90\xBB\xAE\xF7" \
+      "\x30\xED\x55\x0D\x22\x7D\x51\x2F\x89\xC0\xCD\xB3\x1A\xC0\x6F\xA9\xA1\x95\x03\xDD" \
+      "\xF6\xB6\x6D\x0B\x42\xB9\x69\x1B\xFD\x61\x40\xEC\x17\x20\xFF\xC4\x8A\xE0\x0C\x34" \
+      "\x79\x6D\xC8\x99\xE5\x29\x28\x31\x3A\x70\x36\x35\x3A\x00\xD5\x86\xC7\x8E\x5F\x1B" \
+      "\x4B\xF2\xE7\xCD\x7A\x04\xCA\x09\x19\x11\x70\x6F\x19\x78\x8B\x93\xE4\x4E\xE2\x0A" \
+      "\xAF\x46\x2E\x83\x63\xE9\x8A\x72\x25\x3E\xD8\x45\xCC\xBF\x24\x81\xBB\x35\x1E\x85" \
+      "\x57\xC8\x5B\xCF\xFF\x0D\xAB\xDB\xFF\x8E\x26\xA7\x9A\x09\x38\x09\x6F\x27\x29\x28" \
+      "\x31\x3A\x71\x36\x35\x3A\x00\xDB\x0C\xDF\x60\xF2\x6F\x2A\x29\x6C\x88\xD6\xBF\x9F" \
+      "\x8E\x5B\xE4\x5C\x0D\xDD\x71\x3C\x96\xCC\x73\xEB\xCB\x48\xB0\x61\x74\x09\x43\xF2" \
+      "\x1D\x2A\x93\xD6\xE4\x2A\x72\x11\xE7\xF0\x2A\x95\xDC\xED\x6C\x39\x0A\x67\xAD\x21" \
+      "\xEC\xF7\x39\xAE\x8A\x0C\xA4\x6F\xF2\xEB\xB3\x29\x28\x31\x3A\x75\x36\x34\x3A\x33" \
+      "\x14\x91\x95\xF1\x69\x12\xDB\x20\xA4\x8D\x02\x0D\xBC\x3B\x9E\x38\x81\xB3\x9D\x72" \
+      "\x2B\xF7\x93\x78\xF6\x34\x0F\x43\x14\x8A\x6E\x9F\xC5\xF5\x3E\x28\x53\xB7\x38\x7B" \
+      "\xA4\x44\x3B\xA5\x3A\x52\xFC\xA8\x17\x3D\xE6\xE8\x5B\x42\xF9\x78\x3D\x4A\x78\x17" \
       "\xD0\x68\x0B\x29\x29\x00"
-    };
+
   /* This RSA key is the `e' value.  */
-  struct key_spec key_rsa_bogus_1 =
-    {
-      "\x28\x31\x31\x3A\x70\x72\x69\x76\x61\x74\x65\x2D\x6B\x65\x79\x28\x33\x3A\x72\x73"
-      "\x61\x28\x31\x3A\x6E\x31\x32\x39\x3A\x00\xA8\x80\xB6\x71\xF4\x95\x9F\x49\x84\xED"
-      "\xC1\x1D\x5F\xFF\xED\x14\x7B\x9C\x6A\x62\x0B\x7B\xE2\x3E\x41\x48\x49\x85\xF5\x64"
-      "\x50\x04\x9D\x30\xFC\x84\x1F\x01\xC3\xC3\x15\x03\x48\x6D\xFE\x59\x0B\xB0\xD0\x3E"
-      "\x68\x8A\x05\x7A\x62\xB0\xB9\x6E\xC5\xD2\xA8\xEE\x0C\x6B\xDE\x5E\x3D\x8E\xE8\x8F"
-      "\xB3\xAE\x86\x99\x7E\xDE\x2B\xC2\x4D\x60\x51\xDB\xB1\x2C\xD0\x38\xEC\x88\x62\x3E"
-      "\xA9\xDD\x11\x53\x04\x17\xE4\xF2\x07\x50\xDC\x44\xED\x14\xF5\x0B\xAB\x9C\xBC\x24"
-      "\xC6\xCB\xAD\x0F\x05\x25\x94\xE2\x73\xEB\x14\xD5\xEE\x5E\x18\xF0\x40\x31\x29\x28"
-      "\x31\x3A\x64\x31\x32\x38\x3A\x40\xD0\x55\x9D\x2A\xA7\xBC\xBF\xE2\x3E\x33\x98\x71"
-      "\x7B\x37\x3D\xB8\x38\x57\xA1\x43\xEA\x90\x81\x42\xCA\x23\xE1\xBF\x9C\xA8\xBC\xC5"
-      "\x9B\xF8\x9D\x77\x71\xCD\xD3\x85\x8B\x20\x3A\x92\xE9\xBC\x79\xF3\xF7\xF5\x6D\x15"
-      "\xA3\x58\x3F\xC2\xEB\xED\x72\xD4\xE0\xCF\xEC\xB3\xEC\xEB\x09\xEA\x1E\x72\x6A\xBA"
-      "\x95\x82\x2C\x7E\x30\x95\x66\x3F\xA8\x2D\x40\x0F\x7A\x12\x4E\xF0\x71\x0F\x97\xDB"
-      "\x81\xE4\x39\x6D\x24\x58\xFA\xAB\x3A\x36\x73\x63\x01\x77\x42\xC7\x9A\xEA\x87\xDA"
-      "\x93\x8F\x6C\x64\xAD\x9E\xF0\xCA\xA2\x89\xA4\x0E\xB3\x25\x73\x29\x28\x31\x3A\x70"
-      "\x36\x35\x3A\x00\xC3\xF7\x37\x3F\x9D\x93\xEC\xC7\x5E\x4C\xB5\x73\x29\x62\x35\x80"
-      "\xC6\x7C\x1B\x1E\x68\x5F\x92\x56\x77\x0A\xE2\x8E\x95\x74\x87\xA5\x2F\x83\x2D\xF7"
-      "\xA1\xC2\x78\x54\x18\x6E\xDE\x35\xF0\x9F\x7A\xCA\x80\x5C\x83\x5C\x44\xAD\x8B\xE7"
-      "\x5B\xE2\x63\x7D\x6A\xC7\x98\x97\x29\x28\x31\x3A\x71\x36\x35\x3A\x00\xDC\x1F\xB1"
-      "\xB3\xD8\x13\xE0\x09\x19\xFD\x1C\x58\xA1\x2B\x02\xB4\xC8\xF2\x1C\xE7\xF9\xC6\x3B"
-      "\x68\xB9\x72\x43\x86\xEF\xA9\x94\x68\x02\xEF\x7D\x77\xE0\x0A\xD1\xD7\x48\xFD\xCD"
-      "\x98\xDA\x13\x8A\x76\x48\xD4\x0F\x63\x28\xFA\x01\x1B\xF3\xC7\x15\xB8\x53\x22\x7E"
-      "\x77\x29\x28\x31\x3A\x75\x36\x35\x3A\x00\xB3\xBB\x4D\xEE\x5A\xAF\xD0\xF2\x56\x8A"
-      "\x10\x2D\x6F\x4B\x2D\x76\x49\x9B\xE9\xA8\x60\x5D\x9E\x7E\x50\x86\xF1\xA1\x0F\x28"
-      "\x9B\x7B\xE8\xDD\x1F\x87\x4E\x79\x7B\x50\x12\xA7\xB4\x8B\x52\x38\xEC\x7C\xBB\xB9"
+#define key_rsa_bogus_1 \
+      "\x28\x31\x31\x3A\x70\x72\x69\x76\x61\x74\x65\x2D\x6B\x65\x79\x28\x33\x3A\x72\x73" \
+      "\x61\x28\x31\x3A\x6E\x31\x32\x39\x3A\x00\xA8\x80\xB6\x71\xF4\x95\x9F\x49\x84\xED" \
+      "\xC1\x1D\x5F\xFF\xED\x14\x7B\x9C\x6A\x62\x0B\x7B\xE2\x3E\x41\x48\x49\x85\xF5\x64" \
+      "\x50\x04\x9D\x30\xFC\x84\x1F\x01\xC3\xC3\x15\x03\x48\x6D\xFE\x59\x0B\xB0\xD0\x3E" \
+      "\x68\x8A\x05\x7A\x62\xB0\xB9\x6E\xC5\xD2\xA8\xEE\x0C\x6B\xDE\x5E\x3D\x8E\xE8\x8F" \
+      "\xB3\xAE\x86\x99\x7E\xDE\x2B\xC2\x4D\x60\x51\xDB\xB1\x2C\xD0\x38\xEC\x88\x62\x3E" \
+      "\xA9\xDD\x11\x53\x04\x17\xE4\xF2\x07\x50\xDC\x44\xED\x14\xF5\x0B\xAB\x9C\xBC\x24" \
+      "\xC6\xCB\xAD\x0F\x05\x25\x94\xE2\x73\xEB\x14\xD5\xEE\x5E\x18\xF0\x40\x31\x29\x28" \
+      "\x31\x3A\x64\x31\x32\x38\x3A\x40\xD0\x55\x9D\x2A\xA7\xBC\xBF\xE2\x3E\x33\x98\x71" \
+      "\x7B\x37\x3D\xB8\x38\x57\xA1\x43\xEA\x90\x81\x42\xCA\x23\xE1\xBF\x9C\xA8\xBC\xC5" \
+      "\x9B\xF8\x9D\x77\x71\xCD\xD3\x85\x8B\x20\x3A\x92\xE9\xBC\x79\xF3\xF7\xF5\x6D\x15" \
+      "\xA3\x58\x3F\xC2\xEB\xED\x72\xD4\xE0\xCF\xEC\xB3\xEC\xEB\x09\xEA\x1E\x72\x6A\xBA" \
+      "\x95\x82\x2C\x7E\x30\x95\x66\x3F\xA8\x2D\x40\x0F\x7A\x12\x4E\xF0\x71\x0F\x97\xDB" \
+      "\x81\xE4\x39\x6D\x24\x58\xFA\xAB\x3A\x36\x73\x63\x01\x77\x42\xC7\x9A\xEA\x87\xDA" \
+      "\x93\x8F\x6C\x64\xAD\x9E\xF0\xCA\xA2\x89\xA4\x0E\xB3\x25\x73\x29\x28\x31\x3A\x70" \
+      "\x36\x35\x3A\x00\xC3\xF7\x37\x3F\x9D\x93\xEC\xC7\x5E\x4C\xB5\x73\x29\x62\x35\x80" \
+      "\xC6\x7C\x1B\x1E\x68\x5F\x92\x56\x77\x0A\xE2\x8E\x95\x74\x87\xA5\x2F\x83\x2D\xF7" \
+      "\xA1\xC2\x78\x54\x18\x6E\xDE\x35\xF0\x9F\x7A\xCA\x80\x5C\x83\x5C\x44\xAD\x8B\xE7" \
+      "\x5B\xE2\x63\x7D\x6A\xC7\x98\x97\x29\x28\x31\x3A\x71\x36\x35\x3A\x00\xDC\x1F\xB1" \
+      "\xB3\xD8\x13\xE0\x09\x19\xFD\x1C\x58\xA1\x2B\x02\xB4\xC8\xF2\x1C\xE7\xF9\xC6\x3B" \
+      "\x68\xB9\x72\x43\x86\xEF\xA9\x94\x68\x02\xEF\x7D\x77\xE0\x0A\xD1\xD7\x48\xFD\xCD" \
+      "\x98\xDA\x13\x8A\x76\x48\xD4\x0F\x63\x28\xFA\x01\x1B\xF3\xC7\x15\xB8\x53\x22\x7E" \
+      "\x77\x29\x28\x31\x3A\x75\x36\x35\x3A\x00\xB3\xBB\x4D\xEE\x5A\xAF\xD0\xF2\x56\x8A" \
+      "\x10\x2D\x6F\x4B\x2D\x76\x49\x9B\xE9\xA8\x60\x5D\x9E\x7E\x50\x86\xF1\xA1\x0F\x28" \
+      "\x9B\x7B\xE8\xDD\x1F\x87\x4E\x79\x7B\x50\x12\xA7\xB4\x8B\x52\x38\xEC\x7C\xBB\xB9" \
       "\x55\x87\x11\x1C\x74\xE7\x7F\xA0\xBA\xE3\x34\x5D\x61\xBF\x29\x29\x29\x00"
-    };
       
   struct
   {
@@ -158,15 +154,15 @@
       { "",
 	"passphrase", 1, 0, NULL, 0, GPG_ERR_INV_SEXP, NULL, 0 },
       /* - NULL; disabled, this segfaults  */
-      //{ NULL,
-      //  "passphrase", 1, NULL, 0, GPG_ERR_INV_SEXP, NULL, 0 },
+      /*{ NULL,
+        "passphrase", 1, NULL, 0, GPG_ERR_INV_SEXP, NULL, 0 }, */
 
       /* Valid and invalid keys.  */
-      { key_rsa_valid.string,
+      { key_rsa_valid,
 	"passphrase", 0, 0, NULL, 0, 0, NULL, 0 },
-      { key_rsa_bogus_0.string,
+      { key_rsa_bogus_0,
 	"passphrase", 0, 0, NULL, 0, GPG_ERR_INV_SEXP, NULL, 0 },
-      { key_rsa_bogus_1.string,
+      { key_rsa_bogus_1,
 	"passphrase", 0, 0, NULL, 0, GPG_ERR_INV_SEXP, NULL, 0 },
 
       /* FIXME: add more test data.  */
Index: agent/minip12.c
===================================================================
--- agent/minip12.c.orig	2007-05-10 22:09:34.973491000 +0000
+++ agent/minip12.c	2007-05-10 22:09:41.484108000 +0000
@@ -505,7 +505,7 @@
                int iter, const char *pw, int cipher_algo,
                int (*check_fnc) (const void *, size_t))
 {
-  static const char const *charsets[] = {
+  static const char *charsets[] = {
     "",   /* No conversion - use the UTF-8 passphrase direct.  */
     "ISO-8859-1",
     "ISO-8859-15",
Index: g10/Makefile.am
===================================================================
--- g10/Makefile.am.orig	2007-05-10 22:09:36.362440000 +0000
+++ g10/Makefile.am	2007-05-10 22:09:41.556503000 +0000
@@ -119,9 +119,9 @@
 LDADD =  $(needed_libs) ../common/libgpgrl.a \
          $(ZLIBS) $(DNSLIBS) $(LIBREADLINE) \
          $(LIBINTL) $(CAPLIBS) $(NETLIBS)
-gpg2_LDADD = $(LIBGCRYPT_LIBS) $(LDADD) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
+gpg2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
 	     $(LIBICONV)
-gpgv2_LDADD = $(LIBGCRYPT_LIBS) $(LDADD) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
+gpgv2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
 	      $(LIBICONV)
 
 $(PROGRAMS): $(needed_libs) ../common/libgpgrl.a
Index: common/dynload.h
===================================================================
--- common/dynload.h.orig	2007-05-10 22:09:35.070028000 +0000
+++ common/dynload.h	2007-05-10 22:09:41.586637000 +0000
@@ -21,8 +21,67 @@
 
 #ifndef GNUPG_DYNLOAD_H
 #define GNUPG_DYNLOAD_H
+
 #ifndef __MINGW32__
+#include <config.h>
+#if HAVE_DLFCN_H
 #include <dlfcn.h>
+#elif HAVE_DL_H
+#include <dl.h>
+#if !defined(DYNAMIC_PATH)
+#  define DYNAMIC_PATH		0
+#endif
+#if !defined(BIND_RESTRICTED)
+#  define BIND_RESTRICTED	0
+#endif
+
+#define RTLD_LAZY 0
+
+#define	BIND_FLAGS	(BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH)
+
+
+
+static inline void *
+dlopen (const char * name, int flag)
+{
+  void * hd = shl_load (name,BIND_FLAGS,0L);
+  return hd;
+}
+
+static inline void *
+dlsym (void *hd, const char *sym)
+{
+  if (hd && sym)
+    {
+      void * fnc;
+	  if (shl_findsym((shl_t*)&hd,sym,TYPE_UNDEFINED,&fnc)) {
+		return NULL;
+	  } 
+      return fnc;
+    }
+  return NULL;
+}
+
+
+static inline const char *
+dlerror (void)
+{
+	return "Error";
+}
+
+
+static inline int
+dlclose (void * hd)
+{
+  if (hd)
+    {
+	  shl_unload(hd);
+      return 0;
+    }
+  return -1;
+}  
+#endif
+
 #else
 #include <windows.h>
 
Index: scd/pcsc-wrapper.c
===================================================================
--- scd/pcsc-wrapper.c.orig	2007-05-10 22:09:35.021757000 +0000
+++ scd/pcsc-wrapper.c	2007-05-10 22:09:41.625112000 +0000
@@ -48,8 +48,11 @@
 #include <errno.h>
 #include <stdarg.h>
 #include <assert.h>
+#if HAVE_DLFCN_H
 #include <dlfcn.h>
-
+#else
+#include <dynload.h>
+#endif
 
 #define PGM "pcsc-wrapper"
 
Index: common/gettime.c
===================================================================
--- common/gettime.c.orig	2007-05-10 22:09:35.094130000 +0000
+++ common/gettime.c	2007-05-10 22:09:41.671454000 +0000
@@ -63,6 +63,12 @@
       struct tm tmbuf;
       
       tp = gmtime_r (&atime, &tmbuf);
+
+/* The man page for gm_time_r on HP-UX 10.20 says:                     */
+/*  For asctime_r(), ctime_r(), gmtime_r(), and localtime_r(), if the  */
+/*  operation is successful, 0 is returned.                            */
+
+      if (!tp) tp = &tmbuf;
 #else
       tp = gmtime (&atime);
 #endif


More information about the Gnupg-devel mailing list