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-34-g941b82c


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_3_0_9-34-g941b82c
Date: Thu, 29 Dec 2011 00:06:57 +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=941b82caa389cca3b1dc9a951550f0dadf697aac

The branch, master has been updated
       via  941b82caa389cca3b1dc9a951550f0dadf697aac (commit)
       via  7e93c45fcda6c686f3e7e959e00bed2ab055c80a (commit)
       via  395bcc6855c87ac90dc02652a509d14e60c95c6c (commit)
      from  60fad8ae0685be34d13580d9b6b692aadae683fd (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 941b82caa389cca3b1dc9a951550f0dadf697aac
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Dec 29 01:51:25 2011 +0200

    corrected bug in DSA private key parsing.

commit 7e93c45fcda6c686f3e7e959e00bed2ab055c80a
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Dec 29 01:29:59 2011 +0200

    Added --rsa option which is a no-op for now.

commit 395bcc6855c87ac90dc02652a509d14e60c95c6c
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Dec 29 01:23:23 2011 +0200

    Allow the insertion of characters to align the randomart.

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

Summary of changes:
 NEWS                               |    3 +++
 lib/extras/randomart.c             |   28 ++++++++++++++++++++++++----
 lib/extras/randomart.h             |    3 ++-
 lib/gnutls_ui.c                    |    2 +-
 lib/openpgp/output.c               |    4 ++--
 lib/x509/output.c                  |    4 ++--
 lib/x509/privkey.c                 |    1 -
 src/certtool.gaa                   |    2 ++
 tests/pathlen/ca-no-pathlen.pem    |   23 +++++++++++------------
 tests/pathlen/no-ca-or-pathlen.pem |   23 +++++++++++------------
 10 files changed, 58 insertions(+), 35 deletions(-)

diff --git a/NEWS b/NEWS
index be88c61..a1a0e73 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,9 @@ and GNUTLS_DHE_PSK_WITH_AES_256_GCM_SHA384.
 ** libgnutls: Added function gnutls_random_art() to convert 
 fingerprints to images (currently ascii-art).
 
+** libgnutls: Corrected bug in DSA private key parsing, which
+prevented the verification of the key.
+
 ** API and ABI modifications:
 gnutls_random_art: Added
 
diff --git a/lib/extras/randomart.c b/lib/extras/randomart.c
index bb267fc..70becaf 100644
--- a/lib/extras/randomart.c
+++ b/lib/extras/randomart.c
@@ -63,7 +63,8 @@
 #define        FLDSIZE_X       (FLDBASE * 2 + 1)
 char *
 _gnutls_key_fingerprint_randomart (uint8_t * dgst_raw, u_int dgst_raw_len,
-                                   const char *key_type, unsigned int key_size)
+                                   const char *key_type, unsigned int key_size,
+                                   const char* prefix)
 {
   /*
    * Chars to be used after each other every time the worm
@@ -75,8 +76,12 @@ _gnutls_key_fingerprint_randomart (uint8_t * dgst_raw, u_int 
dgst_raw_len,
   u_int i, b;
   int x, y;
   const size_t len = sizeof(augmentation_string) - 2;
+  int prefix_len = 0;
+  
+  if (prefix)
+    prefix_len = strlen(prefix);
 
-  retval = gnutls_calloc (1, (FLDSIZE_X + 3) * (FLDSIZE_Y + 2));
+  retval = gnutls_calloc (1, (FLDSIZE_X + 3 + prefix_len) * (FLDSIZE_Y + 2));
   if (retval == NULL)
     {
       gnutls_assert();
@@ -118,14 +123,23 @@ _gnutls_key_fingerprint_randomart (uint8_t * dgst_raw, 
u_int dgst_raw_len,
   field[x][y] = len;
 
   /* fill in retval */
-  snprintf (retval, FLDSIZE_X, "+--[%4s %4u]", key_type, key_size);
+  if (prefix_len)
+    snprintf (retval, FLDSIZE_X + prefix_len, "%s+--[%4s %4u]", prefix, 
key_type, key_size);
+  else
+    snprintf (retval, FLDSIZE_X, "+--[%4s %4u]", key_type, key_size);
   p = strchr (retval, '\0');
 
   /* output upper border */
-  for (i = p - retval - 1; i < FLDSIZE_X; i++)
+  for (i = p - retval - 1; i < FLDSIZE_X + prefix_len; i++)
     *p++ = '-';
   *p++ = '+';
   *p++ = '\n';
+  
+  if (prefix_len)
+    {
+      memcpy(p, prefix, prefix_len);
+      p += prefix_len;
+    }
 
   /* output content */
   for (y = 0; y < FLDSIZE_Y; y++)
@@ -135,6 +149,12 @@ _gnutls_key_fingerprint_randomart (uint8_t * dgst_raw, 
u_int dgst_raw_len,
         *p++ = augmentation_string[MIN (field[x][y], len)];
       *p++ = '|';
       *p++ = '\n';
+
+      if (prefix_len)
+        {
+          memcpy(p, prefix, prefix_len);
+          p += prefix_len;
+        }
     }
 
   /* output lower border */
diff --git a/lib/extras/randomart.h b/lib/extras/randomart.h
index 51875ac..07c44c1 100644
--- a/lib/extras/randomart.h
+++ b/lib/extras/randomart.h
@@ -1,3 +1,4 @@
 char *
 _gnutls_key_fingerprint_randomart (uint8_t * dgst_raw, u_int dgst_raw_len,
-                                   const char *key_type, unsigned int 
key_size);
+                                   const char *key_type, unsigned int key_size,
+                                   const char* prefix);
diff --git a/lib/gnutls_ui.c b/lib/gnutls_ui.c
index 87b9f99..34b6ad6 100644
--- a/lib/gnutls_ui.c
+++ b/lib/gnutls_ui.c
@@ -60,7 +60,7 @@ int gnutls_random_art (gnutls_random_art_t type,
   if (type != GNUTLS_RANDOM_ART_OPENSSH)
     return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
 
-  art->data = _gnutls_key_fingerprint_randomart(fpr, fpr_size, key_type, 
key_size);
+  art->data = _gnutls_key_fingerprint_randomart(fpr, fpr_size, key_type, 
key_size, NULL);
   if (art->data == NULL)
     return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);
   
