[git] GnuPG - branch, master, updated. gnupg-2.1.6-20-g55e64f4

by Werner Koch cvs at cvs.gnupg.org
Sun Jul 26 12:58:15 CEST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  55e64f47a52d76e097a01eb4044a88a4e10d6a87 (commit)
       via  d382242fb6789973ce8d246ec154a4a1468c24c0 (commit)
      from  ef080d5c7fb7f3b75c3c57c011f78a312b8e13a9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 55e64f47a52d76e097a01eb4044a88a4e10d6a87
Author: Werner Koch <wk at gnupg.org>
Date:   Sun Jul 26 12:55:53 2015 +0200

    scd: Fix size_t/unsigned int mismatch.
    
    * scd/app-openpgp.c (ecc_writekey): Use extra var n.

diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 72f7640..87208f4 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -3366,6 +3366,7 @@ ecc_writekey (app_t app, gpg_error_t (*pincb)(void*, const char *, char **),
     {
       gcry_mpi_t oid;
       const unsigned char *oidbuf;
+      unsigned int n;
       size_t oid_len;
       unsigned char fprbuf[20];
 
@@ -3373,7 +3374,8 @@ ecc_writekey (app_t app, gpg_error_t (*pincb)(void*, const char *, char **),
       if (err)
         goto leave;
 
-      oidbuf = gcry_mpi_get_opaque (oid, &oid_len);
+      oidbuf = gcry_mpi_get_opaque (oid, &n);
+      oid_len = n;
       if (!oidbuf)
         {
           err = gpg_error_from_syserror ();

commit d382242fb6789973ce8d246ec154a4a1468c24c0
Author: Werner Koch <wk at gnupg.org>
Date:   Sun Jul 26 12:50:16 2015 +0200

    Replace GNUPG_GCC_A_ macros by GPGRT_ATTR_ macros.
    
    * common/util.h: Provide replacement for GPGRT_ATTR_ macros when using
    libgpg-error < 1.20.
    * common/mischelp.h: Ditto.
    * common/types.h: Ditto.
    --
    
    Given that libgpg-error is a dependency of all GnuPG related libraries
    it is better to define such macros at only one place instead of having
    similar macros at a lot of places.  For now we need repalcement
    macros, though.

diff --git a/agent/agent.h b/agent/agent.h
index 5a09254..164ddea 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -319,7 +319,8 @@ typedef int (*lookup_ttl_t)(const char *hexgrip);
 
 
 /*-- gpg-agent.c --*/
-void agent_exit (int rc) GPGRT_GCC_A_NR; /* Also implemented in other tools */
+void agent_exit (int rc)
+                GPGRT_ATTR_NORETURN; /* Also implemented in other tools */
 gpg_error_t agent_copy_startup_env (ctrl_t ctrl);
 const char *get_agent_socket_name (void);
 const char *get_agent_ssh_socket_name (void);
@@ -332,10 +333,10 @@ int map_pk_openpgp_to_gcry (int openpgp_algo);
 /*-- command.c --*/
 gpg_error_t agent_inq_pinentry_launched (ctrl_t ctrl, unsigned long pid);
 gpg_error_t agent_write_status (ctrl_t ctrl, const char *keyword, ...)
-     GNUPG_GCC_A_SENTINEL(0);
+     GPGRT_ATTR_SENTINEL(0);
 gpg_error_t agent_print_status (ctrl_t ctrl, const char *keyword,
                                 const char *format, ...)
-     GPGRT_GCC_A_PRINTF(3,4);
+     GPGRT_ATTR_PRINTF(3,4);
 void bump_key_eventcounter (void);
 void bump_card_eventcounter (void);
 void start_command_handler (ctrl_t, gnupg_fd_t, gnupg_fd_t);
diff --git a/common/asshelp.h b/common/asshelp.h
index c685564..6a52172 100644
--- a/common/asshelp.h
+++ b/common/asshelp.h
@@ -81,11 +81,11 @@ start_new_dirmngr (assuan_context_t *r_ctx,
 gpg_error_t print_assuan_status (assuan_context_t ctx,
                                  const char *keyword,
                                  const char *format,
-                                 ...) GPGRT_GCC_A_PRINTF(3,4);
+                                 ...) GPGRT_ATTR_PRINTF(3,4);
 gpg_error_t vprint_assuan_status (assuan_context_t ctx,
                                   const char *keyword,
                                   const char *format,
-                                  va_list arg_ptr) GPGRT_GCC_A_PRINTF(3,0);
+                                  va_list arg_ptr) GPGRT_ATTR_PRINTF(3,0);
 
 
 #endif /*GNUPG_COMMON_ASSHELP_H*/
diff --git a/common/audit.c b/common/audit.c
index 9ed5708..198b8e6 100644
--- a/common/audit.c
+++ b/common/audit.c
@@ -72,11 +72,11 @@ struct audit_ctx_s
 
 

 static void writeout_para (audit_ctx_t ctx,
-                           const char *format, ...) GPGRT_GCC_A_PRINTF(2,3);
+                           const char *format, ...) GPGRT_ATTR_PRINTF(2,3);
 static void writeout_li (audit_ctx_t ctx, const char *oktext,
-                         const char *format, ...) GPGRT_GCC_A_PRINTF(3,4);
+                         const char *format, ...) GPGRT_ATTR_PRINTF(3,4);
 static void writeout_rem (audit_ctx_t ctx,
-                          const char *format, ...) GPGRT_GCC_A_PRINTF(2,3);
+                          const char *format, ...) GPGRT_ATTR_PRINTF(2,3);
 
 
 /* Add NAME to the list of help tags.  NAME needs to be a const string
diff --git a/common/logging.h b/common/logging.h
index 0bd1a6c..dbfc8ba 100644
--- a/common/logging.h
+++ b/common/logging.h
@@ -48,8 +48,9 @@ int log_test_fd (int fd);
 int  log_get_fd(void);
 estream_t log_get_stream (void);
 
-#ifdef GPGRT_GCC_M_FUNCTION
-  void bug_at( const char *file, int line, const char *func ) GPGRT_GCC_A_NR;
+#ifdef GPGRT_HAVE_MACRO_FUNCTION
+  void bug_at (const char *file, int line, const char *func)
+               GPGRT_ATTR_NORETURN;
 # define BUG() bug_at( __FILE__ , __LINE__, __FUNCTION__ )
 #else
   void bug_at( const char *file, int line );
@@ -74,17 +75,17 @@ enum jnlib_log_levels {
     GPGRT_LOG_BUG,
     GPGRT_LOG_DEBUG
 };
-void log_log (int level, const char *fmt, ...) GPGRT_GCC_A_PRINTF(2,3);
+void log_log (int level, const char *fmt, ...) GPGRT_ATTR_PRINTF(2,3);
 void log_logv (int level, const char *fmt, va_list arg_ptr);
 void log_string (int level, const char *string);
 
 
-void log_bug( const char *fmt, ... )	GPGRT_GCC_A_NR_PRINTF(1,2);
-void log_fatal( const char *fmt, ... )	GPGRT_GCC_A_NR_PRINTF(1,2);
-void log_error( const char *fmt, ... )	GPGRT_GCC_A_PRINTF(1,2);
-void log_info( const char *fmt, ... )	GPGRT_GCC_A_PRINTF(1,2);
-void log_debug( const char *fmt, ... )	GPGRT_GCC_A_PRINTF(1,2);
-void log_printf( const char *fmt, ... ) GPGRT_GCC_A_PRINTF(1,2);
+void log_bug (const char *fmt, ...)    GPGRT_ATTR_NR_PRINTF(1,2);
+void log_fatal (const char *fmt, ...)  GPGRT_ATTR_NR_PRINTF(1,2);
+void log_error (const char *fmt, ...)  GPGRT_ATTR_PRINTF(1,2);
+void log_info (const char *fmt, ...)   GPGRT_ATTR_PRINTF(1,2);
+void log_debug (const char *fmt, ...)  GPGRT_ATTR_PRINTF(1,2);
+void log_printf (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2);
 void log_flush (void);
 
 /* Print a hexdump of BUFFER.  With TEXT passes as NULL print just the
diff --git a/common/membuf.h b/common/membuf.h
index 32d4f90..eb7d565 100644
--- a/common/membuf.h
+++ b/common/membuf.h
@@ -55,7 +55,7 @@ void clear_membuf (membuf_t *mb, size_t amount);
 void put_membuf  (membuf_t *mb, const void *buf, size_t len);
 void put_membuf_str (membuf_t *mb, const char *string);
 void put_membuf_printf (membuf_t *mb, const char *format,
-                        ...) GPGRT_GCC_A_PRINTF(2,3);
+                        ...) GPGRT_ATTR_PRINTF(2,3);
 void *get_membuf (membuf_t *mb, size_t *len);
 void *get_membuf_shrink (membuf_t *mb, size_t *len);
 const void *peek_membuf (membuf_t *mb, size_t *len);
diff --git a/common/mischelp.h b/common/mischelp.h
index ecbf38b..cd72a4a 100644
--- a/common/mischelp.h
+++ b/common/mischelp.h
@@ -48,27 +48,32 @@ time_t timegm (struct tm *tm);
 #define DIMof(type,member)   DIM(((type *)0)->member)
 
 
-#undef GPGRT_GCC_HAVE_PUSH_PRAGMA
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
-# define GPGRT_GCC_M_FUNCTION 1  /* __FUNCTION__ macro is available.  */
-# define GPGRT_GCC_A_NR 	     __attribute__ ((noreturn))
-# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4 )
-#   define GPGRT_GCC_HAVE_PUSH_PRAGMA 1
-#   define GPGRT_GCC_A_PRINTF( f, a ) \
-                    __attribute__ ((format (__gnu_printf__,f,a)))
-#   define GPGRT_GCC_A_NR_PRINTF( f, a ) \
-		    __attribute__ ((noreturn, format (__gnu_printf__,f,a)))
+/* Replacements for macros not available with libgpg-error < 1.20.  */
+#ifndef GPGRT_GCC_VERSION
+
+# undef GPGRT_HAVE_PRAGMA_GCC_PUSH
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
+#  define GPGRT_HAVE_MACRO_FUNCTION 1  /* __FUNCTION__ macro is available.  */
+#  define GPGRT_ATTR_NORETURN  __attribute__ ((noreturn))
+#  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4 )
+#    define GPGRT_HAVE_PRAGMA_GCC_PUSH 1
+#    define GPGRT_ATTR_PRINTF(f,a) \
+                  __attribute__ ((format (__gnu_printf__,f,a)))
+#    define GPGRT_ATTR_NR_PRINTF(f,a) \
+                  __attribute__ ((noreturn, format (__gnu_printf__,f,a)))
+#  else
+#    define GPGRT_ATTR_PRINTF(f, a) \
+                  __attribute__ ((format (printf,f,a)))
+#    define GPGRT_ATTR_NR_PRINTF(f, a) \
+                  __attribute__ ((noreturn, format (printf,f,a)))
+#  endif
 # else
