Hello

I am using exim 4.66 on FreeBSD 6.2 using the exim port from the FreeBSD ports system (that's why I'm CCing the ports maintainer krion, too). Today I updated my version of openssl to the recently released new version 0.9.8e and in turn wanted to recompile exim so it links to the correct version of the library. However, compilation of tls-openssl.c fails due to a compiler error saying "Negation of invalid type" or something like that. The line where things go wrong is 346, where you call SSL_CTX_set_info_callback(...) in an if conditional.

I did some research and found the problem for you: According to OpenSSL documentation this function does not return any value (i.e. it returns void) [1]. Of course if(!void) does not make any sense, so there is your compiler error. Now why did that problem not occur in the past? According to all sources I found this function was always supposed to return void. Here a look into the CVS of OpenSSL helps. On Nov 29, 2006 checkin 15689 changed macro definitions of a bunch of simple functions to real C functions [2]. Among them SSL_CTX_set_info_callback. If you look at the diff [3] you can quickly see why things worked before. The function was simply a macro expanding to some assignment, which is not of type void. So that is why it worked before although it shouldn't have.

So to fix this problem you simply remove the if conditional checking for an error. There is no diagnostic information returned according to the documentation and so we can't check for any error (simple, huh?). I attached a trivial patch doing exactly that. It worked for me, now it compiles just fine and runs as expected.

I hope this helps,
Alexander Wittig


[1]: http://www.openssl.org/docs/ssl/SSL_CTX_set_info_callback.html
[2]: http://cvs.openssl.org/chngview?cn=15689
[3]: http://cvs.openssl.org/filediff?f=openssl/ssl/ssl.h&v1=1.186&v2=1.187

--- /usr/ports/mail/exim/work/exim-4.66/src/tls-openssl.c       Mon Jan  8 
15:25:37 2007
+++ tls-openssl.c       Sat Mar  3 22:53:53 2007
@@ -343,8 +343,8 @@
 /* Set up the information callback, which outputs if debugging is at a suitable
 level. */
 
-if (!(SSL_CTX_set_info_callback(ctx, (void (*)())info_callback)))
-  return tls_error(US"SSL_CTX_set_info_callback", host);
+/* This function returns no diagnostic information! */
+SSL_CTX_set_info_callback(ctx, (void (*)())info_callback);
 
 /* The following patch was supplied by Robert Roselius */
 
-- 
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details 
at http://www.exim.org/ ##

Reply via email to