aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-tcp-stream-openssl.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-07-31 05:10:04 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-07-31 05:10:04 +0800
commitbc61aea7a3f5ad09cd9a8cb8f51cbefa1a281689 (patch)
treeb06e8eb4ed69541d35c9e5597e3a3d806f339a5d /camel/camel-tcp-stream-openssl.c
parent7e338265be41a232846cad9edc3a7fb8527b7494 (diff)
downloadgsoc2013-evolution-bc61aea7a3f5ad09cd9a8cb8f51cbefa1a281689.tar.gz
gsoc2013-evolution-bc61aea7a3f5ad09cd9a8cb8f51cbefa1a281689.tar.zst
gsoc2013-evolution-bc61aea7a3f5ad09cd9a8cb8f51cbefa1a281689.zip
X509_digest() needs a pointer to an int len. Also fixed some other
2002-07-30 Jeffrey Stedfast <fejj@ximian.com> * camel-tcp-stream-openssl.c (ssl_verify): X509_digest() needs a pointer to an int len. Also fixed some other compiler errors. * camel-certdb.h: #include <stdio.h> svn path=/trunk/; revision=17647
Diffstat (limited to 'camel/camel-tcp-stream-openssl.c')
-rw-r--r--camel/camel-tcp-stream-openssl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/camel/camel-tcp-stream-openssl.c b/camel/camel-tcp-stream-openssl.c
index e9880f3507..06d1a93c5a 100644
--- a/camel/camel-tcp-stream-openssl.c
+++ b/camel/camel-tcp-stream-openssl.c
@@ -42,6 +42,7 @@
#include "camel-session.h"
#include "camel-service.h"
#include "camel-operation.h"
+#include "camel-certdb.h"
#ifdef ENABLE_THREADS
#include <pthread.h>
#endif
@@ -621,10 +622,10 @@ ssl_verify (int ok, X509_STORE_CTX *ctx)
CamelCertDB *certdb = NULL;
CamelCert *ccert = NULL;
char *prompt, *cert_str;
+ int err, md5len, i;
char buf[257];
X509 *cert;
SSL *ssl;
- int i, err;
if (ok)
return TRUE;
@@ -641,7 +642,8 @@ ssl_verify (int ok, X509_STORE_CTX *ctx)
err = X509_STORE_CTX_get_error (ctx);
/* calculate the MD5 hash of the raw certificate */
- X509_digest (cert, EVP_md5 (), md5sum, sizeof (md5sum));
+ md5len = sizeof (md5sum);
+ X509_digest (cert, EVP_md5 (), md5sum, &md5len);
for (i = 0, f = fingerprint; i < 16; i++, f += 3)
sprintf (f, "%.2x%c", md5sum[i], i != 15 ? ':' : '\0');
@@ -652,11 +654,11 @@ ssl_verify (int ok, X509_STORE_CTX *ctx)
ccert = camel_certdb_get_cert (certdb, fingerprint);
if (ccert) {
if (ccert->trust != CAMEL_CERT_TRUST_UNKNOWN) {
- accept = ccert->trust != CAMEL_CERT_TRUST_NEVER;
+ ok = ccert->trust != CAMEL_CERT_TRUST_NEVER;
camel_certdb_cert_unref (certdb, ccert);
camel_object_unref (certdb);
- return accept;
+ return ok;
}
} else {
/* create a new camel-cert */