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_2_99_3-29-gcae9c34


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_99_3-29-gcae9c34
Date: Sat, 23 Jul 2011 14:19:38 +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=cae9c34a1a7a85e81644fa8438a5ebd4b088e280

The branch, master has been updated
       via  cae9c34a1a7a85e81644fa8438a5ebd4b088e280 (commit)
       via  f18e527230a7fe739d51daba5027f1a00c34dacd (commit)
       via  6c77d12ed137836b3990f642d160a2084b63c91b (commit)
      from  b35975dffb003ed3fc9e25c37e4f90e54020287f (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 cae9c34a1a7a85e81644fa8438a5ebd4b088e280
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sat Jul 23 16:19:15 2011 +0200

    updated.

commit f18e527230a7fe739d51daba5027f1a00c34dacd
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sat Jul 23 16:14:27 2011 +0200

    The crippled status of an gnutls_x509_privkey_t was removed.

commit 6c77d12ed137836b3990f642d160a2084b63c91b
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sat Jul 23 16:05:47 2011 +0200

    Example compilation fix.

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

Summary of changes:
 NEWS                          |    7 +++++
 doc/examples/ex-pkcs11-list.c |    2 +-
 lib/gnutls_rsa_export.c       |    2 -
 lib/x509/privkey.c            |   61 ++++++++++++-----------------------------
 lib/x509/privkey_pkcs8.c      |   11 +++-----
 lib/x509/x509_int.h           |    6 ----
 6 files changed, 30 insertions(+), 59 deletions(-)

diff --git a/NEWS b/NEWS
index 8b200cf..31890b3 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,13 @@ See the end for copying conditions.
 
 * Version (unreleased)
 
+** doc: documentation updates.
+
+** libgnutls: gnutls_rsa_params_t is now identical to gnutls_x509_privkey_t
+to avoid thread-safety issues. Reported by Sam Varshavchik.
+
+** libgnutls: Added compatibility mode with /etc/gnutls/pkcs11.conf
+
 ** libgnutls: license upgraded to LGPLv3
 
 ** libgnutls: gnutls_srp_verifier() returns data allocated with gnutls_malloc()
diff --git a/doc/examples/ex-pkcs11-list.c b/doc/examples/ex-pkcs11-list.c
index 0c16a34..c8b4547 100644
--- a/doc/examples/ex-pkcs11-list.c
+++ b/doc/examples/ex-pkcs11-list.c
@@ -6,7 +6,7 @@
 #define URL "pkcs11:URL"
 
 int
-main ()
+main (int argc, char** argv)
 {
   gnutls_pkcs11_obj_t *obj_list;
   gnutls_x509_crt_t xcrt;
diff --git a/lib/gnutls_rsa_export.c b/lib/gnutls_rsa_export.c
index 42b4a9d..9647a56 100644
--- a/lib/gnutls_rsa_export.c
+++ b/lib/gnutls_rsa_export.c
@@ -94,8 +94,6 @@ gnutls_rsa_params_init (gnutls_rsa_params_t * rsa_params)
       return ret;
     }
 
-  (*rsa_params)->crippled = 1;
-
   return 0;
 }
 
diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c
index 7982bdc..bcc2a2c 100644
--- a/lib/x509/privkey.c
+++ b/lib/x509/privkey.c
@@ -106,16 +106,12 @@ gnutls_x509_privkey_cpy (gnutls_x509_privkey_t dst, 
gnutls_x509_privkey_t src)
   dst->params.flags = src->params.flags;
 
   dst->pk_algorithm = src->pk_algorithm;
-  dst->crippled = src->crippled;
 
-  if (!src->crippled)
+  ret = _gnutls_asn1_encode_privkey (dst->pk_algorithm, &dst->key, 
&dst->params);
+  if (ret < 0)
     {
-      ret = _gnutls_asn1_encode_privkey (dst->pk_algorithm, &dst->key, 
&dst->params);
-      if (ret < 0)
-        {
-          gnutls_assert ();
-          return ret;
-        }
+      gnutls_assert ();
+      return ret;
     }
 
   return 0;
@@ -717,14 +713,11 @@ gnutls_x509_privkey_import_rsa_raw2 
(gnutls_x509_privkey_t key,
       goto cleanup;
     }
 
-  if (!key->crippled)
+  ret = _gnutls_asn1_encode_privkey (GNUTLS_PK_RSA, &key->key, &key->params);
+  if (ret < 0)
     {
-      ret = _gnutls_asn1_encode_privkey (GNUTLS_PK_RSA, &key->key, 
&key->params);
-      if (ret < 0)
-        {
-          gnutls_assert ();
-          goto cleanup;
-        }
+      gnutls_assert ();
+      goto cleanup;
     }
 
   key->params.params_nr = RSA_PRIVATE_PARAMS;
