From aba52fa878de9c038ff51e1d6d106aecd3898c92 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Sun, 27 May 2012 22:35:14 +0200 Subject: [PATCH] Fix compilation with old NSS (no GetVersion). --- configure.in | 6 ++++++ lib/crypto_backend/crypto_nss.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/configure.in b/configure.in index f6ceb86..7bda32b 100644 --- a/configure.in +++ b/configure.in @@ -140,6 +140,12 @@ AC_DEFUN([CONFIGURE_NSS], [ PKG_CHECK_MODULES([NSS], [nss],, AC_MSG_ERROR([You need nss library.])) + + saved_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $NSS_CFLAGS" + AC_CHECK_DECLS([NSS_GetVersion], [], [], [#include ]) + CFLAGS=$saved_CFLAGS + CRYPTO_CFLAGS=$NSS_CFLAGS CRYPTO_LIBS=$NSS_LIBS NO_FIPS([]) diff --git a/lib/crypto_backend/crypto_nss.c b/lib/crypto_backend/crypto_nss.c index bc81973..a4a5b08 100644 --- a/lib/crypto_backend/crypto_nss.c +++ b/lib/crypto_backend/crypto_nss.c @@ -76,7 +76,11 @@ int crypt_backend_init(struct crypt_device *ctx) if (NSS_NoDB_Init(".") != SECSuccess) return -EINVAL; +#if HAVE_DECL_NSS_GETVERSION snprintf(version, 64, "NSS %s", NSS_GetVersion()); +#else + snprintf(version, 64, "NSS"); +#endif crypto_backend_initialised = 1; return 0; } -- 2.7.4