mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-12 01:26:48 +08:00
Added check for nettle < 3.0
This commit is contained in:
@@ -50,6 +50,11 @@ AC_CHECK_LIB(gnutls, gnutls_pkcs11_reinit, [
|
||||
AC_DEFINE([HAVE_PKCS11], [], [PKCS11 detected in gnutls])
|
||||
])
|
||||
|
||||
if ! $PKG_CONFIG --atleast-version=3.0 nettle; then
|
||||
AC_DEFINE([NETTLE_OLD_BASE64_API], [1],
|
||||
[nettle uses the pre-3.x base64 API])
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(protobuf,
|
||||
AS_HELP_STRING([--without-protobuf], [use the included protobuf library]),
|
||||
test_for_protobuf=$withval,
|
||||
|
||||
@@ -44,7 +44,17 @@ oc_base64_decode(const uint8_t *src, unsigned src_length,
|
||||
|
||||
base64_decode_init(&ctx);
|
||||
|
||||
#ifdef NETTLE_OLD_BASE64_API
|
||||
{
|
||||
unsigned int len = *dst_length;
|
||||
ret = base64_decode_update(&ctx, &len, dst, src_length, src);
|
||||
if (ret != 0)
|
||||
*dst_length = len;
|
||||
}
|
||||
#else
|
||||
ret = base64_decode_update(&ctx, dst_length, dst, src_length, src);
|
||||
#endif
|
||||
|
||||
if (ret == 0)
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user