-#   define GPGRT_GCC_A_PRINTF( f, a )  __attribute__ ((format (printf,f,a)))
-#   define GPGRT_GCC_A_NR_PRINTF( f, a ) \
-			    __attribute__ ((noreturn, format (printf,f,a)))
+#  define GPGRT_ATTR_NORETURN
+#  define GPGRT_ATTR_PRINTF( f, a )
+#  define GPGRT_ATTR_NR_PRINTF( f, a )
 # endif
-#else
-# define GPGRT_GCC_A_NR
-# define GPGRT_GCC_A_PRINTF( f, a )
-# define GPGRT_GCC_A_NR_PRINTF( f, a )
-#endif
 
+#endif /*Older libgpg-error.  */
 
 /* To avoid that a compiler optimizes certain memset calls away, these
    macros may be used instead. */
diff --git a/common/stringhelp.h b/common/stringhelp.h
index ab16d16..a84c81b 100644
--- a/common/stringhelp.h
+++ b/common/stringhelp.h
@@ -52,11 +52,11 @@ size_t length_sans_trailing_ws (const unsigned char *line, size_t len);
 
 char *make_basename(const char *filepath, const char *inputpath);
 char *make_dirname(const char *filepath);
-char *make_filename( const char *first_part, ... ) GNUPG_GCC_A_SENTINEL(0);
-char *make_filename_try (const char *first_part, ... ) GNUPG_GCC_A_SENTINEL(0);
-char *make_absfilename (const char *first_part, ...) GNUPG_GCC_A_SENTINEL(0);
+char *make_filename( const char *first_part, ... ) GPGRT_ATTR_SENTINEL(0);
+char *make_filename_try (const char *first_part, ... ) GPGRT_ATTR_SENTINEL(0);
+char *make_absfilename (const char *first_part, ...) GPGRT_ATTR_SENTINEL(0);
 char *make_absfilename_try (const char *first_part,
-                            ...) GNUPG_GCC_A_SENTINEL(0);
+                            ...) GPGRT_ATTR_SENTINEL(0);
 int compare_filenames( const char *a, const char *b );
 
 int hextobyte (const char *s);
