aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog7
-rw-r--r--camel/camel-certdb.h1
-rw-r--r--camel/camel-tcp-stream-openssl.c10
3 files changed, 14 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index e17722a7c5..4e91482c38 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,12 @@
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>
+
+2002-07-30 Jeffrey Stedfast <fejj@ximian.com>
+
* camel-certdb.c: New source file implementing a very basic
certificate database. This is mostly just here because the Mozilla
NSS certdb seems to not be working for everyone's Evolution
diff --git a/camel/camel-certdb.h b/camel/camel-certdb.h
index 31e34e992c..3d592a23b4 100644
--- a/camel/camel-certdb.h
+++ b/camel/camel-certdb.h
@@ -29,6 +29,7 @@ extern "C" {
#pragma }
#endif /* __cplusplus */
+#include <stdio.h>
#include <camel/camel-object.h>
#define CAMEL_CERTDB_TYPE (camel_certdb_get_type ())
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 */