aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/net/nsm.el33
1 files changed, 12 insertions, 21 deletions
diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el
index e8fdb9b183b..1ce2ff33ae6 100644
--- a/lisp/net/nsm.el
+++ b/lisp/net/nsm.el
@@ -226,27 +226,18 @@ If `nsm-trust-local-network' is or returns non-nil, and if the
226host address is a localhost address, or in the same subnet as one 226host address is a localhost address, or in the same subnet as one
227of the local interfaces, this function returns nil. Non-nil 227of the local interfaces, this function returns nil. Non-nil
228otherwise." 228otherwise."
229 (let ((addresses (network-lookup-address-info host)) 229 (not (and-let* (((or (and (functionp nsm-trust-local-network)
230 (network-interface-list (network-interface-list t)) 230 (funcall nsm-trust-local-network))
231 (off-net t)) 231 nsm-trust-local-network))
232 (when 232 (addresses (network-lookup-address-info host))
233 (or (and (functionp nsm-trust-local-network) 233 (network-interface-list (network-interface-list t)))
234 (funcall nsm-trust-local-network)) 234 (catch 'nsm-should-check
235 nsm-trust-local-network) 235 (dolist (ip addresses)
236 (mapc 236 (dolist (info network-interface-list)
237 (lambda (ip) 237 (when (nsm-network-same-subnet (substring (nth 1 info) 0 -1)
238 (mapc 238 (substring (nth 3 info) 0 -1)
239 (lambda (info) 239 (substring ip 0 -1))
240 (let ((local-ip (nth 1 info)) 240 (throw 'nsm-should-check t))))))))
241 (mask (nth 3 info)))
242 (when
243 (nsm-network-same-subnet (substring local-ip 0 -1)
244 (substring mask 0 -1)
245 (substring ip 0 -1))
246 (setq off-net nil))))
247 network-interface-list))
248 addresses))
249 off-net))
250 241
251(defun nsm-check-tls-connection (process host port status settings) 242(defun nsm-check-tls-connection (process host port status settings)
252 "Check TLS connection against potential security problems. 243 "Check TLS connection against potential security problems.