summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2003-12-18 14:19:46 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2003-12-18 14:19:46 +0000
commita1b13eb2d10a327708bd48c375af7a2045f04e12 (patch)
tree705e07c2c085b9d0cacd03a407b712296945d199
parenta54d28c184407b2c3f39297c5f4e18e1169c3b83 (diff)
downloadgnutls-a1b13eb2d10a327708bd48c375af7a2045f04e12.tar.gz
Corrected a bug in the RSA key generation. This was
generating unusable RSA keys.
-rw-r--r--NEWS4
-rw-r--r--configure.in2
-rw-r--r--lib/x509/privkey.c41
3 files changed, 26 insertions, 21 deletions
diff --git a/NEWS b/NEWS
index 1408db8676..c223b727da 100644
--- 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.
diff --git a/configure.in b/configure.in
index e894a0dd1e..78e8cf546d 100644
--- a/configure.in
+++ b/configure.in
@@ -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])
diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c
index 7cc0097e85..b1dbeec086 100644
--- a/lib/x509/privkey.c
+++ b/lib/x509/privkey.c
@@ -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
*/