@@ -139,9 +139,9 @@ char *try_percent_escape (const char *str, const char *extra);
 /* Concatenate the string S1 with all the following strings up to a
    NULL.  Returns a malloced buffer with the new string or NULL on a
    malloc error or if too many arguments are given.  */
-char *strconcat (const char *s1, ...) GNUPG_GCC_A_SENTINEL(0);
+char *strconcat (const char *s1, ...) GPGRT_ATTR_SENTINEL(0);
 /* Ditto, but die on error.  */
-char *xstrconcat (const char *s1, ...) GNUPG_GCC_A_SENTINEL(0);
+char *xstrconcat (const char *s1, ...) GPGRT_ATTR_SENTINEL(0);
 
 char **strsplit (char *string, char delim, char replacement, int *count);
 
diff --git a/common/types.h b/common/types.h
index 8d7730b..2bb817f 100644
--- a/common/types.h
+++ b/common/types.h
@@ -114,13 +114,13 @@
 #endif
 
 
-/* Some GCC attributes.  Note that we use also define some in
-   mischelp.h, but this header and types.h are not always included.
-   Should eventually be put into one file (e.g. nlib-common.h).  */
-#if __GNUC__ >= 4
-# define GNUPG_GCC_A_SENTINEL(a) __attribute__ ((sentinel(a)))
-#else
-# define GNUPG_GCC_A_SENTINEL(a)
+/* Some GCC attributes.  These are replacements for libgpg-error < 1.20.  */
+#ifndef GPGRT_GCC_VERSION
+# if __GNUC__ >= 4
+#  define GPGRT_ATTR_SENTINEL(a) __attribute__ ((sentinel(a)))
+# else
+#  define GPGRT_ATTR_SENTINEL(a)
+# endif
 #endif
 
 #endif /*GNUPG_COMMON_TYPES_H*/