@@ -811,14 +804,11 @@ gnutls_x509_privkey_import_dsa_raw (gnutls_x509_privkey_t 
key,
       goto cleanup;
     }
 
-  if (!key->crippled)
+  ret = _gnutls_asn1_encode_privkey (GNUTLS_PK_DSA, &key->key, &key->params);
+  if (ret < 0)
     {
-      ret = _gnutls_asn1_encode_privkey (GNUTLS_PK_DSA, &key->key, 
&key->params);
-      if (ret < 0)
-        {
-          gnutls_assert ();
-          goto cleanup;
-        }
+      gnutls_assert ();
+      goto cleanup;
     }
 
   key->params.params_nr = DSA_PRIVATE_PARAMS;
@@ -953,7 +943,6 @@ gnutls_x509_privkey_export (gnutls_x509_privkey_t key,
                             size_t * output_data_size)
 {
   const char *msg;
-  int ret;
 
   if (key == NULL)
     {
@@ -970,16 +959,6 @@ gnutls_x509_privkey_export (gnutls_x509_privkey_t key,
   else
     msg = "UNKNOWN";
 
-  if (key->crippled)
-    {                           /* encode the parameters on the fly. */
-      ret = _gnutls_asn1_encode_privkey (key->pk_algorithm, &key->key, 
&key->params);
-      if (ret < 0)
-        {
-          gnutls_assert ();
-          return ret;
-        }
-    }
-
   return _gnutls_x509_export_int (key->key, format, msg,
                                   output_data, output_data_size);
 }
@@ -1361,14 +1340,11 @@ gnutls_x509_privkey_generate (gnutls_x509_privkey_t key,
       return ret;
     }
 
-  if (!key->crippled)
+  ret = _gnutls_asn1_encode_privkey (algo, &key->key, &key->params);
+  if (ret < 0)
     {
-      ret = _gnutls_asn1_encode_privkey (algo, &key->key, &key->params);
-      if (ret < 0)
-        {
-          gnutls_assert ();
-          goto cleanup;
-        }
+      gnutls_assert ();
+      goto cleanup;
     }
   key->pk_algorithm = algo;
 
@@ -1411,7 +1387,7 @@ gnutls_x509_privkey_get_key_id (gnutls_x509_privkey_t key,
   digest_hd_st hd;
   gnutls_datum_t der = { NULL, 0 };
 
-  if (key == NULL || key->crippled)
+  if (key == NULL)
     {
       gnutls_assert ();
       return GNUTLS_E_INVALID_REQUEST;
@@ -1657,8 +1633,7 @@ gnutls_x509_privkey_fix (gnutls_x509_privkey_t key)
       return GNUTLS_E_INVALID_REQUEST;
     }
 
-  if (!key->crippled)
-    asn1_delete_structure (&key->key);
+  asn1_delete_structure (&key->key);
 
   ret = _gnutls_asn1_encode_privkey (key->pk_algorithm, &key->key, 
&key->params);
   if (ret < 0)
diff --git a/lib/x509/privkey_pkcs8.c b/lib/x509/privkey_pkcs8.c
index 942087d..92567c1 100644
--- a/lib/x509/privkey_pkcs8.c
+++ b/lib/x509/privkey_pkcs8.c
@@ -1056,14 +1056,11 @@ _decode_pkcs8_dsa_key (ASN1_TYPE pkcs8_asn, 
gnutls_x509_privkey_t pkey)
   _gnutls_mpi_powm (pkey->params.params[3], pkey->params.params[2], 
pkey->params.params[4],
                     pkey->params.params[0]);
 
-  if (!pkey->crippled)
+  ret = _gnutls_asn1_encode_privkey (GNUTLS_PK_DSA, &pkey->key, &pkey->params);
+  if (ret < 0)
     {
-      ret = _gnutls_asn1_encode_privkey (GNUTLS_PK_DSA, &pkey->key, 
&pkey->params);
-      if (ret < 0)
-        {
-          gnutls_assert ();
-          goto error;
-        }
+      gnutls_assert ();
+      goto error;
     }
 
   pkey->params.params_nr = DSA_PRIVATE_PARAMS;
diff --git a/lib/x509/x509_int.h b/lib/x509/x509_int.h
index 41ed582..c42bc04 100644
--- a/lib/x509/x509_int.h
+++ b/lib/x509/x509_int.h
@@ -109,12 +109,6 @@ typedef struct gnutls_x509_privkey_int
 
   gnutls_pk_algorithm_t pk_algorithm;
 
-  /* The crippled keys will not use the ASN1_TYPE key.  The encoding
-   * will only be performed at the export phase, to optimize copying
-   * etc. Cannot be used with the exported API (used internally only).
-   */
-  int crippled;
-
   ASN1_TYPE key;
 } gnutls_x509_privkey_int;
 


hooks/post-receive
-- 
GNU gnutls



reply via email to

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