bareos2015: bareos-12.4 f2579d08

Author Committer Branch Timestamp Parent
Andre Noll mvwieringen bareos-12.4 2013-11-13 18:27 bareos-12.4 3957c968 Pending
Changeset Fix compilation on RHEL4.

These (very old) systems ship with openssl-0.9.7a which
defines EVP_MAX_MD_SIZE to 36, a smaller constant than bareos'
CRYPTO_DIGEST_MAX_SIZE (64). This mismatch results in the following
error on attempt to compile crypto_openssl.c:

    crypto_openssl.c:58:2: #error "EVP_MAX_MD_SIZE != CRYPTO_DIGEST_MAX_SIZE, please update src/lib/crypto.h"

The purpose of the preprocessor sanity check that causes this error is
to make sure that various arrays of length CRYPTO_DIGEST_MAX_SIZE are
large enough for all message digests. So all we actually need to check
for is that EVP_MAX_MD_SIZE is no larger than CRYPTO_DIGEST_MAX_SIZE.

Weakening the condition of the above check from "!=" to ">" turned
out to be enough to compile bareos on Red Hat Enterprise Linux 4
(using --client-only though). The resulting executable worked with
no problems.

This patch also adds a comment that explains the purpose of the check.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
mod - src/lib/crypto.c Diff File