On Fri, 6 Mar 2009, Davide Libenzi wrote:

> On Fri, 6 Mar 2009, David Lord wrote:
> 
> > 
> > Problem compiling xmail on NetBSD-5_BETA
> > 
> > Hi
> > 
> > I've tried compile of various versions of xmail and all give
> > this error on NetBSD-5_BETA although binaries from earlier 
> > NetBSD 3.1 and 4.0 appeared to be running ok after upgrade
> > to NetBSD-5.
> > 
> > 
> > SSLBind.cpp: In function 'int BSslBindClient(BSOCK_HANDLE_struct*, 
> >       const SslServerBind*, int (*)(void*, int, const void*), 
> > void*)':
> > SSLBind.cpp:462: error: invalid conversion from 'const SSL_METHOD*' 
> >       to 'SSL_METHOD*'
> > SSLBind.cpp: In function 'int BSslBindServer(BSOCK_HANDLE_struct*,
> >       const SslServerBind*, int (*)(void*, int, const void*), 
> > void*)':
> > SSLBind.cpp:536: error: invalid conversion from 'const SSL_METHOD*' 
> >       to 'SSL_METHOD*'
> > gmake: *** [SSLBind.o] Error 1
> > 
> > 
> > Any ideas as to a fix.
> 
> OpenSSL changed the prototype. Try to replace the lines 456 and 530 from 
> this:
> 
> SSL_METHOD *pMethod;
> 
> to this:
> 
> SSL_METHOD const *pMethod;

Oh, but they did not change the SSL_CTX_new() proto :/ (at least in my 
Debian Lenny box).
Try the attached patch instead ...



- Davide

diff --git a/SSLBind.cpp b/SSLBind.cpp
index 2133274..6f173d5 100644
--- a/SSLBind.cpp
+++ b/SSLBind.cpp
@@ -453,14 +453,14 @@ int BSslBindClient(BSOCK_HANDLE hBSock, SslServerBind const *pSSLB,
 {
 	int iError;
 	SYS_SOCKET SockFD;
-	SSL_METHOD *pMethod;
+	SSL_METHOD const *pMethod;
 	SSL_CTX *pSCtx;
 	SSL *pSSL;
 	X509 *pCert;
 	SslBindCtx *pCtx;
 
 	pMethod = SSLv23_client_method();
-	if ((pSCtx = SSL_CTX_new(pMethod)) == NULL) {
+	if ((pSCtx = SSL_CTX_new((SSL_METHOD *) pMethod)) == NULL) {
 		ErrSetErrorCode(ERR_SSLCTX_CREATE);
 		return ERR_SSLCTX_CREATE;
 	}
@@ -527,14 +527,14 @@ int BSslBindServer(BSOCK_HANDLE hBSock, SslServerBind const *pSSLB,
 {
 	int iError;
 	SYS_SOCKET SockFD;
-	SSL_METHOD *pMethod;
+	SSL_METHOD const *pMethod;
 	SSL_CTX *pSCtx;
 	SSL *pSSL;
 	X509 *pCert;
 	SslBindCtx *pCtx;
 
 	pMethod = SSLv23_server_method();
-	if ((pSCtx = SSL_CTX_new(pMethod)) == NULL) {
+	if ((pSCtx = SSL_CTX_new((SSL_METHOD *) pMethod)) == NULL) {
 		ErrSetErrorCode(ERR_SSLCTX_CREATE);
 		return ERR_SSLCTX_CREATE;
 	}
_______________________________________________
xmail mailing list
[email protected]
http://xmailserver.org/mailman/listinfo/xmail

Reply via email to