changeset 19492:447470c8111a

- More TODO whacking - Added errorchecking to x509_sha1sum
author William Ehlhardt <williamehlhardt@gmail.com>
date Mon, 20 Aug 2007 03:10:21 +0000
parents 4f472eef762c
children e147c3a821dd
files libpurple/plugins/ssl/ssl-gnutls.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/ssl/ssl-gnutls.c	Mon Aug 20 03:00:31 2007 +0000
+++ b/libpurple/plugins/ssl/ssl-gnutls.c	Mon Aug 20 03:10:21 2007 +0000
@@ -609,7 +609,6 @@
 static void
 x509_destroy_certificate(PurpleCertificate * crt)
 {
-	/* TODO: Issue a warning here? */
 	if (NULL == crt) return;
 
 	/* Check that the scheme is x509_gnutls */
@@ -621,7 +620,6 @@
 		return;
 	}
 
-	/* TODO: Different error checking? */
 	g_return_if_fail(crt->data != NULL);
 	g_return_if_fail(crt->scheme != NULL);
 
@@ -650,7 +648,6 @@
 	unsigned int verify; /* used to store result from GnuTLS verifier */
 	int ret;
 	
-	/* TODO: Change this error checking? */
 	g_return_val_if_fail(crt, FALSE);
 	g_return_val_if_fail(issuer, FALSE);
 
@@ -742,9 +739,10 @@
 	crt_dat = X509_GET_GNUTLS_DATA(crt);
 
 	/* Extract the fingerprint */
-	/* TODO: Errorcheck? */
-	gnutls_x509_crt_get_fingerprint(crt_dat, GNUTLS_MAC_SHA,
-					hashbuf, &tmpsz);
+	g_return_val_if_fail(
+		0 == gnutls_x509_crt_get_fingerprint(crt_dat, GNUTLS_MAC_SHA,
+						     hashbuf, &tmpsz),
+		NULL);
 
 	/* This shouldn't happen */
 	g_return_val_if_fail(tmpsz == hashlen, NULL);