diff --git a/common/util.h b/common/util.h
index b92d78c..90acefa 100644
--- a/common/util.h
+++ b/common/util.h
@@ -152,26 +152,30 @@
 #define snprintf gpgrt_snprintf
 
 
-/* GCC attributes.  */
-#ifndef GNUPG_GCC_ATTR_FORMAT_ARG
-#if __GNUC__ >= 3 /* Actually 2.8 but testing the major is easier.  */
-# define GNUPG_GCC_ATTR_FORMAT_ARG(a)  __attribute__ ((__format_arg__ (a)))
-#else
-# define GNUPG_GCC_ATTR_FORMAT_ARG(a)
-#endif
-#endif
+/* Replacements for macros not available with libgpg-error < 1.20.  */
+#ifndef GPGRT_GCC_VERSION
 
-#if __GNUC__ >= 4
-# define GNUPG_GCC_A_SENTINEL(a) __attribute__ ((sentinel(a)))
-#else
-# define GNUPG_GCC_A_SENTINEL(a)
-#endif
+# ifndef GPGRT_ATTR_FORMAT_ARG
+# if __GNUC__ >= 3 /* Actually 2.8 but testing the major is easier.  */
+#  define GPGRT_ATTR_FORMAT_ARG(a)  __attribute__ ((__format_arg__ (a)))
+# else
+#  define GPGRT_ATTR_FORMAT_ARG(a)
+# endif
+# endif
 
