diff options
| author | Lars Ingebrigtsen | 2015-12-29 14:39:53 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2015-12-29 14:39:53 +0100 |
| commit | 1ba1e35fbed820ec9d9e1dafbe150f88f29342d8 (patch) | |
| tree | 4234d6953003b09e584f7fbb754244c800d44cf9 | |
| parent | ad9aaa460e2fa446b08124bd8df846e1471c030b (diff) | |
| download | emacs-1ba1e35fbed820ec9d9e1dafbe150f88f29342d8.tar.gz emacs-1ba1e35fbed820ec9d9e1dafbe150f88f29342d8.zip | |
Refactor out gnutls-trustfiles
* lisp/net/gnutls.el (gnutls-trustfiles): Refactor out for reuse by tls.el.
| -rw-r--r-- | lisp/net/gnutls.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/net/gnutls.el b/lisp/net/gnutls.el index ccaef8aafac..a7321da854c 100644 --- a/lisp/net/gnutls.el +++ b/lisp/net/gnutls.el | |||
| @@ -193,12 +193,7 @@ defaults to GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT." | |||
| 193 | ;; The gnutls library doesn't understand files delivered via | 193 | ;; The gnutls library doesn't understand files delivered via |
| 194 | ;; the special handlers, so ignore all files found via those. | 194 | ;; the special handlers, so ignore all files found via those. |
| 195 | (file-name-handler-alist nil) | 195 | (file-name-handler-alist nil) |
| 196 | (trustfiles (or trustfiles | 196 | (trustfiles (or trustfiles (gnutls-trustfiles))) |
| 197 | (delq nil | ||
| 198 | (mapcar (lambda (f) (and f (file-exists-p f) f)) | ||
| 199 | (if (functionp gnutls-trustfiles) | ||
| 200 | (funcall gnutls-trustfiles) | ||
| 201 | gnutls-trustfiles))))) | ||
| 202 | (priority-string (or priority-string | 197 | (priority-string (or priority-string |
| 203 | (cond | 198 | (cond |
| 204 | ((eq type 'gnutls-anon) | 199 | ((eq type 'gnutls-anon) |
| @@ -251,6 +246,14 @@ defaults to GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT." | |||
| 251 | 246 | ||
| 252 | process)) | 247 | process)) |
| 253 | 248 | ||
| 249 | (defun gnutls-trustfiles () | ||
| 250 | "Return a list of usable trustfiles." | ||
| 251 | (delq nil | ||
| 252 | (mapcar (lambda (f) (and f (file-exists-p f) f)) | ||
| 253 | (if (functionp gnutls-trustfiles) | ||
| 254 | (funcall gnutls-trustfiles) | ||
| 255 | gnutls-trustfiles)))) | ||
| 256 | |||
| 254 | (declare-function gnutls-error-string "gnutls.c" (error)) | 257 | (declare-function gnutls-error-string "gnutls.c" (error)) |
| 255 | 258 | ||
| 256 | (defun gnutls-message-maybe (doit format &rest params) | 259 | (defun gnutls-message-maybe (doit format &rest params) |