From: Kern Sibbald Date: Wed, 3 Mar 2010 13:34:56 +0000 (+0100) Subject: Fix OpenSSL 1.x problem in crypto.c on Fedora 12 X-Git-Tag: Release-7.0.0~2119 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=011f8610d03ff62a80feb7bf5547846f155ac2d6;p=bacula%2Fbacula Fix OpenSSL 1.x problem in crypto.c on Fedora 12 --- diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 6c478d1faa..fbe2d5fe3a 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -1208,6 +1208,8 @@ fi if test "$support_crypto" = "no"; then OPENSSL_LIBS="" OPENSSL_INC="" +else + AC_CHECK_LIB(ssl, EVP_PKEY_encrypt_old, AC_DEFINE(HAVE_OPENSSLv1, 1, [Set if have OpenSSL version 1.x])) fi AC_MSG_RESULT([$support_tls]) @@ -3289,4 +3291,3 @@ then echo " upgrade it in order to avoid problems with Batch insert mode" echo fi - diff --git a/bacula/src/lib/crypto.c b/bacula/src/lib/crypto.c index 25b1d44a5c..fb52c254b9 100644 --- a/bacula/src/lib/crypto.c +++ b/bacula/src/lib/crypto.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2005-2007 Free Software Foundation Europe e.V. + Copyright (C) 2005-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -30,8 +30,6 @@ * * Author: Landon Fuller * - * Version $Id$ - * * This file was contributed to the Bacula project by Landon Fuller. * * Landon Fuller has been granted a perpetual, worldwide, non-exclusive, @@ -49,6 +47,15 @@ #include "jcr.h" #include +/** + * For OpenSSL version 1.x, EVP_PKEY_encrypt no longer + * exists. It was not an official API. + */ +#ifdef HAVE_OPENSSLv1 +#define EVP_PKEY_encrypt EVP_PKEY_encrypt_old +#define EVP_PKEY_decrypt EVP_PKEY_decrypt_old +#endif + /* * Bacula ASN.1 Syntax * @@ -309,7 +316,7 @@ typedef struct PEM_CB_Context { */ static ASN1_OCTET_STRING *openssl_cert_keyid(X509 *cert) { X509_EXTENSION *ext; - X509V3_EXT_METHOD *method; + const X509V3_EXT_METHOD *method; ASN1_OCTET_STRING *keyid; int i; #if (OPENSSL_VERSION_NUMBER >= 0x0090800FL)