]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Corrected a bug in the RSA key generation. This was
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 18 Dec 2003 14:19:46 +0000 (14:19 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 18 Dec 2003 14:19:46 +0000 (14:19 +0000)
generating unusable RSA keys.

NEWS
configure.in
lib/x509/privkey.c

diff --git a/NEWS b/NEWS
index 1408db867605b3d19c674e410242a119f174ee8c..c223b727da45066ca9680ffdd7f2c49218f6227c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Version 1.0.2 (18/12/2003)
+- Corrected a bug in the RSA key generation. This was
+  generating unusable RSA keys.
+
 Version 1.0.1 (10/12/2003)
 - Some minor fixes in the makefiles. They now include CFLAGS
   from libgcrypt or opencdk if installed in a non standard directory.
index e894a0dd1ed4a9ece2d59859f59387cc0fb53a06..78e8cf546db42a42d3ea175075eb1bfbcfebc76f 100644 (file)
@@ -12,7 +12,7 @@ AC_DEFINE_UNQUOTED(T_OS, "$target_os", [OS name])
 dnl Gnutls Version
 GNUTLS_MAJOR_VERSION=1
 GNUTLS_MINOR_VERSION=0
-GNUTLS_MICRO_VERSION=1
+GNUTLS_MICRO_VERSION=2
 GNUTLS_VERSION=$GNUTLS_MAJOR_VERSION.$GNUTLS_MINOR_VERSION.$GNUTLS_MICRO_VERSION
 
 AC_DEFINE_UNQUOTED(GNUTLS_VERSION, "$GNUTLS_VERSION", [version of gnutls])
index 7cc0097e85a82184bd71f9024e80bbf221ffe2a0..b1dbeec0869679f9f1b516d726826dbf57571d0b 100644 (file)
@@ -628,10 +628,10 @@ int gnutls_x509_privkey_export_rsa_raw(gnutls_x509_privkey key,
 static int _encode_rsa( ASN1_TYPE* c2, GNUTLS_MPI* params)
 {
        int result, i;
-       size_t size[8], total, tmp_size;
+       size_t size[8], total;
        opaque * m_data, *pube_data, *prie_data;
        opaque* p1_data, *p2_data, *u_data, *exp1_data, *exp2_data;
-       opaque * all_data = NULL;
+       opaque * all_data = NULL, *p;
        GNUTLS_MPI exp1 = NULL, exp2 = NULL, q1 = NULL, p1 = NULL;
        opaque null = '\0';
 
@@ -695,24 +695,25 @@ static int _encode_rsa( ASN1_TYPE* c2, GNUTLS_MPI* params)
                result = GNUTLS_E_MEMORY_ERROR;
                goto cleanup;
        }
-       
-       m_data = &all_data[0];
-       pube_data = &all_data[size[0]];
-       prie_data = &all_data[size[1]];
-       p1_data = &all_data[size[2]];
-       p2_data = &all_data[size[3]];
-       u_data = &all_data[size[4]];
-       exp1_data = &all_data[size[5]];
-       exp2_data = &all_data[size[6]];
-
-       _gnutls_mpi_print_lz( m_data, &tmp_size, params[0]);
-       _gnutls_mpi_print_lz( pube_data, &tmp_size, params[1]);
-       _gnutls_mpi_print_lz( prie_data, &tmp_size, params[2]);
-       _gnutls_mpi_print_lz( p1_data, &tmp_size, params[3]);
-       _gnutls_mpi_print_lz( p2_data, &tmp_size, params[4]);
-       _gnutls_mpi_print_lz( u_data, &tmp_size, params[5]);
-       _gnutls_mpi_print_lz( exp1_data, &tmp_size, exp1);
-       _gnutls_mpi_print_lz( exp2_data, &tmp_size, exp2);
+
+       p = all_data;
+       m_data = p; p+= size[0];
+       pube_data = p; p+= size[1];
+       prie_data = p; p+= size[2];
+       p1_data = p; p+= size[3];
+       p2_data = p; p+= size[4];
+       u_data = p; p+= size[5];
+       exp1_data = p; p+= size[6];
+        exp2_data = p;
+
+       _gnutls_mpi_print_lz( m_data, &size[0], params[0]);
+       _gnutls_mpi_print_lz( pube_data, &size[1], params[1]);
+       _gnutls_mpi_print_lz( prie_data, &size[2], params[2]);
+       _gnutls_mpi_print_lz( p1_data, &size[3], params[3]);
+       _gnutls_mpi_print_lz( p2_data, &size[4], params[4]);
+       _gnutls_mpi_print_lz( u_data, &size[5], params[5]);
+       _gnutls_mpi_print_lz( exp1_data, &size[6], exp1);
+       _gnutls_mpi_print_lz( exp2_data, &size[7], exp2);
 
        /* Ok. Now we have the data. Create the asn1 structures
         */