gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, master, updated. gnutls_3_0_21-80-geb5efe9


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_21-80-geb5efe9
Date: Tue, 24 Jul 2012 16:54:07 +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=eb5efe93948b83a757dbb32d5c48f3e3040c76d2

The branch, master has been updated
       via  eb5efe93948b83a757dbb32d5c48f3e3040c76d2 (commit)
      from  ef5bfbb0aea81b9ed9a20446b55d50b1237fce5c (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 eb5efe93948b83a757dbb32d5c48f3e3040c76d2
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Jul 23 16:25:52 2012 +0300

    PIN-related functions common to TPM and PKCS #11 moved to pin.c.

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

Summary of changes:
 lib/Makefile.am  |    4 +-
 lib/pin.c        |   67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/pin.h        |    7 +++++
 lib/pkcs11.c     |   46 +------------------------------------
 lib/pkcs11_int.h |    2 -
 lib/tpm.c        |    1 +
 6 files changed, 78 insertions(+), 49 deletions(-)
 create mode 100644 lib/pin.c
 create mode 100644 lib/pin.h

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 69d98b1..c4a4a6a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -74,7 +74,7 @@ COBJECTS = gnutls_record.c gnutls_compress.c debug.c 
gnutls_cipher.c  \
        gnutls_rsa_export.c gnutls_helper.c gnutls_supplemental.c       \
        random.c crypto-api.c gnutls_privkey.c gnutls_pcert.c           \
        gnutls_pubkey.c locks.c hash.c gnutls_dtls.c system_override.c  \
-       crypto-backend.c verify-tofu.c
+       crypto-backend.c verify-tofu.c pin.c
 
 if ENABLE_TROUSERS
 COBJECTS += tpm.c
@@ -100,7 +100,7 @@ HFILES = abstract_int.h debug.h gnutls_compress.h 
gnutls_cipher.h   \
        gnutls_state.h gnutls_x509.h crypto-backend.h                   \
        gnutls_rsa_export.h gnutls_srp.h auth/srp.h auth/srp_passwd.h   \
        gnutls_helper.h gnutls_supplemental.h crypto.h random.h system.h\
-       locks.h gnutls_mbuffers.h hash.h gnutls_ecc.h
+       locks.h gnutls_mbuffers.h hash.h gnutls_ecc.h pin.h
 
 if ENABLE_PKCS11
 HFILES += pkcs11_int.h
diff --git a/lib/pin.c b/lib/pin.c
new file mode 100644
index 0000000..5fc7fb8
--- /dev/null
+++ b/lib/pin.c
@@ -0,0 +1,67 @@
+/*
+ * GnuTLS PIN support for PKCS#11 or TPM
+ * Copyright (C) 2010-2012 Free Software Foundation, Inc.
+ * 
+ * Authors: Nikos Mavrogiannopoulos
+ *
+ * The GnuTLS 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 3 of
+ * the License, or (at your option) any later version.
+ *
+ * This library 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, see <http://www.gnu.org/licenses/>
+ */
+
+#include <gnutls_int.h>
+#include <gnutls/pkcs11.h>
+#include <pin.h>
+
+gnutls_pin_callback_t _gnutls_pin_func;
+void *_gnutls_pin_data;
+
+/**
+ * gnutls_pkcs11_set_pin_function:
+ * @fn: The PIN callback, a gnutls_pin_callback_t() function.
+ * @userdata: data to be supplied to callback
+ *
+ * This function will set a callback function to be used when a PIN is
+ * required for PKCS 11 operations.  See
+ * gnutls_pin_callback_t() on how the callback should behave.
+ *
+ * Since: 2.12.0
+ **/
+void
+gnutls_pkcs11_set_pin_function (gnutls_pin_callback_t fn,
+                                void *userdata)
+{
+  _gnutls_pin_func = fn;
+  _gnutls_pin_data = userdata;
+}
+
+/**
+ * gnutls_pkcs11_get_pin_function:
+ * @userdata: data to be supplied to callback
+ *
+ * This function will return the callback function set using
+ * gnutls_pkcs11_set_pin_function().
+ *
+ * Returns: The function set or NULL otherwise.
+ * 
+ * Since: 3.1.0
+ **/
+gnutls_pin_callback_t
+gnutls_pkcs11_get_pin_function (void **userdata)
+{
+  if (_gnutls_pin_func != NULL)
+    {
+      *userdata = _gnutls_pin_data;
+      return _gnutls_pin_func;
+    }
+  return NULL;
+}
diff --git a/lib/pin.h b/lib/pin.h
new file mode 100644
index 0000000..d75b0f6
--- /dev/null
+++ b/lib/pin.h
@@ -0,0 +1,7 @@
+#ifndef PIN_H
+#define PIN_H
+
+extern gnutls_pin_callback_t _gnutls_pin_func;
+extern void *_gnutls_pin_data;
+
+#endif /* PIN_H */
diff --git a/lib/pkcs11.c b/lib/pkcs11.c
index 6440f0c..1e7b034 100644
--- a/lib/pkcs11.c
+++ b/lib/pkcs11.c
@@ -30,7 +30,7 @@
 #include <gnutls_errors.h>
 #include <gnutls_datum.h>
 
-
+#include <pin.h>
 #include <pkcs11_int.h>
 #include <p11-kit/p11-kit.h>
 #include <p11-kit/pin.h>
@@ -74,9 +74,6 @@ static struct gnutls_pkcs11_provider_s 
providers[MAX_PROVIDERS];
 static unsigned int active_providers = 0;
 static unsigned int initialized_registered = 0;
 
-gnutls_pin_callback_t _gnutls_pin_func;
-void *_gnutls_pin_data;
-
 gnutls_pkcs11_token_callback_t _gnutls_token_func;
 void *_gnutls_token_data;
 
@@ -640,47 +637,6 @@ gnutls_pkcs11_deinit (void)
 }
 
 /**
- * gnutls_pkcs11_set_pin_function:
- * @fn: The PIN callback, a gnutls_pin_callback_t() function.
- * @userdata: data to be supplied to callback
- *
- * This function will set a callback function to be used when a PIN is
- * required for PKCS 11 operations.  See
- * gnutls_pin_callback_t() on how the callback should behave.
- *
- * Since: 2.12.0
- **/
-void
-gnutls_pkcs11_set_pin_function (gnutls_pin_callback_t fn,
-                                void *userdata)
-{
-  _gnutls_pin_func = fn;
-  _gnutls_pin_data = userdata;
-}
-
-/**
- * gnutls_pkcs11_get_pin_function:
- * @userdata: data to be supplied to callback
- *
- * This function will return the callback function set using
- * gnutls_pkcs11_set_pin_function().
- *
- * Returns: The function set or NULL otherwise.
- * 
- * Since: 3.1.0
- **/
-gnutls_pin_callback_t
-gnutls_pkcs11_get_pin_function (void **userdata)
-{
-  if (_gnutls_pin_func != NULL)
-    {
-      *userdata = _gnutls_pin_data;
-      return _gnutls_pin_func;
-    }
-  return NULL;
-}
-
-/**
  * gnutls_pkcs11_set_token_function:
  * @fn: The token callback
  * @userdata: data to be supplied to callback
diff --git a/lib/pkcs11_int.h b/lib/pkcs11_int.h
index 331e4eb..d5b0370 100644
--- a/lib/pkcs11_int.h
+++ b/lib/pkcs11_int.h
@@ -34,8 +34,6 @@
 #include <p11-kit/uri.h>
 typedef unsigned char ck_bool_t;
 
-extern gnutls_pin_callback_t _gnutls_pin_func;
-extern void *_gnutls_pin_data;
 
 struct pkcs11_session_info {
   struct ck_function_list * module;
diff --git a/lib/tpm.c b/lib/tpm.c
index f0203b4..564c0ac 100644
--- a/lib/tpm.c
+++ b/lib/tpm.c
@@ -37,6 +37,7 @@
 #include <x509/common.h>
 #include <x509_b64.h>
 #include <random.h>
+#include <pin.h>
 
 #include <trousers/tss.h>
 #include <trousers/trousers.h>


hooks/post-receive
-- 
GNU gnutls



reply via email to

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