summaryrefslogtreecommitdiff
path: root/gcr/gcr-fingerprint.c
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2011-11-17 15:26:55 +0100
committerStef Walter <stefw@collabora.co.uk>2011-11-21 10:28:27 +0100
commitf3b9d46c75675e9b4b451164dd32ed9b1af0dfb1 (patch)
tree5b66cf37d54e3b447e3087cc27b03eeb7ae332f7 /gcr/gcr-fingerprint.c
parent97cd79171dfbba24394f070f3946b20c2d518d2d (diff)
downloadgcr-f3b9d46c75675e9b4b451164dd32ed9b1af0dfb1.tar.gz
Add valgrind memory checking and fix up errors
* This is especially necessary after migrating to EggBytes since it's reference counted and an easy sourc of memory leaks * Remove threading from testing framework, as gcr isn't threadsafe in all parts. * Fix bugs discovered in memory checking. * Fix up some of the testing stuff.
Diffstat (limited to 'gcr/gcr-fingerprint.c')
-rw-r--r--gcr/gcr-fingerprint.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcr/gcr-fingerprint.c b/gcr/gcr-fingerprint.c
index c84b977..815ee59 100644
--- a/gcr/gcr-fingerprint.c
+++ b/gcr/gcr-fingerprint.c
@@ -167,7 +167,7 @@ dsa_subject_public_key_from_private (GNode *key_asn, GckAttribute *ap,
g_return_val_if_fail (my, FALSE);
gcry_mpi_powm (my, mg, mx, mp);
- gcry = gcry_mpi_aprint (GCRYMPI_FMT_STD, &buffer, &n_buffer, my);
+ gcry = gcry_mpi_aprint (GCRYMPI_FMT_USG, &buffer, &n_buffer, my);
g_return_val_if_fail (gcry == 0, FALSE);
egg_asn1x_take_integer_as_raw (key_asn, egg_bytes_new_with_free_func (buffer, n_buffer,
gcry_free, buffer));
@@ -243,8 +243,8 @@ dsa_subject_public_key_from_attributes (GckAttributes *attrs,
params = egg_asn1x_encode (params_asn, NULL);
egg_asn1x_destroy (params_asn);
- egg_asn1x_take_bits_as_raw (egg_asn1x_node (info_asn, "subjectPublicKey", NULL),
- key, egg_bytes_get_size (key) * 8);
+ egg_asn1x_set_bits_as_raw (egg_asn1x_node (info_asn, "subjectPublicKey", NULL),
+ key, egg_bytes_get_size (key) * 8);
egg_asn1x_set_raw_element (egg_asn1x_node (info_asn, "algorithm", "parameters", NULL), params);
egg_asn1x_set_oid_as_quark (egg_asn1x_node (info_asn, "algorithm", "algorithm", NULL), GCR_OID_PKIX1_DSA);
@@ -315,6 +315,7 @@ fingerprint_from_cert_value (EggBytes *der_data,
checksum_type,
n_fingerprint);
+ egg_bytes_unref (info);
egg_asn1x_destroy (cert_asn);
return fingerprint;
}