diff --git a/lib/openpgp/output.c b/lib/openpgp/output.c
index 7a6e048..55a2376 100644
--- a/lib/openpgp/output.c
+++ b/lib/openpgp/output.c
@@ -123,13 +123,13 @@ print_key_fingerprint (gnutls_buffer_st * str, 
gnutls_openpgp_crt_t cert)
   if (name == NULL)
     return;
 
-  p = _gnutls_key_fingerprint_randomart(fpr, fpr_size, name, bits);
+  p = _gnutls_key_fingerprint_randomart(fpr, fpr_size, name, bits, "\t\t");
   if (p == NULL)
     return;
   
   adds (str, _("\tFingerprint's random art:\n"));
   adds (str, p);
-  adds (str, "\n\n");
+  adds (str, "\n");
 
   gnutls_free(p);
 }
diff --git a/lib/x509/output.c b/lib/x509/output.c
index 9f1996b..aa3f763 100644
--- a/lib/x509/output.c
+++ b/lib/x509/output.c
@@ -1394,13 +1394,13 @@ print_keyid (gnutls_buffer_st * str, gnutls_x509_crt_t 
cert)
   if (name == NULL)
     return;
 
-  p = _gnutls_key_fingerprint_randomart(buffer, size, name, bits);
+  p = _gnutls_key_fingerprint_randomart(buffer, size, name, bits, "\t\t");
   if (p == NULL)
     return;
   
   adds (str, _("\tPublic key's random art:\n"));
   adds (str, p);
