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_3-91-g3f031f8


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_3-91-g3f031f8
Date: Thu, 13 Oct 2011 15:49:19 +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=3f031f86521dbe38265415b80e6eda48e24c3b88

The branch, master has been updated
       via  3f031f86521dbe38265415b80e6eda48e24c3b88 (commit)
      from  d0c67b24c809cd401febb2695c9173eca1e01572 (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 3f031f86521dbe38265415b80e6eda48e24c3b88
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Oct 13 17:49:58 2011 +0200

    key id is being calculated the same way in private keys as in public keys.

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

Summary of changes:
 lib/x509/privkey.c |   35 ++++-------------------------------
 1 files changed, 4 insertions(+), 31 deletions(-)

diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c
index 9327bdf..8a2ec3c 100644
--- a/lib/x509/privkey.c
+++ b/lib/x509/privkey.c
@@ -1391,9 +1391,7 @@ gnutls_x509_privkey_get_key_id (gnutls_x509_privkey_t key,
                                 unsigned char *output_data,
                                 size_t * output_data_size)
 {
-  int result;
-  digest_hd_st hd;
-  gnutls_datum_t der = { NULL, 0 };
+  int ret;
 
   if (key == NULL)
     {
@@ -1401,38 +1399,13 @@ gnutls_x509_privkey_get_key_id (gnutls_x509_privkey_t 
key,
       return GNUTLS_E_INVALID_REQUEST;
     }
 
-  if (*output_data_size < 20)
-    {
-      gnutls_assert ();
-      *output_data_size = 20;
-      return GNUTLS_E_SHORT_MEMORY_BUFFER;
-    }
-
-  result = _gnutls_x509_write_pubkey(key->pk_algorithm, &key->params, &der);
-  if (result < 0)
-    {
-      gnutls_assert ();
-      goto cleanup;
-    }
-
-  result = _gnutls_hash_init (&hd, GNUTLS_MAC_SHA1);
-  if (result < 0)
+  ret = _gnutls_get_key_id(key->pk_algorithm, &key->params, output_data, 
output_data_size);
+  if (ret < 0)
     {
       gnutls_assert ();
-      goto cleanup;
     }
 
-  _gnutls_hash (&hd, der.data, der.size);
-
-  _gnutls_hash_deinit (&hd, output_data);
-  *output_data_size = 20;
-
-  result = 0;
-
-cleanup:
-
-  _gnutls_free_datum (&der);
-  return result;
+  return ret;
 }
 
 


hooks/post-receive
-- 
GNU gnutls



reply via email to

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