gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, gnutls_2_12_x, updated. gnutls_2_12_7_a-30-g49b


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, gnutls_2_12_x, updated. gnutls_2_12_7_a-30-g49b2ac5
Date: Mon, 08 Aug 2011 21:23:50 +0000

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 "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=49b2ac5de1a2a9b9c55f558e5eeb877bea6b5fa2

The branch, gnutls_2_12_x has been updated
       via  49b2ac5de1a2a9b9c55f558e5eeb877bea6b5fa2 (commit)
       via  7e70042b268ea935d7fd719a3f540222f30edf3c (commit)
       via  2cfb179d19007a983869314e873ac347de542778 (commit)
      from  589c804845b196047c8bdee48903efac5160c6b9 (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 49b2ac5de1a2a9b9c55f558e5eeb877bea6b5fa2
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Aug 8 22:58:58 2011 +0200

    bumped library version

commit 7e70042b268ea935d7fd719a3f540222f30edf3c
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Aug 8 22:58:31 2011 +0200

    document new config files of p11-kit.

commit 2cfb179d19007a983869314e873ac347de542778
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Aug 8 20:21:47 2011 +0200

    Prevent from loading twice the same module.

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

Summary of changes:
 NEWS                   |    2 +-
 doc/cha-cert-auth.texi |   15 +++++++--------
 lib/m4/hooks.m4        |    2 +-
 lib/pkcs11.c           |   21 +++++++++++++++++----
 4 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/NEWS b/NEWS
index 3667639..ac52ffe 100644
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,7 @@ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
               2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 See the end for copying conditions.
 
-* Version 2.12.8 (unreleased)
+* Version 2.12.8 (released 2011-08-08)
 
 ** libgnutls: PKCS #11 back-end was replaced by p11-kit
 http://p11-glue.freedesktop.org/p11-kit.html. This backports
diff --git a/doc/cha-cert-auth.texi b/doc/cha-cert-auth.texi
index ff50a8a..19f4b9e 100644
--- a/doc/cha-cert-auth.texi
+++ b/doc/cha-cert-auth.texi
@@ -341,14 +341,13 @@ shared cryptographic keys and certificates in a uniform 
way, as in the following
 @image{pkcs11-vision}
 
 @subsection Initialization
-To allow all the  @acronym{GnuTLS} applications to access @acronym{PKCS #11} 
tokens
-it is adviceable to use @code{/etc/gnutls/pkcs11.conf}. This file has the 
following
-format:
+To allow all the  @acronym{GnuTLS} applications to access @acronym{PKCS} #11 
tokens
+you can use a configuration per module, such as 
@code{/etc/pkcs11/modules/mymodule.conf}. 
+This file has the following format:
 
address@hidden
-load=/usr/lib/opensc-pkcs11.so
-load=/usr/lib/gnome-keyring/gnome-keyring-pkcs11.so
address@hidden verbatim
address@hidden
+module: /usr/lib/opensc-pkcs11.so
address@hidden smallexample
 
 If you use this file, then there is no need for other initialization in
 @acronym{GnuTLS}, except for the PIN and token functions. Those allow 
retrieving a PIN
diff --git a/lib/m4/hooks.m4 b/lib/m4/hooks.m4
index 5379ef7..b33c8c4 100644
--- a/lib/m4/hooks.m4
+++ b/lib/m4/hooks.m4
@@ -27,7 +27,7 @@ AC_DEFUN([LIBGNUTLS_HOOKS],
   # Interfaces added:                             AGE++
   # Interfaces removed:                           AGE=0
   AC_SUBST(LT_CURRENT, 47)
-  AC_SUBST(LT_REVISION, 1)
+  AC_SUBST(LT_REVISION, 2)
   AC_SUBST(LT_AGE, 21)
 
   AC_SUBST(LT_SSL_CURRENT, 27)
diff --git a/lib/pkcs11.c b/lib/pkcs11.c
index b26abe1..f5ce8ad 100644
--- a/lib/pkcs11.c
+++ b/lib/pkcs11.c
@@ -181,12 +181,28 @@ pkcs11_rescan_slots (void)
 static int
 pkcs11_add_module (const char *name, struct ck_function_list *module)
 {
+  struct ck_info info;
+  int i;
+
   if (active_providers >= MAX_PROVIDERS)
     {
       gnutls_assert ();
       return GNUTLS_E_CONSTRAINT_ERROR;
     }
 
+  /* initially check if this module is a duplicate */
+  memset(&info, 0, sizeof(info));
+  pkcs11_get_module_info (module, &info);
+  for (i=0;i<active_providers;i++)
+    {
+      /* already loaded, skip the rest */
+      if (memcmp(&info, &providers[i].info, sizeof(info)) == 0)
+        {
+          _gnutls_debug_log("%s is already loaded.\n", name);
+          return 0;
+        }
+    }
+
   active_providers++;
   providers[active_providers - 1].module = module;
 
@@ -218,10 +234,7 @@ pkcs11_add_module (const char *name, struct 
ck_function_list *module)
       goto fail;
     }
 
-  memset (&providers[active_providers - 1].info, 0,
-          sizeof (providers[active_providers - 1].info));
-  pkcs11_get_module_info (providers[active_providers - 1].module,
-                          &providers[active_providers - 1].info);
+  memcpy (&providers[active_providers - 1].info, &info, sizeof(info));
 
   _gnutls_debug_log ("p11: loaded provider '%s' with %d slots\n",
                      name, (int) providers[active_providers - 1].nslots);


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]