[git] GPGME - branch, master, updated. gpgme-1.3.1-23-g1a21574

by Werner Koch cvs at cvs.gnupg.org
Mon Apr 30 18:53:02 CEST 2012


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 "GnuPG Made Easy".

The branch, master has been updated
       via  1a21574b48ee91eedbf95251ee600648b377d1e7 (commit)
       via  22de98b7a67c3017ae67ffdf4d9eb122f86258b1 (commit)
      from  4cb408d33efe80e7d102049dea244d22907d8395 (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 1a21574b48ee91eedbf95251ee600648b377d1e7
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Apr 30 17:46:15 2012 +0200

    Fix timestamp parsing for y2038 hack.
    
    * src/conversion.c (_gpgme_parse_timestamp): Set ENDP before year 2038
    check.

diff --git a/src/conversion.c b/src/conversion.c
index d585b5a..356200c 100644
--- a/src/conversion.c
+++ b/src/conversion.c
@@ -374,6 +374,9 @@ _gpgme_parse_timestamp (const char *timestamp, char **endp)
       if (year < 1900)
         return (time_t)(-1);
 
+      if (endp)
+        *endp = (char*)(timestamp + 15);
+
       /* Fixme: We would better use a configure test to see whether
          mktime can handle dates beyond 2038. */
       if (sizeof (time_t) <= 4 && year >= 2038)
@@ -387,8 +390,6 @@ _gpgme_parse_timestamp (const char *timestamp, char **endp)
       buf.tm_min = atoi_2 (timestamp+11);
       buf.tm_sec = atoi_2 (timestamp+13);
 
-      if (endp)
-        *endp = (char*)(timestamp + 15);
 #ifdef HAVE_W32_SYSTEM
       return _gpgme_timegm (&buf);
 #else

commit 22de98b7a67c3017ae67ffdf4d9eb122f86258b1
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Apr 30 17:42:53 2012 +0200

    Remove trailing white space
    
    --

diff --git a/src/conversion.c b/src/conversion.c
index e6282fa..d585b5a 100644
--- a/src/conversion.c
+++ b/src/conversion.c
@@ -1,19 +1,19 @@
 /* conversion.c - String conversion helper functions.
    Copyright (C) 2000 Werner Koch (dd9jn)
    Copyright (C) 2001, 2002, 2003, 2004, 2007 g10 Code GmbH
- 
+
    This file is part of GPGME.
 
    GPGME is free software; you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation; either version 2.1 of
    the License, or (at your option) any later version.
-   
+
    GPGME is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
-   
+
    You should have received a copy of the GNU Lesser General Public
    License along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -150,9 +150,9 @@ _gpgme_decode_c_string (const char *src, char **destp, size_t len)
 		    /* A binary zero is not representable in a C
 		       string.  */
 		    *(dest++) = '\\';
-		    *(dest++) = '0'; 
+		    *(dest++) = '0';
 		  }
-		else 
+		else
 		  *((unsigned char *) dest++) = val;
 		src += 4;
 	      }
@@ -165,7 +165,7 @@ _gpgme_decode_c_string (const char *src, char **destp, size_t len)
 	    *(dest++) = *(src++);
 	    *(dest++) = *(src++);
 	  }
-        } 
+        }
     }
   *(dest++) = 0;
 
