summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2003-11-25 21:19:27 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2003-11-25 21:19:27 +0000
commita106e44804d0b5122ae26ccf5a002c6a586c87e2 (patch)
tree03383620cd946fc872c0dfe7bffa99d6a7bc5aeb
parentd0debf75b22693bcda65ab13c8406f0c9f30f324 (diff)
downloadgnutls-a106e44804d0b5122ae26ccf5a002c6a586c87e2.tar.gz
ensure that the leading zero is there on RSA keys.
-rw-r--r--lib/x509/common.c2
-rw-r--r--lib/x509/privkey.c22
2 files changed, 12 insertions, 12 deletions
diff --git a/lib/x509/common.c b/lib/x509/common.c
index f719670e77..7af2a068f0 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -53,7 +53,7 @@ static const oid2string _oid2str[] = {
{"2.5.4.5", "serialNumber", 0, 1},
{"2.5.4.20", "telephoneNumber", 0, 1},
- {"0.9.2342.19200300.100.1.25", "DC", 0, 1}, /* FIXME: CHOICE? */
+ {"0.9.2342.19200300.100.1.25", "DC", 0, 1},
{"0.9.2342.19200300.100.1.1", "UID", 0, 1}, /* FIXME: CHOICE? */
{"1.2.840.113549.1.9.1", "EMAIL", 0, 1},
{"1.2.840.113549.1.9.7", NULL, 1, 1},
diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c
index 00c4452538..e2cf819beb 100644
--- a/lib/x509/privkey.c
+++ b/lib/x509/privkey.c
@@ -636,7 +636,7 @@ static int _encode_rsa( ASN1_TYPE* c2, GNUTLS_MPI* params)
/* Read all the sizes */
total = 0;
for (i=0;i<6;i++) {
- _gnutls_mpi_print( NULL, &size[i], params[i]);
+ _gnutls_mpi_print_lz( NULL, &size[i], params[i]);
total += size[i];
}
@@ -678,10 +678,10 @@ static int _encode_rsa( ASN1_TYPE* c2, GNUTLS_MPI* params)
/* calculate exp's size */
- _gnutls_mpi_print( NULL, &size[6], exp1);
+ _gnutls_mpi_print_lz( NULL, &size[6], exp1);
total += size[6];
- _gnutls_mpi_print( NULL, &size[7], exp2);
+ _gnutls_mpi_print_lz( NULL, &size[7], exp2);
total += size[7];
/* Encoding phase.
@@ -703,14 +703,14 @@ static int _encode_rsa( ASN1_TYPE* c2, GNUTLS_MPI* params)
exp1_data = &all_data[size[5]];
exp2_data = &all_data[size[6]];
- _gnutls_mpi_print( m_data, &tmp_size, params[0]);
- _gnutls_mpi_print( pube_data, &tmp_size, params[1]);
- _gnutls_mpi_print( prie_data, &tmp_size, params[2]);
- _gnutls_mpi_print( p1_data, &tmp_size, params[3]);
- _gnutls_mpi_print( p2_data, &tmp_size, params[4]);
- _gnutls_mpi_print( u_data, &tmp_size, params[5]);
- _gnutls_mpi_print( exp1_data, &tmp_size, exp1);
- _gnutls_mpi_print( exp2_data, &tmp_size, exp2);
+ _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);
/* Ok. Now we have the data. Create the asn1 structures
*/