-  adds (str, "\n\n");
+  adds (str, "\n");
 
   gnutls_free(p);
 }
diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c
index 8e42dd4..f0d4738 100644
--- a/lib/x509/privkey.c
+++ b/lib/x509/privkey.c
@@ -360,7 +360,6 @@ decode_dsa_key (const gnutls_datum_t * raw_key, 
gnutls_x509_privkey_t pkey)
       gnutls_assert ();
       goto error;
     }
-  pkey->params.params_nr++;
 
   if ((result = _gnutls_x509_read_int (dsa_asn, "p", &pkey->params.params[0])) 
< 0)
     {
diff --git a/src/certtool.gaa b/src/certtool.gaa
index 7e79102..89d53ea 100644
--- a/src/certtool.gaa
+++ b/src/certtool.gaa
@@ -105,6 +105,8 @@ option (8, pkcs8) { $pkcs8=1 } "Use PKCS #8 format for 
private keys."
 #int dsa;
 option (dsa) { $dsa=1 } "Use DSA keys."
 
+option (rsa) { } "Use RSA keys."
+
 #int ecc;
 option (ecc) { $ecc=1 } "Use ECC (ECDSA) keys."
 
diff --git a/tests/pathlen/ca-no-pathlen.pem b/tests/pathlen/ca-no-pathlen.pem
index 44f70a1..76ec72b 100644
--- a/tests/pathlen/ca-no-pathlen.pem
+++ b/tests/pathlen/ca-no-pathlen.pem
@@ -33,18 +33,17 @@ Other Information:
        Public Key Id:
                f268df0e814c0302ed338e146f57421dba44f06c
        Public key's random art:
-+--[ RSA  512]----+
-|.o..+o...        |
-| ...+o.o         |
-| .o  E=          |
-| .+oo+.o         |
-|.o.o..+ S        |
-|. .    + .       |
-|      o o        |
-|     . . o       |
-|        ..o      |
-+-----------------+
-
+               +--[ RSA  512]----+
+               |.o..+o...        |
+               | ...+o.o         |
+               | .o  E=          |
+               | .+oo+.o         |
+               |.o.o..+ S        |
+               |. .    + .       |
+               |      o o        |
+               |     . . o       |
+               |        ..o      |
+               +-----------------+
 
 -----BEGIN CERTIFICATE-----
 MIIBYDCCAQygAwIBAgIBADALBgkqhkiG9w0BAQUwIjEgMB4GA1UEChMXR251VExT
diff --git a/tests/pathlen/no-ca-or-pathlen.pem 
b/tests/pathlen/no-ca-or-pathlen.pem
index 9545a70..086feb4 100644
--- a/tests/pathlen/no-ca-or-pathlen.pem
+++ b/tests/pathlen/no-ca-or-pathlen.pem
@@ -51,18 +51,17 @@ Other Information:
        Public Key Id:
                1e09d707d4e3651b84dcb6c68a828d2affef7ec3
        Public key's random art:
-+--[ RSA 1024]----+
-|         .oo +.  |
-|         . .= *  |
-|      . . ...* + |
-|       o . .. =  |
-|       +S  . o   |
-|      o.o.. .    |
-|     .  .o       |
-|  . .     E      |
-|   o...++. .     |
-+-----------------+
-
+               +--[ RSA 1024]----+
+               |         .oo +.  |
+               |         . .= *  |
+               |      . . ...* + |
+               |       o . .. =  |
+               |       +S  . o   |
+               |      o.o.. .    |
+               |     .  .o       |
+               |  . .     E      |
+               |   o...++. .     |
+               +-----------------+
 
 -----BEGIN CERTIFICATE-----
 MIIEhDCCA+2gAwIBAgIQLhA3A99GhZ16VQ2mWWGFODANBgkqhkiG9w0BAQQFADCB


hooks/post-receive
-- 
GNU gnutls



reply via email to

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