diff options
| author | Eli Zaretskii | 2017-07-15 16:54:12 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-07-15 16:54:12 +0300 |
| commit | b30ee0c9225bad6e3fd0b511a6c5d9a64b8fd66a (patch) | |
| tree | 43583bc779dceeb0749b5fe89b914a58d06ddf1e /src | |
| parent | a5c4ffdb6e1fe37c5c060b4a4181e5ee79f71ec6 (diff) | |
| download | emacs-b30ee0c9225bad6e3fd0b511a6c5d9a64b8fd66a.tar.gz emacs-b30ee0c9225bad6e3fd0b511a6c5d9a64b8fd66a.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/gnutls.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gnutls.c b/src/gnutls.c index 5e14a3af333..e6f01a9cfe1 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -1852,6 +1852,7 @@ The alist key is the cipher name. */) | |||
| 1852 | { | 1852 | { |
| 1853 | Lisp_Object ciphers = Qnil; | 1853 | Lisp_Object ciphers = Qnil; |
| 1854 | 1854 | ||
| 1855 | #ifdef HAVE_GNUTLS3_CIPHER | ||
| 1855 | const gnutls_cipher_algorithm_t *gciphers = gnutls_cipher_list (); | 1856 | const gnutls_cipher_algorithm_t *gciphers = gnutls_cipher_list (); |
| 1856 | for (ptrdiff_t pos = 0; gciphers[pos] != GNUTLS_CIPHER_NULL; pos++) | 1857 | for (ptrdiff_t pos = 0; gciphers[pos] != GNUTLS_CIPHER_NULL; pos++) |
| 1857 | { | 1858 | { |
| @@ -1877,6 +1878,7 @@ The alist key is the cipher name. */) | |||
| 1877 | 1878 | ||
| 1878 | ciphers = Fcons (cp, ciphers); | 1879 | ciphers = Fcons (cp, ciphers); |
| 1879 | } | 1880 | } |
| 1881 | #endif | ||
| 1880 | 1882 | ||
| 1881 | return ciphers; | 1883 | return ciphers; |
| 1882 | } | 1884 | } |
| @@ -2176,6 +2178,7 @@ name. */) | |||
| 2176 | (void) | 2178 | (void) |
| 2177 | { | 2179 | { |
| 2178 | Lisp_Object mac_algorithms = Qnil; | 2180 | Lisp_Object mac_algorithms = Qnil; |
| 2181 | #ifdef HAVE_GNUTLS3_HMAC | ||
| 2179 | const gnutls_mac_algorithm_t *macs = gnutls_mac_list (); | 2182 | const gnutls_mac_algorithm_t *macs = gnutls_mac_list (); |
| 2180 | for (ptrdiff_t pos = 0; macs[pos] != 0; pos++) | 2183 | for (ptrdiff_t pos = 0; macs[pos] != 0; pos++) |
| 2181 | { | 2184 | { |
| @@ -2197,6 +2200,7 @@ name. */) | |||
| 2197 | make_number (gnutls_mac_get_nonce_size (gma))); | 2200 | make_number (gnutls_mac_get_nonce_size (gma))); |
| 2198 | mac_algorithms = Fcons (mp, mac_algorithms); | 2201 | mac_algorithms = Fcons (mp, mac_algorithms); |
| 2199 | } | 2202 | } |
| 2203 | #endif | ||
| 2200 | 2204 | ||
| 2201 | return mac_algorithms; | 2205 | return mac_algorithms; |
| 2202 | } | 2206 | } |
| @@ -2210,6 +2214,7 @@ method name. */) | |||
| 2210 | (void) | 2214 | (void) |
| 2211 | { | 2215 | { |
| 2212 | Lisp_Object digest_algorithms = Qnil; | 2216 | Lisp_Object digest_algorithms = Qnil; |
| 2217 | #ifdef HAVE_GNUTLS3_DIGEST | ||
| 2213 | const gnutls_digest_algorithm_t *digests = gnutls_digest_list (); | 2218 | const gnutls_digest_algorithm_t *digests = gnutls_digest_list (); |
| 2214 | for (ptrdiff_t pos = 0; digests[pos] != 0; pos++) | 2219 | for (ptrdiff_t pos = 0; digests[pos] != 0; pos++) |
| 2215 | { | 2220 | { |
| @@ -2226,6 +2231,7 @@ method name. */) | |||
| 2226 | 2231 | ||
| 2227 | digest_algorithms = Fcons (mp, digest_algorithms); | 2232 | digest_algorithms = Fcons (mp, digest_algorithms); |
| 2228 | } | 2233 | } |
| 2234 | #endif | ||
| 2229 | 2235 | ||
| 2230 | return digest_algorithms; | 2236 | return digest_algorithms; |
| 2231 | } | 2237 | } |