Commit b30ee0c9 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Avoid link errors with older versions of GnuTLS

* src/gnutls.c (Fgnutls_ciphers, gnutls_symmetric_aead)
(Fgnutls_macs, Fgnutls_digests): Conditionally compile code that
calls GnuTLS functions which might be unavailable in older
versions of GnuTLS.
parent a5c4ffdb
......@@ -1852,6 +1852,7 @@ The alist key is the cipher name. */)
{
Lisp_Object ciphers = Qnil;
#ifdef HAVE_GNUTLS3_CIPHER
const gnutls_cipher_algorithm_t *gciphers = gnutls_cipher_list ();
for (ptrdiff_t pos = 0; gciphers[pos] != GNUTLS_CIPHER_NULL; pos++)
{
......@@ -1877,6 +1878,7 @@ The alist key is the cipher name. */)
ciphers = Fcons (cp, ciphers);
}
#endif
return ciphers;
}
......@@ -2176,6 +2178,7 @@ name. */)
(void)
{
Lisp_Object mac_algorithms = Qnil;
#ifdef HAVE_GNUTLS3_HMAC
const gnutls_mac_algorithm_t *macs = gnutls_mac_list ();
for (ptrdiff_t pos = 0; macs[pos] != 0; pos++)
{
......@@ -2197,6 +2200,7 @@ name. */)
make_number (gnutls_mac_get_nonce_size (gma)));
mac_algorithms = Fcons (mp, mac_algorithms);
}
#endif
return mac_algorithms;
}
......@@ -2210,6 +2214,7 @@ method name. */)
(void)
{
Lisp_Object digest_algorithms = Qnil;
#ifdef HAVE_GNUTLS3_DIGEST
const gnutls_digest_algorithm_t *digests = gnutls_digest_list ();
for (ptrdiff_t pos = 0; digests[pos] != 0; pos++)
{
......@@ -2226,6 +2231,7 @@ method name. */)
digest_algorithms = Fcons (mp, digest_algorithms);
}
#endif
return digest_algorithms;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment