Hello,

I don't know if this patch has been posted before in the bacula-devel
mailing list and maybe rejected; if that's the case, sorry for that.
It has been in the Fedora package for quite a while, the author is
"Enrico Scholz" in the changelog.

The current src/lib/crypto.c code checks for version 1 of the OpenSSL
library by implementing an ifdef as follows:

#ifdef HAVE_OPENSSLv1

It should be implemented as the internal OpenSSL numbering which also
addresses future versions and changes:

#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)

Google returns lots of examples regarding OpenSSL version checking and
library changes. Most of the Open Source projects check for OpenSSL
versions this way.

http://www.google.ch/search?q=OPENSSL_VERSION_NUMBER+0x10000000L

Attached is a patch that changes the ifdef code.

Thanks,
--Simone




-- 
You cannot discover new oceans unless you have the courage to lose
sight of the shore (R. W. Emerson).
diff -up bacula-5.0.2/bacula-5.0.2/src/lib/crypto.c.openssl bacula-5.0.2/bacula-5.0.2/src/lib/crypto.c
--- bacula-5.0.2/bacula-5.0.2/src/lib/crypto.c.openssl	2010-04-27 21:58:29.000000000 +0200
+++ bacula-5.0.2/bacula-5.0.2/src/lib/crypto.c	2010-06-01 17:51:52.846894465 +0200
@@ -51,7 +51,7 @@
  * For OpenSSL version 1.x, EVP_PKEY_encrypt no longer
  *  exists.  It was not an official API.
  */
-#ifdef HAVE_OPENSSLv1
+#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
 #define EVP_PKEY_encrypt EVP_PKEY_encrypt_old
 #define EVP_PKEY_decrypt EVP_PKEY_decrypt_old
 #endif
diff -up bacula-5.0.2/bacula-5.0.2/src/lib/tls.c.openssl bacula-5.0.2/bacula-5.0.2/src/lib/tls.c
--- bacula-5.0.2/bacula-5.0.2/src/lib/tls.c.openssl	2010-04-27 21:58:29.000000000 +0200
+++ bacula-5.0.2/bacula-5.0.2/src/lib/tls.c	2010-06-01 17:52:15.535769446 +0200
@@ -315,7 +315,7 @@ bool tls_postconnect_verify_host(JCR *jc
          extname = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ext)));
 
          if (strcmp(extname, "subjectAltName") == 0) {
-#ifdef HAVE_OPENSSLv1
+#if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
             const X509V3_EXT_METHOD *method;
 #else
             X509V3_EXT_METHOD *method;
------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to