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_9-27-gf529cab


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_9-27-gf529cab
Date: Wed, 28 Dec 2011 19:02: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=f529cabd38680a5fef482c5eb8c1bb10455fb8d1

The branch, master has been updated
       via  f529cabd38680a5fef482c5eb8c1bb10455fb8d1 (commit)
       via  710db6c8fc44ddbf7bd4f532c322645ce4fd590d (commit)
       via  31d6bfe0681d077bf8037a21dc812b9ed6131f70 (commit)
      from  a5740135b13ca5bf9bfbd43ce707b59fe45bb5f4 (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 f529cabd38680a5fef482c5eb8c1bb10455fb8d1
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Dec 28 20:58:14 2011 +0200

    Print the pgp key's randomart as well.

commit 710db6c8fc44ddbf7bd4f532c322645ce4fd590d
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Dec 28 20:57:52 2011 +0200

    Print the randomart on the key ID and not the fingerprint.

commit 31d6bfe0681d077bf8037a21dc812b9ed6131f70
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Dec 28 20:46:52 2011 +0200

    Updated GNUTLS_E_NO_CERTIFICATE_FOUND description.

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

Summary of changes:
 lib/gnutls_errors.c  |    2 +-
 lib/openpgp/output.c |    2 +-
 lib/x509/output.c    |   42 +++++++++++++++++++++---------------------
 src/certtool.c       |   17 ++++++++++++++---
 4 files changed, 37 insertions(+), 26 deletions(-)

diff --git a/lib/gnutls_errors.c b/lib/gnutls_errors.c
index b978d1d..3b5397a 100644
--- a/lib/gnutls_errors.c
+++ b/lib/gnutls_errors.c
@@ -90,7 +90,7 @@ static const gnutls_error_entry error_algorithms[] = {
   ERROR_ENTRY (N_
                ("An error was encountered at the TLS Finished packet 
calculation."),
                GNUTLS_E_ERROR_IN_FINISHED_PACKET, 1),
-  ERROR_ENTRY (N_("The peer did not send any certificate."),
+  ERROR_ENTRY (N_("No certificate was found."),
                GNUTLS_E_NO_CERTIFICATE_FOUND, 1),
   ERROR_ENTRY (N_("The given DSA key is incompatible with the selected TLS 
protocol."),
                GNUTLS_E_INCOMPAT_DSA_KEY_WITH_TLS_PROTOCOL, 1),
diff --git a/lib/openpgp/output.c b/lib/openpgp/output.c
index af1dd3b..b65aade 100644
--- a/lib/openpgp/output.c
+++ b/lib/openpgp/output.c
@@ -129,7 +129,7 @@ print_key_fingerprint (gnutls_buffer_st * str, 
gnutls_openpgp_crt_t cert)
   
   adds (str, _("\tpublic key's randomart:\n"));
   adds (str, p);
-  adds (str, "\n");
+  adds (str, "\n\n");
 
   gnutls_free(p);
 }
diff --git a/lib/x509/output.c b/lib/x509/output.c
index 1f97b9b..2ecbff2 100644
--- a/lib/x509/output.c
+++ b/lib/x509/output.c
@@ -1349,9 +1349,6 @@ print_fingerprint (gnutls_buffer_st * str, 
gnutls_x509_crt_t cert,
   int err;
   char buffer[MAX_HASH_SIZE];
   size_t size = sizeof (buffer);
-  const char* name;
-  char* p;
-  unsigned int bits;
   
   err = gnutls_x509_crt_get_fingerprint (cert, algo, buffer, &size);
   if (err < 0)
@@ -1366,24 +1363,6 @@ print_fingerprint (gnutls_buffer_st * str, 
gnutls_x509_crt_t cert,
     adds (str, _("\tSHA-1 fingerprint:\n\t\t"));
   _gnutls_buffer_hexprint (str, buffer, size);
   adds (str, "\n");
-
-  err = gnutls_x509_crt_get_pk_algorithm (cert, &bits);
-  if (err < 0)
-    return;
-    
-  name = gnutls_pk_get_name(err);
-  if (name == NULL)
-    return;
-
-  p = _gnutls_key_fingerprint_randomart(buffer, size, name, bits);
-  if (p == NULL)
-    return;
-  
-  adds (str, _("\tpublic key's randomart:\n"));
-  adds (str, p);
-  adds (str, "\n\n");
-
-  gnutls_free(p);
 }
 
 static void
@@ -1392,6 +1371,9 @@ print_keyid (gnutls_buffer_st * str, gnutls_x509_crt_t 
cert)
   int err;
   char buffer[32];
   size_t size = sizeof(buffer);
+  const char* name;
+  char* p;
+  unsigned int bits;
 
   err = gnutls_x509_crt_get_key_id (cert, 0, buffer, &size);
   if (err < 0)
@@ -1403,6 +1385,24 @@ print_keyid (gnutls_buffer_st * str, gnutls_x509_crt_t 
cert)
   adds (str, _("\tPublic Key Id:\n\t\t"));
   _gnutls_buffer_hexprint (str, buffer, size);
   adds (str, "\n");
+
+  err = gnutls_x509_crt_get_pk_algorithm (cert, &bits);
+  if (err < 0)
+    return;
+    
+  name = gnutls_pk_get_name(err);
+  if (name == NULL)
+    return;
+
+  p = _gnutls_key_fingerprint_randomart(buffer, size, name, bits);
+  if (p == NULL)
+    return;
+  
+  adds (str, _("\tpublic key's randomart:\n"));
+  adds (str, p);
+  adds (str, "\n\n");
+
+  gnutls_free(p);
 }
 
 static void
diff --git a/src/certtool.c b/src/certtool.c
index 89131b8..3def624 100644
--- a/src/certtool.c
+++ b/src/certtool.c
@@ -1285,7 +1285,7 @@ pgp_privkey_info (void)
   gnutls_openpgp_privkey_t key;
   unsigned char keyid[GNUTLS_OPENPGP_KEYID_SIZE];
   size_t size;
-  int ret, i, subkeys;
+  int ret, i, subkeys, bits = 0;
   gnutls_datum_t pem;
   const char *cprint;
 
@@ -1352,6 +1352,7 @@ pgp_privkey_info (void)
           else
             print_rsa_pkey (&m, &e, &d, &p, &q, &u, NULL, NULL);
 
+          bits = m.size * 8;
         }
       else if (ret == GNUTLS_PK_DSA)
         {
@@ -1369,6 +1370,8 @@ pgp_privkey_info (void)
                      gnutls_strerror (ret));
           else
             print_dsa_pkey (&x, &y, &p, &q, &g);
+            
+          bits = y.size * 8;
         }
 
       fprintf (outfile, "\n");
@@ -1386,9 +1389,17 @@ pgp_privkey_info (void)
         }
       else
         {
+          gnutls_datum_t art;
+
           fprintf (outfile, "Public Key ID: %s\n", raw_to_string (keyid, 8));
-        }
 
+          ret = gnutls_random_art(GNUTLS_RANDOM_ART_OPENSSH, cprint, bits, 
keyid, 8, &art);
+          if (ret >= 0)
+            {
+              fprintf (outfile, "public key's randomart:\n%s\n\n", art.data);
+              gnutls_free(art.data);
+            }
+        }
     }
 
   size = buffer_size;
@@ -1694,7 +1705,7 @@ const char *cprint;
       else
         {
           print_ecc_pkey (curve, &k, &x, &y);
-          bits = gnutls_ecc_curve_get_size(curve);
+          bits = gnutls_ecc_curve_get_size(curve) * 8;
 
           gnutls_free (x.data);
           gnutls_free (y.data);


hooks/post-receive
-- 
GNU gnutls



reply via email to

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