@@ -216,7 +216,7 @@ _gpgme_decode_percent_string (const char *src, char **destp, size_t len,
       else
 	{
 	  int val = _gpgme_hextobyte (&src[1]);
-	  
+
 	  if (val == -1)
 	    {
 	      /* Should not happen.  */
@@ -233,9 +233,9 @@ _gpgme_decode_percent_string (const char *src, char **destp, size_t len,
 		  /* A binary zero is not representable in a C
 		     string.  */
 		  *(dest++) = '\\';
-		  *(dest++) = '0'; 
+		  *(dest++) = '0';
 		}
-	      else 
+	      else
 		*((unsigned char *) dest++) = val;
 	      src += 3;
 	    }
@@ -269,7 +269,7 @@ _gpgme_encode_percent_string (const char *src, char **destp, size_t len)
      the special plus format.  */
   while (*str)
     {
-      if (*str == '+' || *str == '\"' || *str == '%' 
+      if (*str == '+' || *str == '\"' || *str == '%'
           || *(const unsigned char *)str <= 0x20)
         destlen += 3;
       else
@@ -301,7 +301,7 @@ _gpgme_encode_percent_string (const char *src, char **destp, size_t len)
   /* Convert the string.  */
   while (*src)
     {
-      if (*src == '+' || *src == '\"' || *src == '%' 
+      if (*src == '+' || *src == '\"' || *src == '%'
           || *(const unsigned char *)src <= 0x20)
         {
           snprintf (dest, 4, "%%%02X", *(unsigned char *)src);
@@ -325,7 +325,7 @@ _gpgme_timegm (struct tm *tm)
   SYSTEMTIME st;
   FILETIME ft;
   unsigned long long cnsecs;
-  
+
   st.wYear   = tm->tm_year + 1900;
   st.wMonth  = tm->tm_mon  + 1;
   st.wDay    = tm->tm_mday;
@@ -341,7 +341,7 @@ _gpgme_timegm (struct tm *tm)
       gpg_err_set_errno (EINVAL);
       return (time_t)(-1);
     }
-  
+
   cnsecs = (((unsigned long long)ft.dwHighDateTime << 32)
 	    | ft.dwLowDateTime);
   cnsecs -= 116444736000000000ULL; /* The filetime epoch is 1601-01-01.  */
@@ -381,7 +381,7 @@ _gpgme_parse_timestamp (const char *timestamp, char **endp)
 
       memset (&buf, 0, sizeof buf);
       buf.tm_year = year - 1900;
-      buf.tm_mon = atoi_2 (timestamp+4) - 1; 
+      buf.tm_mon = atoi_2 (timestamp+4) - 1;
       buf.tm_mday = atoi_2 (timestamp+6);
       buf.tm_hour = atoi_2 (timestamp+9);
       buf.tm_min = atoi_2 (timestamp+11);
@@ -397,7 +397,7 @@ _gpgme_parse_timestamp (const char *timestamp, char **endp)
 #else
       {
         time_t tim;
-        
+
         putenv ("TZ=UTC");
         tim = mktime (&buf);
 #ifdef __GNUC__
diff --git a/src/verify.c b/src/verify.c
index a8f6712..d63fc54 100644
--- a/src/verify.c
+++ b/src/verify.c
@@ -3,17 +3,17 @@
    Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
 
    This file is part of GPGME.
- 
+
    GPGME is free software; you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as
    published by the Free Software Foundation; either version 2.1 of
    the License, or (at your option) any later version.
-   
+
    GPGME is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.
-   
+
    You should have received a copy of the GNU Lesser General Public
    License along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
@@ -119,7 +119,7 @@ gpgme_op_verify_result (gpgme_ctx_t ctx)
 	  if (sig->notations)
 	    {
 	      TRACE_LOG1 ("sig[%i] = has notations (not shown)", i);
-	    }	  
+	    }
 	  sig = sig->next;
 	  i++;
 	}
@@ -135,7 +135,7 @@ static void
 calc_sig_summary (gpgme_signature_t sig)
 {
   unsigned long sum = 0;
-  
+
   /* Calculate the red/green flag.  */
   if (sig->validity == GPGME_VALIDITY_FULL
       || sig->validity == GPGME_VALIDITY_ULTIMATE)
@@ -179,7 +179,7 @@ calc_sig_summary (gpgme_signature_t sig)
       sum |= GPGME_SIGSUM_SYS_ERROR;
       break;
     }
-  
+
   /* Now look at the certain reason codes.  */
   switch (gpg_err_code (sig->validity_reason))
     {
@@ -187,7 +187,7 @@ calc_sig_summary (gpgme_signature_t sig)
       if (sig->validity == GPGME_VALIDITY_UNKNOWN)
         sum |= GPGME_SIGSUM_CRL_TOO_OLD;
       break;
-        
+
     case GPG_ERR_CERT_REVOKED:
       sum |= GPGME_SIGSUM_KEY_REVOKED;
       break;
@@ -199,15 +199,15 @@ calc_sig_summary (gpgme_signature_t sig)
   /* Check other flags. */
   if (sig->wrong_key_usage)
     sum |= GPGME_SIGSUM_BAD_POLICY;
-  
+
   /* Set the valid flag when the signature is unquestionable
      valid.  (The test is identical to if(sum == GPGME_SIGSUM_GREEN)). */
   if ((sum & GPGME_SIGSUM_GREEN) && !(sum & ~GPGME_SIGSUM_GREEN))
     sum |= GPGME_SIGSUM_VALID;
-  
+
   sig->summary = sum;
 }
-  
+
 
 static gpgme_error_t
 prepare_new_sig (op_data_t opd)
@@ -300,7 +300,7 @@ parse_new_sig (op_data_t opd, gpgme_status_code_t code, char *args)
       end = tail;
       while (*end == ' ')
 	end++;
-     
+
       /* Parse the hash algo.  */
       if (!*end)
 	goto parse_err_sig_fail;
@@ -326,7 +326,7 @@ parse_new_sig (op_data_t opd, gpgme_status_code_t code, char *args)
       end = tail;
       while (*end == ' ')
 	end++;
-      
+
       /* Parse the return code.  */
       if (end[0] && (!end[1] || end[1] == ' '))
 	{
@@ -335,11 +335,11 @@ parse_new_sig (op_data_t opd, gpgme_status_code_t code, char *args)
 	    case '4':
 	      sig->status = gpg_error (GPG_ERR_UNSUPPORTED_ALGORITHM);
 	      break;
-	      
+
 	    case '9':
 	      sig->status = gpg_error (GPG_ERR_NO_PUBKEY);
 	      break;
-	      
+
 	    default:
 	      sig->status = gpg_error (GPG_ERR_GENERAL);
 	    }
@@ -348,12 +348,12 @@ parse_new_sig (op_data_t opd, gpgme_status_code_t code, char *args)
 	goto parse_err_sig_fail;
 
       goto parse_err_sig_ok;
-      
+
     parse_err_sig_fail:
       sig->status = gpg_error (GPG_ERR_GENERAL);
     parse_err_sig_ok:
       break;
-      
+
     default:
       return gpg_error (GPG_ERR_GENERAL);
     }
@@ -398,7 +398,7 @@ parse_valid_sig (gpgme_signature_t sig, char *args)
       if (sig->timestamp == -1 || end == tail || (*tail && *tail != ' '))
 	return gpg_error (GPG_ERR_INV_ENGINE);
       end = tail;
-     
+
       sig->exp_timestamp = _gpgme_parse_timestamp (end, &tail);
       if (sig->exp_timestamp == -1 || end == tail || (*tail && *tail != ' '))
 	return gpg_error (GPG_ERR_INV_ENGINE);
@@ -521,7 +521,7 @@ parse_notation (gpgme_signature_t sig, gpgme_status_code_t code, char *args)
 	/* There is notation data without a previous notation
 	   name.  The crypto backend misbehaves.  */
 	return gpg_error (GPG_ERR_INV_ENGINE);
-      
+
       if (!notation->value)
 	{
 	  dest = notation->value = malloc (len);
@@ -537,7 +537,7 @@ parse_notation (gpgme_signature_t sig, gpgme_status_code_t code, char *args)
 	  notation->value = dest;
 	  dest += cur_len;
 	}
-      
+
       err = _gpgme_decode_percent_string (args, &dest, len, 0);
       if (err)
 	return err;
@@ -618,7 +618,7 @@ parse_error (gpgme_signature_t sig, char *args, int set_status)
       if (where)
 	*where = '\0';
 
-      where = args;      
+      where = args;
     }
   else
     return gpg_error (GPG_ERR_INV_ENGINE);
@@ -792,7 +792,7 @@ verify_status_handler (void *priv, gpgme_status_code_t code, char *args)
 
 gpgme_error_t
 _gpgme_op_verify_init_result (gpgme_ctx_t ctx)
-{  
+{
   void *hook;
   op_data_t opd;
 
@@ -924,27 +924,27 @@ gpgme_get_sig_status (gpgme_ctx_t ctx, int idx,
 	case GPG_ERR_NO_ERROR:
 	  *r_stat = GPGME_SIG_STAT_GOOD;
 	  break;
-	  
+
 	case GPG_ERR_BAD_SIGNATURE:
 	  *r_stat = GPGME_SIG_STAT_BAD;
 	  break;
-	  
+
 	case GPG_ERR_NO_PUBKEY:
 	  *r_stat = GPGME_SIG_STAT_NOKEY;
 	  break;
-	  
+
 	case GPG_ERR_NO_DATA:
 	  *r_stat = GPGME_SIG_STAT_NOSIG;
 	  break;
-	  
+
 	case GPG_ERR_SIG_EXPIRED:
 	  *r_stat = GPGME_SIG_STAT_GOOD_EXP;
 	  break;
-	  
+
 	case GPG_ERR_KEY_EXPIRED:
 	  *r_stat = GPGME_SIG_STAT_GOOD_EXPKEY;
 	  break;
-	  
+
 	default:
 	  *r_stat = GPGME_SIG_STAT_ERROR;
 	  break;
@@ -960,7 +960,7 @@ gpgme_get_sig_status (gpgme_ctx_t ctx, int idx,
    number of the signature after a successful verify operation.  WHAT
    is an attribute where GPGME_ATTR_EXPIRE is probably the most useful
    one.  WHATIDX is to be passed as 0 for most attributes . */
-unsigned long 
+unsigned long
 gpgme_get_sig_ulong_attr (gpgme_ctx_t ctx, int idx,
                           _gpgme_attr_t what, int whatidx)
 {
@@ -994,22 +994,22 @@ gpgme_get_sig_ulong_attr (gpgme_ctx_t ctx, int idx,
 	{
 	case GPG_ERR_NO_ERROR:
 	  return GPGME_SIG_STAT_GOOD;
-	  
+
 	case GPG_ERR_BAD_SIGNATURE:
 	  return GPGME_SIG_STAT_BAD;
-	  
+
 	case GPG_ERR_NO_PUBKEY:
 	  return GPGME_SIG_STAT_NOKEY;
-	  
+
 	case GPG_ERR_NO_DATA:
 	  return GPGME_SIG_STAT_NOSIG;
-	  
+
 	case GPG_ERR_SIG_EXPIRED:
 	  return GPGME_SIG_STAT_GOOD_EXP;
-	  
+
 	case GPG_ERR_KEY_EXPIRED:
 	  return GPGME_SIG_STAT_GOOD_EXPKEY;
-	  
+
 	default:
 	  return GPGME_SIG_STAT_ERROR;
 	}

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

Summary of changes:
 src/conversion.c |   35 ++++++++++++++-------------
 src/verify.c     |   68 +++++++++++++++++++++++++++---------------------------
 2 files changed, 52 insertions(+), 51 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list