-#if __GNUC__ >= 4
-# define GNUPG_GCC_A_USED __attribute__ ((used))
-#else
-# define GNUPG_GCC_A_USED
-#endif
+# if __GNUC__ >= 4
+#  define GPGRT_ATTR_SENTINEL(a) __attribute__ ((sentinel(a)))
+# else
+#  define GPGRT_ATTR_SENTINEL(a)
+# endif
+
+# if __GNUC__ >= 4
+#  define GPGRT_ATTR_USED __attribute__ ((used))
+# else
+#  define GPGRT_ATTR_USED
+# endif
+
+#endif /*libgpg-error < 1.20 */
 
 
 /* We need this type even if we are not using libreadline and or we
@@ -371,9 +375,9 @@ const char *gnupg_messages_locale_name (void);
 void setup_libgcrypt_logging (void);
 
 /* Same as estream_asprintf but die on memory failure.  */
-char *xasprintf (const char *fmt, ...) GPGRT_GCC_A_PRINTF(1,2);
+char *xasprintf (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2);
 /* This is now an alias to estream_asprintf.  */
-char *xtryasprintf (const char *fmt, ...) GPGRT_GCC_A_PRINTF(1,2);
+char *xtryasprintf (const char *fmt, ...) GPGRT_ATTR_PRINTF(1,2);
 
 /* Replacement for gcry_cipher_algo_name.  */
 const char *gnupg_cipher_algo_name (int algo);
diff --git a/dirmngr/ks-engine-ldap.c b/dirmngr/ks-engine-ldap.c
index 4288119..1b8ef03 100644
--- a/dirmngr/ks-engine-ldap.c
+++ b/dirmngr/ks-engine-ldap.c
@@ -1404,7 +1404,7 @@ modlist_lookup (LDAPMod **modlist, const char *attr)
 
 /* Dump a modlist to a file.  This is useful for debugging.  */
 static estream_t modlist_dump (LDAPMod **modlist, estream_t output)
-  GNUPG_GCC_A_USED;
+  GPGRT_ATTR_USED;
 
 static estream_t
 modlist_dump (LDAPMod **modlist, estream_t output)
diff --git a/dirmngr/ks-engine.h b/dirmngr/ks-engine.h
index 985167a..aff6cf4 100644
--- a/dirmngr/ks-engine.h
+++ b/dirmngr/ks-engine.h
@@ -26,7 +26,7 @@
 /*-- ks-action.c --*/
 gpg_error_t ks_print_help (ctrl_t ctrl, const char *text);
 gpg_error_t ks_printf_help (ctrl_t ctrl, const char *format,
-                            ...) GPGRT_GCC_A_PRINTF(2,3);
+                            ...) GPGRT_ATTR_PRINTF(2,3);
 
 /*-- ks-engine-hkp.c --*/
 gpg_error_t ks_hkp_resolve (ctrl_t ctrl, parsed_uri_t uri);
