diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/gnutls.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/gnutls.c b/src/gnutls.c index 5717b3075c1..deffbd4b053 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -449,7 +449,7 @@ w32_gnutls_rnd (gnutls_rnd_level_t level, void *data, size_t len) | |||
| 449 | return gnutls_rnd (level, data, len); | 449 | return gnutls_rnd (level, data, len); |
| 450 | } | 450 | } |
| 451 | 451 | ||
| 452 | #endif | 452 | #endif /* WINDOWSNT */ |
| 453 | 453 | ||
| 454 | 454 | ||
| 455 | /* Report memory exhaustion if ERR is an out-of-memory indication. */ | 455 | /* Report memory exhaustion if ERR is an out-of-memory indication. */ |
| @@ -549,7 +549,7 @@ emacs_gnutls_nonblock_errno (gnutls_transport_ptr_t ptr) | |||
| 549 | return err; | 549 | return err; |
| 550 | } | 550 | } |
| 551 | } | 551 | } |
| 552 | #endif | 552 | #endif /* !WINDOWSNT */ |
| 553 | 553 | ||
| 554 | static int | 554 | static int |
| 555 | emacs_gnutls_handshake (struct Lisp_Process *proc) | 555 | emacs_gnutls_handshake (struct Lisp_Process *proc) |
| @@ -2359,7 +2359,7 @@ the number itself. */) | |||
| 2359 | return digest; | 2359 | return digest; |
| 2360 | } | 2360 | } |
| 2361 | 2361 | ||
| 2362 | #endif | 2362 | #endif /* HAVE_GNUTLS3 */ |
| 2363 | 2363 | ||
| 2364 | DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0, | 2364 | DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0, |
| 2365 | doc: /* Return list of capabilities if GnuTLS is available in this instance of Emacs. | 2365 | doc: /* Return list of capabilities if GnuTLS is available in this instance of Emacs. |
| @@ -2372,20 +2372,6 @@ GnuTLS symmetric ciphers: the list will contain `ciphers'. | |||
| 2372 | GnuTLS AEAD ciphers : the list will contain `AEAD-ciphers'. */) | 2372 | GnuTLS AEAD ciphers : the list will contain `AEAD-ciphers'. */) |
| 2373 | (void) | 2373 | (void) |
| 2374 | { | 2374 | { |
| 2375 | #ifdef WINDOWSNT | ||
| 2376 | Lisp_Object found = Fassq (Qgnutls, Vlibrary_cache); | ||
| 2377 | if (CONSP (found)) | ||
| 2378 | return XCDR (found); /* TODO: use capabilities. */ | ||
| 2379 | else | ||
| 2380 | { | ||
| 2381 | Lisp_Object status; | ||
| 2382 | /* TODO: should the capabilities be dynamic here? */ | ||
| 2383 | status = init_gnutls_functions () ? capabilities : Qnil; | ||
| 2384 | Vlibrary_cache = Fcons (Fcons (Qgnutls, status), Vlibrary_cache); | ||
| 2385 | return status; | ||
| 2386 | } | ||
| 2387 | #else | ||
| 2388 | |||
| 2389 | Lisp_Object capabilities = Qnil; | 2375 | Lisp_Object capabilities = Qnil; |
| 2390 | 2376 | ||
| 2391 | # ifdef HAVE_GNUTLS3 | 2377 | # ifdef HAVE_GNUTLS3 |
| @@ -2405,10 +2391,24 @@ GnuTLS AEAD ciphers : the list will contain `AEAD-ciphers'. */) | |||
| 2405 | # ifdef HAVE_GNUTLS3_HMAC | 2391 | # ifdef HAVE_GNUTLS3_HMAC |
| 2406 | capabilities = Fcons (intern("macs"), capabilities); | 2392 | capabilities = Fcons (intern("macs"), capabilities); |
| 2407 | # endif | 2393 | # endif |
| 2408 | # endif | 2394 | # endif /* HAVE_GNUTLS3_CIPHER */ |
| 2409 | # endif | 2395 | # endif /* HAVE_GNUTLS3 */ |
| 2396 | |||
| 2397 | #ifdef WINDOWSNT | ||
| 2398 | Lisp_Object found = Fassq (Qgnutls, Vlibrary_cache); | ||
| 2399 | if (CONSP (found)) | ||
| 2400 | return XCDR (found); | ||
| 2401 | else | ||
| 2402 | { | ||
| 2403 | Lisp_Object status; | ||
| 2404 | status = init_gnutls_functions () ? capabilities : Qnil; | ||
| 2405 | Vlibrary_cache = Fcons (Fcons (Qgnutls, status), Vlibrary_cache); | ||
| 2406 | return status; | ||
| 2407 | } | ||
| 2408 | #else /* !WINDOWSNT */ | ||
| 2410 | 2409 | ||
| 2411 | return capabilities; | 2410 | return capabilities; |
| 2411 | |||
| 2412 | #endif | 2412 | #endif |
| 2413 | } | 2413 | } |
| 2414 | 2414 | ||