* card-util.c (card_status): Use isotimestamp and not the
authorWerner Koch <wk@gnupg.org>
Mon, 14 Mar 2005 20:41:20 +0000 (20:41 +0000)
committerWerner Koch <wk@gnupg.org>
Mon, 14 Mar 2005 20:41:20 +0000 (20:41 +0000)
localized asctimestamp to match the timezone used in the key
information.

* miscutil.c (isotimestamp): New.

g10/ChangeLog
g10/card-util.c
include/util.h
scripts/conf-w32/README [new file with mode: 0644]
scripts/conf-w32/bzip2-1.diff [new file with mode: 0644]
util/ChangeLog
util/miscutil.c

index 1f02e47..c493d21 100644 (file)
@@ -1,5 +1,9 @@
 2005-03-14  Werner Koch  <wk@g10code.com>
 
+       * card-util.c (card_status): Use isotimestamp and not the
+       localized asctimestamp to match the timezone used in the key
+       information.
+
        * cardglue.c (pin_cb): Disable debug output.
 
 2005-03-11  Werner Koch  <wk@g10code.com>
index c63335b..4f25c5e 100644 (file)
@@ -426,17 +426,17 @@ card_status (FILE *fp, char *serialno, size_t serialnobuflen)
       print_sha1_fpr (fp, info.fpr1valid? info.fpr1:NULL);
       if (info.fpr1valid && info.fpr1time)
         tty_fprintf (fp, "      created ....: %s\n",
-                     asctimestamp (info.fpr1time));
+                     isotimestamp (info.fpr1time));
       tty_fprintf (fp, "Encryption key....:");
       print_sha1_fpr (fp, info.fpr2valid? info.fpr2:NULL);
       if (info.fpr2valid && info.fpr2time)
         tty_fprintf (fp, "      created ....: %s\n",
-                     asctimestamp (info.fpr2time));
+                     isotimestamp (info.fpr2time));
       tty_fprintf (fp, "Authentication key:");
       print_sha1_fpr (fp, info.fpr3valid? info.fpr3:NULL);
       if (info.fpr3valid && info.fpr3time)
         tty_fprintf (fp, "      created ....: %s\n",
-                     asctimestamp (info.fpr3time));
+                     isotimestamp (info.fpr3time));
       tty_fprintf (fp, "General key info..: "); 
 
       thefpr = (info.fpr1valid? info.fpr1 : info.fpr2valid? info.fpr2 : 
index ba493b1..c6e89e7 100644 (file)
@@ -152,6 +152,7 @@ u32 scan_isodatestr( const char *string );
 u32 add_days_to_timestamp( u32 stamp, u16 days );
 const char *strtimevalue( u32 stamp );
 const char *strtimestamp( u32 stamp ); /* GMT */
+const char *isotimestamp( u32 stamp ); /* GMT with hh:mm:ss */
 const char *asctimestamp( u32 stamp ); /* localized */
 void print_string( FILE *fp, const byte *p, size_t n, int delim );
 void print_string2( FILE *fp, const byte *p, size_t n, int delim, int delim2 );
diff --git a/scripts/conf-w32/README b/scripts/conf-w32/README
new file mode 100644 (file)
index 0000000..12b89c0
--- /dev/null
@@ -0,0 +1,2 @@
+Files useful for building W32 versions.
+
diff --git a/scripts/conf-w32/bzip2-1.diff b/scripts/conf-w32/bzip2-1.diff
new file mode 100644 (file)
index 0000000..568d8f5
--- /dev/null
@@ -0,0 +1,39 @@
+To include support for BZIP2 compression in GunPG for W32, the patch
+below should be applied to a stock bzip2-1.0.2 source.  The Build as
+usual using the mingw32 cross compiler package from Debian and install
+the library and header file on top of the cross compiler installation
+(/usr/i586-mingw32msvc/lib/).  Note that for ease of maintenance we
+don't used a DLL.                                      [wk 2005-03-14]
+
+
+diff -u orig/bzip2-1.0.2/Makefile bzip2-1.0.2/Makefile
+--- orig/bzip2-1.0.2/Makefile  2002-01-26 00:34:53.000000000 +0100
++++ bzip2-1.0.2/Makefile       2004-11-03 14:10:45.000000000 +0100
+@@ -2,9 +2,9 @@
+ SHELL=/bin/sh
+ # To assist in cross-compiling
+-CC=gcc
+-AR=ar
+-RANLIB=ranlib
++CC=i586-mingw32msvc-gcc
++AR=i586-mingw32msvc-ar
++RANLIB=i586-mingw32msvc-ranlib
+ LDFLAGS=
+ # Suitably paranoid flags to avoid bugs in gcc-2.7
+diff -u orig/bzip2-1.0.2/bzlib.h bzip2-1.0.2/bzlib.h
+--- orig/bzip2-1.0.2/bzlib.h   2001-12-30 03:19:45.000000000 +0100
++++ bzip2-1.0.2/bzlib.h        2004-11-03 14:32:41.000000000 +0100
+@@ -113,7 +114,7 @@
+ /* Need a definitition for FILE */
+ #include <stdio.h>
+-#ifdef _WIN32
++#if defined( _WIN32 ) && 0
+ #   include <windows.h>
+ #   ifdef small
+       /* windows.h define small to char */
+
+
+
index 04fe9b2..4248b25 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-14  Werner Koch  <wk@g10code.com>
+
+       * miscutil.c (isotimestamp): New.
+
 2005-03-10  Werner Koch  <wk@g10code.com>
 
        * secmem.c (secmem_realloc): Take control information into account
index 4c2c0ed..aa3973b 100644 (file)
@@ -1,6 +1,6 @@
 /* miscutil.c -  miscellaneous utilities
  * Copyright (C) 1998, 1999, 2000, 2001, 2003,
- *               2004 Free Software Foundation, Inc.
+ *               2004, 2005 Free Software Foundation, Inc.
  *
  * This file is part of GnuPG.
  *
@@ -137,6 +137,29 @@ strtimestamp( u32 stamp )
     return buffer;
 }
 
+
+/****************
+ * Note: this function returns GMT
+ */
+const char *
+isotimestamp (u32 stamp)
+{
+    static char buffer[25+5];
+    struct tm *tp;
+    time_t atime = stamp;
+    
+    if (atime < 0) {
+        strcpy (buffer, "????" "-??" "-??" " " "??" ":" "??" ":" "??");
+    }
+    else {
+        tp = gmtime( &atime );
+        sprintf(buffer,"%04d-%02d-%02d %02d:%02d:%02d",
+                1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday,
+                tp->tm_hour, tp->tm_min, tp->tm_sec);
+    }
+    return buffer;
+}
+
 /****************
  * Note: this function returns local time
  */