diff --git a/g10/main.h b/g10/main.h
index f4bf17f..06c497d 100644
--- a/g10/main.h
+++ b/g10/main.h
@@ -182,7 +182,7 @@ void write_status_error (const char *where, gpg_error_t err);
 void write_status_errcode (const char *where, int errcode);
 void write_status_text ( int no, const char *text );
 void write_status_strings (int no, const char *text,
-                           ...) GNUPG_GCC_A_SENTINEL(0);
+                           ...) GPGRT_ATTR_SENTINEL(0);
 void write_status_buffer ( int no,
                            const char *buffer, size_t len, int wrap );
 void write_status_text_and_buffer ( int no, const char *text,
diff --git a/g13/g13.h b/g13/g13.h
index 371833d..c766813 100644
--- a/g13/g13.h
+++ b/g13/g13.h
@@ -106,7 +106,7 @@ void g13_exit (int rc);
 void g13_init_default_ctrl (struct server_control_s *ctrl);
 
 /*-- server.c (commonly used, thus declared here) --*/
-gpg_error_t g13_status (ctrl_t ctrl, int no, ...) GNUPG_GCC_A_SENTINEL(0);
+gpg_error_t g13_status (ctrl_t ctrl, int no, ...) GPGRT_ATTR_SENTINEL(0);
 
 
 #endif /*G13_H*/
diff --git a/scd/scdaemon.h b/scd/scdaemon.h
index 35ada43..1a95ba7 100644
--- a/scd/scdaemon.h
+++ b/scd/scdaemon.h
@@ -124,7 +124,7 @@ const char *scd_get_socket_name (void);
 void initialize_module_command (void);
 int  scd_command_handler (ctrl_t, int);
 void send_status_info (ctrl_t ctrl, const char *keyword, ...)
-     GNUPG_GCC_A_SENTINEL(1);
+     GPGRT_ATTR_SENTINEL(1);
 void send_status_direct (ctrl_t ctrl, const char *keyword, const char *args);
 void scd_update_reader_status_file (void);
 
diff --git a/sm/gpgsm.h b/sm/gpgsm.h
index 9fc74c3..30e4fb3 100644
--- a/sm/gpgsm.h
+++ b/sm/gpgsm.h
@@ -241,7 +241,7 @@ int  gpgsm_parse_validation_model (const char *model);
 /*-- server.c --*/
 void gpgsm_server (certlist_t default_recplist);
 gpg_error_t gpgsm_status (ctrl_t ctrl, int no, const char *text);
-gpg_error_t gpgsm_status2 (ctrl_t ctrl, int no, ...) GNUPG_GCC_A_SENTINEL(0);
+gpg_error_t gpgsm_status2 (ctrl_t ctrl, int no, ...) GPGRT_ATTR_SENTINEL(0);
 gpg_error_t gpgsm_status_with_err_code (ctrl_t ctrl, int no, const char *text,
                                         gpg_err_code_t ec);
 gpg_error_t gpgsm_proxy_pinentry_notify (ctrl_t ctrl,

-----------------------------------------------------------------------

Summary of changes:
 agent/agent.h            |  7 ++++---
 common/asshelp.h         |  4 ++--
 common/audit.c           |  6 +++---
 common/logging.h         | 19 ++++++++++---------
 common/membuf.h          |  2 +-
 common/mischelp.h        | 41 +++++++++++++++++++++++------------------
 common/stringhelp.h      | 12 ++++++------
 common/types.h           | 14 +++++++-------
 common/util.h            | 44 ++++++++++++++++++++++++--------------------
 dirmngr/ks-engine-ldap.c |  2 +-
 dirmngr/ks-engine.h      |  2 +-
 g10/main.h               |  2 +-
 g13/g13.h                |  2 +-
 scd/app-openpgp.c        |  4 +++-
 scd/scdaemon.h           |  2 +-
 sm/gpgsm.h               |  2 +-
 16 files changed, 89 insertions(+), 76 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list