[svn] GnuPG - r4569 - in trunk: . doc g10 jnlib kbx tests/samplekeys
svn author wk
cvs at cvs.gnupg.org
Fri Aug 24 11:35:09 CEST 2007
Author: wk
Date: 2007-08-24 11:34:39 +0200 (Fri, 24 Aug 2007)
New Revision: 4569
Added:
trunk/tests/samplekeys/gte.pem
Modified:
trunk/NEWS
trunk/doc/ChangeLog
trunk/doc/debugging.texi
trunk/doc/gpg-agent.texi
trunk/g10/ChangeLog
trunk/g10/keyring.c
trunk/jnlib/ChangeLog
trunk/jnlib/mischelp.c
trunk/jnlib/mischelp.h
trunk/jnlib/stringhelp.c
trunk/kbx/ChangeLog
trunk/kbx/keybox-init.c
trunk/tests/samplekeys/README
Log:
tryu harder to ignore duplicate specified keyrings and -boxes.
Documentation updates.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/NEWS 2007-08-24 09:34:39 UTC (rev 4569)
@@ -1,7 +1,12 @@
Noteworthy changes in version 2.0.7
------------------------------------------------
+ * Fixed encryption problem if duplicate certificates are in the
+ keybox.
+ * Made it work on Windows Vista.
+
+
Noteworthy changes in version 2.0.6 (2007-08-16)
------------------------------------------------
Modified: trunk/doc/ChangeLog
===================================================================
--- trunk/doc/ChangeLog 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/doc/ChangeLog 2007-08-24 09:34:39 UTC (rev 4569)
@@ -1,3 +1,8 @@
+2007-08-24 Werner Koch <wk at g10code.com>
+
+ * debugging.texi (Common Problems): Add "A root certifciate does
+ not validate."
+
2007-08-14 Werner Koch <wk at g10code.com>
* glossary.texi (Glossary): Add a more items.
Modified: trunk/doc/debugging.texi
===================================================================
--- trunk/doc/debugging.texi 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/doc/debugging.texi 2007-08-24 09:34:39 UTC (rev 4569)
@@ -77,10 +77,17 @@
provided by @command{gpgsm} or @command{gpg}. 81 certifcates are stored
in a standard way and directly available from @command{gpgsm}.
+ at noindent
+To find duplicated certificates and keyblocks in a keybox file (this
+should not occur but sometimes things go wrong), run it using
+ at samp{kbxutil --find-dups ~/.gnupg/pubring.kbx}
+
+
+
@node Common Problems
@section Commonly Seen Problems
@@ -165,6 +172,18 @@
or other purposes and don't have a corresponding certificate.
+ at item A root certificate does not verify
+
+A common problem is that the root certificate misses the required
+basicConstrains attribute and thus @command{gpgsm} rejects this
+certificate. An error message indicating ``no value'' is a sign for
+such a certificate. You may use the @code{relax} flag in
+ at file{trustlist.txt} to accept the certificate anyway. Note that the
+fingerprint and this flag may only be added manually to
+ at file{trustlist.txt}.
+
+
+
@end itemize
Modified: trunk/doc/gpg-agent.texi
===================================================================
--- trunk/doc/gpg-agent.texi 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/doc/gpg-agent.texi 2007-08-24 09:34:39 UTC (rev 4569)
@@ -502,7 +502,9 @@
@table @code
@item relax
-Relax checking of some root certificate requirements.
+Relax checking of some root certificate requirements. This is for
+example required if the certificate is missing the basicConstraints
+attribute (despite that it is a MUST for CA certificates).
@item cm
If validation of a certificate finally issued by a CA with this flag set
Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/g10/ChangeLog 2007-08-24 09:34:39 UTC (rev 4569)
@@ -1,3 +1,7 @@
+2007-08-24 Werner Koch <wk at g10code.com>
+
+ * keyring.c (keyring_register_filename): Use same_file_p().
+
2007-08-21 Werner Koch <wk at g10code.com>
* misc.c (openpgp_md_test_algo): Remove rfc2440bis hash algorithms.
Modified: trunk/g10/keyring.c
===================================================================
--- trunk/g10/keyring.c 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/g10/keyring.c 2007-08-24 09:34:39 UTC (rev 4569)
@@ -206,10 +206,10 @@
for (kr=kr_names; kr; kr = kr->next)
{
- if ( !compare_filenames (kr->fname, fname) )
+ if (same_file_p (kr->fname, fname))
{
*ptr=kr;
- return 0; /* already registered */
+ return 0; /* Already registered. */
}
}
Modified: trunk/jnlib/ChangeLog
===================================================================
--- trunk/jnlib/ChangeLog 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/jnlib/ChangeLog 2007-08-24 09:34:39 UTC (rev 4569)
@@ -1,3 +1,9 @@
+2007-08-24 Werner Koch <wk at g10code.com>
+
+ * mischelp.c (same_file_p): New.
+ (libjnlib_dummy_mischelp_func): Remove as we now always have one
+ function.
+
2007-08-09 Werner Koch <wk at g10code.com>
* argparse.c (show_help): Expand the @EMAIL@ macro in the package
Modified: trunk/jnlib/mischelp.c
===================================================================
--- trunk/jnlib/mischelp.c 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/jnlib/mischelp.c 2007-08-24 09:34:39 UTC (rev 4569)
@@ -1,5 +1,5 @@
/* mischelp.c - Miscellaneous helper functions
- * Copyright (C) 1998, 2000, 2001, 2006 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 2000, 2001, 2006, 2007 Free Software Foundation, Inc.
*
* This file is part of JNLIB.
*
@@ -21,16 +21,63 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#ifdef HAVE_W32_SYSTEM
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#else /*!HAVE_W32_SYSTEM*/
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <unistd.h>
+#endif /*!HAVE_W32_SYSTEM*/
#include "libjnlib-config.h"
+#include "stringhelp.h"
#include "mischelp.h"
-/* A dummy function to prevent an empty compilation unit. Some
- compilers bail out in this case. */
-time_t
-libjnlib_dummy_mischelp_func (void)
+
+/* Check whether the files NAME1 and NAME2 are identical. This is for
+ example achieved by comparing the inode numbers of the files. */
+int
+same_file_p (const char *name1, const char *name2)
{
- return time (NULL);
+ int yes;
+
+ /* First try a shortcut. */
+ if (!compare_filenames (name1, name2))
+ yes = 1;
+ else
+ {
+#ifdef HAVE_W32_SYSTEM
+ HANDLE file1, file2;
+ BY_HANDLE_FILE_INFORMATION info1, info2;
+
+ file1 = CreateFile (name1, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
+ if (file1 == INVALID_HANDLE_VALUE)
+ yes = 0; /* If we can't open the file, it is not the same. */
+ else
+ {
+ file2 = CreateFile (name2, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
+ if (file1 == INVALID_HANDLE_VALUE)
+ yes = 0; /* If we can't open the file, it is not the same. */
+ else
+ {
+ yes = (GetFileInformationByHandle (file1, &info1)
+ && GetFileInformationByHandle (file2, &info2)
+ && info1.dwVolumeSerialNumber==info2.dwVolumeSerialNumber
+ && info1.nFileIndexHigh == info2.nFileIndexHigh
+ && info1.nFileIndexLow == info2.nFileIndexLow);
+ CloseHandle (file2);
+ }
+ CloseHandle (file1);
+ }
+#else /*!HAVE_W32_SYSTEM*/
+ struct stat info1, info2;
+
+ yes = (!stat (name1, &info1) && !stat (name2, &info2)
+ && info1.st_dev == info2.st_dev && info1.st_ino == info2.st_ino);
+#endif /*!HAVE_W32_SYSTEM*/
+ }
+ return yes;
}
Modified: trunk/jnlib/mischelp.h
===================================================================
--- trunk/jnlib/mischelp.h 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/jnlib/mischelp.h 2007-08-24 09:34:39 UTC (rev 4569)
@@ -1,6 +1,6 @@
/* mischelp.h - Miscellaneous helper macros and functions
* Copyright (C) 1999, 2000, 2001, 2002, 2003,
- * 2006 Free Software Foundation, Inc.
+ * 2006, 2007 Free Software Foundation, Inc.
*
* This file is part of JNLIB.
*
@@ -22,6 +22,11 @@
#define LIBJNLIB_MISCHHELP_H
+/* Check whether the files NAME1 and NAME2 are identical. This is for
+ example achieved by comparing the inode numbers of the files. */
+int same_file_p (const char *name1, const char *name2);
+
+
#ifndef HAVE_TIMEGM
#include <time.h>
time_t timegm (struct tm *tm);
Modified: trunk/jnlib/stringhelp.c
===================================================================
--- trunk/jnlib/stringhelp.c 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/jnlib/stringhelp.c 2007-08-24 09:34:39 UTC (rev 4569)
@@ -338,11 +338,14 @@
}
+/* Compare whether the filenames are identical. This is a
+ specialversion of strcmp() taking the semantics of filenames in
+ account. Note that this function works only on the supplied names
+ without considereing any context like the current directory. See
+ also same_file_p(). */
int
compare_filenames (const char *a, const char *b)
{
- /* ? check whether this is an absolute filename and resolve
- symlinks? */
#ifdef HAVE_DRIVE_LETTERS
for ( ; *a && *b; a++, b++ )
{
Modified: trunk/kbx/ChangeLog
===================================================================
--- trunk/kbx/ChangeLog 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/kbx/ChangeLog 2007-08-24 09:34:39 UTC (rev 4569)
@@ -1,3 +1,7 @@
+2007-08-24 Werner Koch <wk at g10code.com>
+
+ * keybox-init.c (keybox_register_file): Use same_file_p.
+
2007-08-23 Werner Koch <wk at g10code.com>
* kbxutil.c: New commands --find-dups and --cut. New options
Modified: trunk/kbx/keybox-init.c
===================================================================
--- trunk/kbx/keybox-init.c 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/kbx/keybox-init.c 2007-08-24 09:34:39 UTC (rev 4569)
@@ -24,10 +24,9 @@
#include <unistd.h>
#include <assert.h>
+#include "../jnlib/mischelp.h"
#include "keybox-defs.h"
-#define compare_filenames strcmp
-
static KB_NAME kb_names;
@@ -42,8 +41,8 @@
for (kr=kb_names; kr; kr = kr->next)
{
- if ( !compare_filenames (kr->fname, fname) )
- return NULL; /* already registered */
+ if (same_file_p (kr->fname, fname) )
+ return NULL; /* Already registered. */
}
kr = xtrymalloc (sizeof *kr + strlen (fname));
Modified: trunk/tests/samplekeys/README
===================================================================
--- trunk/tests/samplekeys/README 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/tests/samplekeys/README 2007-08-24 09:34:39 UTC (rev 4569)
@@ -13,5 +13,8 @@
webdeca.der trust.web.de CA certificate [2004-02-17]
+gte.pem GTE CyberTrust Global Root
+
+
Added: trunk/tests/samplekeys/gte.pem
===================================================================
--- trunk/tests/samplekeys/gte.pem 2007-08-23 17:41:22 UTC (rev 4568)
+++ trunk/tests/samplekeys/gte.pem 2007-08-24 09:34:39 UTC (rev 4569)
@@ -0,0 +1,19 @@
+Issuer ...: /CN=GTE CyberTrust Global Root/OU=GTE CyberTrust Solutions, Inc./O=GTE Corporation/C=US
+Serial ...: 01A5
+Subject ..: /CN=GTE CyberTrust Global Root/OU=GTE CyberTrust Solutions, Inc./O=GTE Corporation/C=US
+
+-----BEGIN CERTIFICATE-----
+MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD
+VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv
+bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv
+b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV
+UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU
+cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds
+b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH
+iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS
+r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4
+04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r
+GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9
+3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P
+lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/
+-----END CERTIFICATE-----
More information about the Gnupg-commits
mailing list