1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-16 09:50:25 +00:00
Commit Graph

79 Commits

Author SHA1 Message Date
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Stefan Kangas
104e90d936 Prefer locate-user-emacs-file
* lisp/cmuscheme.el (scheme-start-file):
* lisp/erc/erc.el (erc-startup-file-list):
* lisp/net/nsm.el (nsm-settings-file):
* lisp/net/tramp-crypt.el (tramp-crypt-config-file-name):
* lisp/org/org-clock.el (org-clock-persist-file):
* lisp/org/org-id.el (org-id-locations-file)
* lisp/shell.el (shell): Prefer 'locate-user-emacs-file' to fiddling
with 'user-emacs-directory' directly.
2021-11-09 07:51:27 +01:00
Stefan Kangas
63f419f133 ; Minor stylistic fixes found by checkdoc 2021-09-16 19:37:07 +02:00
Stefan Kangas
8b07994e20 Convert many more links to use HTTPS 2021-03-24 10:20:18 +01:00
Robert Pluim
6dc4fc7d62 Fix nsm-should-check for "google.com" failure
* lisp/net/nsm.el (nsm-should-check): Extract the mask from
'network-interface-list' rather than the broadcast
address (Bug#45798).
2021-01-12 18:53:48 +01:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Glenn Morris
726eb835dd Merge from origin/emacs-27
78eacf31e8 ; Fix many typos in symbols in docs and comments
d5d12707d6 * doc/misc/flymake.texi (Using Flymake): Fix a typo.  (Bug...

# Conflicts:
#	lisp/allout.el
#	lisp/progmodes/ebrowse.el
2020-10-02 09:38:24 -07:00
Stefan Kangas
78eacf31e8 ; Fix many typos in symbols in docs and comments 2020-10-02 13:29:45 +02:00
João Távora
43fded12d5 Add lisp-data-mode for editing non-code Lisp data
Fixes: bug#40573

The new mode can be used stand-alone or inherited from by modes
intended to edit programs. The existing emacs-lisp-mode and lisp-mode
are examples.

Thanks to Juri Linkov and Basil L. Contovounesios for researching some
data files in Emacs that can be automatically set to use the new mode.

* lisp/files.el (auto-mode-alist): Add entry for ".dir-locals" and
".dir-locals-2"

* lisp/emacs-lisp/lisp-mode.el: (lisp-data-mode): New major mode.
(lisp-mode): Inherit from lisp-data-mode.  Set special lisp-mode
stuff here.

* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Inherit from
lisp-data-mode.

* lisp/bookmark.el (bookmark-insert-file-format-version-stamp):
Use lisp-data-mode.

* lisp/saveplace.el (save-place-alist-to-file): Use
lisp-data-mode.

* lisp/net/eww.el (eww-write-bookmarks): Use lisp-data-mode.

* lisp/net/nsm.el (nsm-write-settings): Use lisp-data-mode.

* lisp/net/tramp-cache.el (tramp-dump-connection-properties): Use
lisp-data-mode.

* etc/NEWS: Mention lisp-data-mode.

* doc/lispref/modes.texi (Example Major Modes): Update example.
2020-05-01 12:11:10 +01:00
Mattias Engdegård
0c6c8aa002 Remove (or double) redundant backslashes in string literals
See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00749.html .

* lisp/obsolete/iswitchb.el (iswitchb-summaries-to-end):
* test/src/regex-emacs-tests.el (regex-tests-BOOST-frob-escapes):
* test/lisp/help-fns-tests.el (help-fns-test-lisp-macro)
(help-fns-test-lisp-defun, help-fns-test-lisp-defsubst)
(help-fns-test-alias-to-defun, help-fns-test-bug23887):
Double backslashes for desired effect.
* lisp/org/ol.el (org-link-escape):
* lisp/net/nsm.el (nsm-protocol-check--rsa-kx)
(nsm-protocol-check--anon-kx, nsm-protocol-check--sha1-sig):
* lisp/obsolete/old-whitespace.el (whitespace-buffer):
* lisp/obsolete/rcompile.el (remote-compile-run-before):
* lisp/obsolete/vi.el (vi-end-of-blank-delimited-word):
* lisp/obsolete/vip.el (vip-current-major-mode)
(vip-paren-match, vip-switch-to-buffer)
(vip-switch-to-buffer-other-window, vip-kill-buffer)
(vip-get-ex-token, ex-edit):
* lisp/org/org-element.el (org-element--cache-sync-requests):
* lisp/org/org.el (org-sparse-tree):
* lisp/textmodes/reftex.el (reftex-report-bug):
* test/lisp/ibuffer-tests.el (ibuffer-save-filters):
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--insert-failing-lines):
* test/lisp/simple-tests.el (undo-test-kill-c-a-then-undo):
* test/lisp/textmodes/conf-mode-tests.el (conf-test-toml-mode):
* test/src/regex-emacs-tests.el (regex-tests-compare):
Remove redundant backslashes.
2020-01-24 23:04:34 +01:00
Paul Eggert
088bfcc2d8 Move “Fix some broken conditional forms” to master
Revert 2020-01-04T19:17:12Z!eggert@cs.ucla.edu
which recently I installed into the emacs-27 branch by mistake.
These patches are now on master instead (via merging).
Do not merge to master.
2020-01-05 11:50:31 -08:00
Paul Eggert
f95a2b8301 Fix some broken conditional forms
Problem reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2020-01/msg00088.html
* lisp/cedet/ede/cpp-root.el (ede-create-lots-of-projects-under-dir):
Remove this quick hack, which didn’t do anything anyway.
* lisp/cedet/ede/pconf.el (ede-proj-configure-test-required-file):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-col):
* lisp/net/nsm.el (nsm-check-tls-connection):
Use ‘when’ rather than bypassing it.  This doesn’t affect behavior
and is better style.
* lisp/cedet/srecode/semantic.el (srecode-semantic-handle-:tag):
Fix typo that suppressed an error.
* lisp/filesets.el (filesets-run-cmd): Fix typo that mishandled spacing.
* lisp/gnus/gnus-cloud.el (gnus-cloud-update-newsrc-data):
Fix typo that caused “GROUP has older different info in the cloud
as of DATE, update it here?” prompt result to always be treated as
“yes”.
* lisp/gnus/mml-smime.el (mml-smime-openssl-encrypt): Simplify,
since smime-encrypt-buffer signals error on failure.
* lisp/international/titdic-cnv.el (tsang-quick-converter): Simplify.
The conversion of this file to utf-8-emacs in
2019-01-08T02:18:40Z!monnier@iro.umontreal.ca removed the
distinction between Big5 and CNS fulltitles in the generated docstring.
* lisp/org/org-agenda.el (org-agenda-show-and-scroll-up):
* lisp/textmodes/table.el (table--generate-source-cell-contents):
Simplify by removing useless code.
* lisp/org/ox-odt.el (org-odt--format-timestamp): Fix typo that
always output time-of-day even when the timestamp lacked it.
2020-01-04 11:18:13 -08:00
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
Paul Eggert
d1a791f8ed Spelling fixes 2019-12-09 18:45:18 -08:00
Robert Pluim
650a514e99 Extend network-interface-list to return IPv6 and network info
Bug#38218

* src/process.c (Fnetwork_interface_list): Extend argument list to
allow requesting full network info and/or IPv4/IPv6 info.
(network_interface_list) [HAVE_GETIFADDRS]: Use getifaddrs to retrieve
interface IP addresses.

* src/process.h: Update prototype of network_interface_list.

* src/w32.c (g_b_init_get_adapters_addresses): New init flag.
(globals_of_w32): Initialize it.
(GetAdaptersAddresses_Proc): New function typedef.
(get_adapters_addresses): New wrapper function.
(init_winsock): Load htonl and ntohl.
(sys_htonl, sys_ntohl): New wrapper functions.
(network_interface_list): Implement in terms of
get_adapters_addresses.

* nt/inc/sys/socket.h: Add sys_htonl and sys_ntohl prototypes.

* etc/NEWS: Announce IPv4/IPv6 changes in network-interface-list.

* doc/lispref/processes.texi (Misc Network): Document updated arglist
and return values for network-interface-list.
2019-11-26 08:46:13 +01:00
Robert Pluim
cf0a76a438 Don't error when comparing IPv4 and IPv6 addresses
* lisp/net/nsm.el (nsm-network-same-subnet): Compare lengths of
local-ip and ip; different lengths can never match.
(nsm-should-check): Chop port off end of address.
2019-11-19 13:36:07 +01:00
Juanma Barranquero
41ba8231ef lisp/*.el: Fix typos and improve some docstrings
* lisp/auth-source.el (auth-source-backend-parse-parameters)
(auth-source-search-collection)
(auth-source-secrets-listify-pattern)
(auth-source--decode-octal-string, auth-source-plstore-search):
* lisp/registry.el (registry-lookup)
(registry-lookup-breaks-before-lexbind)
(registry-lookup-secondary, registry-lookup-secondary-value)
(registry-search, registry-delete, registry-size, registry-full)
(registry-insert, registry-reindex, registry-prune)
(registry-collect-prune-candidates):
* lisp/subr.el (nbutlast, process-live-p):
* lisp/tab-bar.el (tab-bar-list):
* lisp/cedet/ede/linux.el (ede-linux--get-archs)
(ede-linux--include-path, ede-linux-load):
* lisp/erc/erc-log.el (erc-log-all-but-server-buffers):
* lisp/erc/erc-pcomplete.el (pcomplete-erc-commands)
(pcomplete-erc-ops, pcomplete-erc-not-ops, pcomplete-erc-nicks)
(pcomplete-erc-all-nicks, pcomplete-erc-channels)
(pcomplete-erc-command-name, pcomplete-erc-parse-arguments):
* lisp/eshell/em-term.el (eshell-visual-command-p):
* lisp/gnus/gnus-cache.el (gnus-cache-fully-p):
* lisp/gnus/nnmail.el (nnmail-get-active)
(nnmail-fancy-expiry-target):
* lisp/mail/mail-utils.el (mail-string-delete):
* lisp/mail/supercite.el (sc-hdr, sc-valid-index-p):
* lisp/net/ange-ftp.el (ange-ftp-use-smart-gateway-p):
* lisp/net/nsm.el (nsm-save-fingerprint-maybe)
(nsm-network-same-subnet, nsm-should-check):
* lisp/net/rcirc.el (rcirc-looking-at-input):
* lisp/net/tramp-cache.el (tramp-get-hash-table):
* lisp/net/tramp-compat.el (tramp-compat-process-running-p):
* lisp/net/tramp-smb.el (tramp-smb-get-share)
(tramp-smb-get-localname, tramp-smb-read-file-entry)
(tramp-smb-get-cifs-capabilities, tramp-smb-get-stat-capability):
* lisp/net/zeroconf.el (zeroconf-list-service-names)
(zeroconf-list-service-types, zeroconf-list-services)
(zeroconf-get-host, zeroconf-get-domain)
(zeroconf-get-host-domain):
* lisp/nxml/rng-xsd.el (rng-xsd-compile)
(rng-xsd-make-date-time-regexp, rng-xsd-convert-date-time):
* lisp/obsolete/erc-hecomplete.el (erc-hecomplete)
(erc-command-list, erc-complete-at-prompt):
* lisp/org/ob-scheme.el (org-babel-scheme-get-buffer-impl):
* lisp/org/ob-shell.el (org-babel--variable-assignments:sh-generic)
(org-babel--variable-assignments:bash_array)
(org-babel--variable-assignments:bash_assoc)
(org-babel--variable-assignments:bash):
* lisp/org/org-clock.el (org-day-of-week):
* lisp/progmodes/cperl-mode.el (cperl-char-ends-sub-keyword-p):
* lisp/progmodes/gud.el (gud-find-c-expr, gud-innermost-expr)
(gud-prev-expr, gud-next-expr):
* lisp/textmodes/table.el (table--at-cell-p, table--probe-cell)
(table--get-cell-justify-property)
(table--get-cell-valign-property)
(table--put-cell-justify-property)
(table--put-cell-valign-property): Fix typos.

* lisp/so-long.el (fboundp): Doc fix.
(so-long-mode-line-info, so-long-mode)
(so-long--check-header-modes): Fix typos.

* lisp/emulation/viper-mous.el (viper-surrounding-word)
(viper-mouse-click-get-word): Fix typos.
(viper-mouse-click-search-word): Doc fix.

* lisp/erc/erc-backend.el (erc-forward-word, erc-word-at-arg-p)
(erc-bounds-of-word-at-point): Fix typos.
(erc-decode-string-from-target, define-erc-response-handler):
Refill docstring.

* lisp/erc/erc-dcc.el (pcomplete/erc-mode/DCC): Fix typo.
(erc-dcc-get-host, erc-dcc-auto-mask-p, erc-dcc-get-file):
Doc fixes.

* lisp/erc/erc-networks.el (erc-network-name): Fix typo.
(erc-determine-network): Refill docstring.

* lisp/net/dbus.el (dbus-list-hash-table)
(dbus-string-to-byte-array, dbus-byte-array-to-string)
(dbus-check-event): Fix typos.
(dbus-introspect-get-property): Doc fix.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler):
Rename ARGS to ARGUMENTS.  Doc fix.
(tramp-adb-sh-fix-ls-output, tramp-adb-execute-adb-command)
(tramp-adb-find-test-command): Fix typos.

* lisp/net/tramp.el (tramp-set-completion-function)
(tramp-get-completion-function)
(tramp-completion-dissect-file-name)
(tramp-completion-dissect-file-name1)
(tramp-get-completion-methods, tramp-get-completion-user-host)
(tramp-get-inode, tramp-get-device, tramp-mode-string-to-int)
(tramp-call-process, tramp-call-process-region)
(tramp-process-lines): Fix typos.
(tramp-interrupt-process): Doc fix.

* lisp/org/ob-core.el (org-babel-named-src-block-regexp-for-name)
(org-babel-named-data-regexp-for-name): Doc fix.
(org-babel-src-block-names, org-babel-result-names): Fix typos.

* lisp/progmodes/inf-lisp.el (lisp-input-filter): Doc fix.
(lisp-fn-called-at-pt): Fix typo.

* lisp/progmodes/xref.el (xref-backend-identifier-at-point):
Doc fix.
(xref-backend-identifier-completion-table): Fix typo.
2019-10-20 12:12:27 +02:00
Stefan Monnier
bda62c787f * lisp/net/nsm.el: Use lexical-binding
(nsm-check-tls-connection, nsm-query): Don't pass explicitly `obarray`
since it's the default anyway.
(nsm-query, nsm-query-user, nsm-save-host): Remove redundant
advertised-calling-convention.
2019-09-27 08:01:04 -04:00
Lars Ingebrigtsen
61a2b3ca7d Allow scrolling the NSM window
* lisp/net/nsm.el (nsm-query-user): Allow moving
backwards/forwards in the NSM buffer if the window is too small to
show all the details (bug#28069).
2019-09-24 08:33:45 +02:00
Lars Ingebrigtsen
2180852c72 Further fix for network-security-protocol-checks
* lisp/net/nsm.el (network-security-protocol-checks): Fix the
defcustom type some more (bug#37306).
2019-09-05 13:26:08 +02:00
Lars Ingebrigtsen
71964ccc10 Fix defcustom type of network-security-protocol-checks
* lisp/net/nsm.el (network-security-protocol-checks): Fix the
defcustom type (bug#37306).
2019-09-05 13:23:11 +02:00
Robert Pluim
95becaaf3b Don't check for :safe-renegotiation with TLS1.3
* lisp/net/nsm.el (nsm-protocol-check--renegotiation-info-ext): Don't
check when using TLS1.3, renegotiation has been removed from TLS.
Reported in
<https://lists.gnu.org/archive/html/help-gnu-emacs/2019-09/msg00005.html>
2019-09-04 23:46:31 +02:00
Robert Pluim
fc9ed61a43 Fix nsm for unencrypted connections
When connecting using a cleartext connection, nsm was erroring out and
tearing down the connection because it was trying to display
nonexistent certificate information.

* lisp/net/nsm.el (nsm-query-user): Only format certificate status
when it is valid.  (Bug#37221)
2019-09-04 23:46:31 +02:00
Paul Eggert
8037694595 Tweak gnutls-peer-status reporting
* src/gnutls.c (Fgnutls_peer_status): Report :compression and
:encrypt-then-mac only if the underlying GnuTLS library has
the corresponding features.  This give the Elisp caller a bit
more information about the peer status.
* lisp/net/nsm.el (nsm-protocol-check--compression):
Don’t worry about compression in newer GnuTLS versions
that do not support compression.
2019-08-23 11:52:03 -07:00
Lars Ingebrigtsen
b4065de33c Rename renamed nsm.el variables and functions back
* doc/emacs/misc.texi (Network Security): Start working on
updating the NSM bits, but it's unclear how much of the new stuff
to document.

* lisp/net/nsm.el: Rename all nsm-tls-check-* functions to
nsm-protocol-check--* to bring them back into line with the
documentation.
(network-security-protocol-checks): Renamed back again from
`nsm-tls-checks', as this variable is documented and can't just go
away.
2019-08-23 11:51:54 +02:00
Lars Ingebrigtsen
7b0d498546 Move all NSM tests away from the `low' level
* lisp/net/nsm.el (network-security-level, nsm-tls-checks): Make
`low' a "check nothing" setting again, and move all the `low'
checks back to `medium'.  This makes the test suite work again.
2019-08-23 11:00:02 +02:00
Lars Ingebrigtsen
228ca5aa4b Fix too-long lines in nsm.el
* lisp/net/nsm.el: Fix some too-long lines and some terminology in
the doc strings/comments.
2019-08-23 05:05:27 +02:00
Lars Ingebrigtsen
53cb3d3e0d Merge remote-tracking branch 'origin/netsec' 2019-08-23 04:49:52 +02:00
Lars Ingebrigtsen
29d485fb76 Tweak the warning display to be less like a TLS decoding page
* lisp/net/nsm.el (nsm-parse-subject, nsm-certificate-part):
Restore functions for parsing subjects.
(nsm-format-certificate): Use them to display more user-friendly
data.  Also change the display to have fewer lines again so that
the data of interest isn't pushed off the screen.
2019-08-23 04:07:10 +02:00
Robert Pluim
bc1cf28da5 Change nsm-should-check to look at local subnets
* lisp/net/nsm.el (nsm-network-same-subnet): New function.  Checks
if an ip address is in the same subnet as another one.
(nsm-should-check): Use nsm-network-same-subnet to see if we're
connecting to a local subnet machine.  Remove checks for RFC1918 addresses.

* test/lisp/net/nsm-tests.el: New file.  Test nsm-should-check functionality.
2019-08-07 14:07:07 +02:00
Lars Ingebrigtsen
93e1f7c66f Fix saving certificates in the NSM on high security levels
* lisp/net/nsm.el (nsm-check-certificate): `nsm-fingerprint-ok-p'
will save the fingerprint in the correct temporary/permanent
storage, so saving it once more (in the permanent storage) if the
security level is high or greater is a mistake (bug#27823).
2019-07-15 20:31:42 +02:00
Paul Eggert
ba809612c0 Merge from origin/emacs-26
2fcf2df Fix copyright years by hand
26bed8b Update copyright year to 2019
2814292 Fix value of default frame height.  (Bug#33921)
2018-12-31 17:57:29 -08:00
Paul Eggert
26bed8ba10 Update copyright year to 2019
Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
2019-01-01 01:01:13 +00:00
Glenn Morris
44c1ce3a37 Merge from origin/emacs-26
d28d54c (origin/emacs-26) More accurate docs for 'text-char-description'
b3baf99 Document synchronous behavior of eshell/make (Bug#32513)
98544ea Fix bs-show with wide characters (Bug#17822)
85af51b Improve Custom menu labels for 2 options
72a2a36 Improve wording of last change in dired-x.texi
d4fa83b Fix GnuTLS test suite with GnuTLS versions 3.4.x
b5bee6b Fix build with gnutls versions 3.0 to 3.2 (Bug#32446)
67eb80e ; * etc/enriched.txt (hanging-indents): Remove extra indent.
c71cfb7 Fix the Bubbles game on TTY frames
3bbf21b Add choice to reshow certificate information (Bug#31877)
6f2c471 * src/alloc.c (Fbool_vector, Flist, Fvector): Doc tweak.
39eecb3 * src/alloc.c (vector): Fix grammatical error in doc string: ...
2018-09-20 07:50:34 -07:00
Allen Li
3bbf21b913 Add choice to reshow certificate information (Bug#31877)
In various situations, the window displaying the certificate
information can be hidden (such as if the user accidentally presses ?,
which causes the read-multiple-choice help window to replace it).
Instead of leaving the user to make a choice blindly, add a choice to
reshow the certification information.

* lisp/net/nsm.el (nsm-query-user): Add reshow choice.
2018-09-16 21:15:21 -04:00
Glenn Morris
9e297f35a0 Remove useless requires of subr-x at runtime
* lisp/thread.el, lisp/net/nsm.el, lisp/erc/erc.el:
Don't require subr-x at runtime.
2018-09-10 14:55:14 -04:00
Jimmy Yuen Ho Wong
fab6139b89
Show full issuer and subject distinguished names
CAs like Let's Encrypt do not put O and OU into the Subject's DN.
Similarly, O and OU are often used to indicate Domain Validated or
Organization Validation as opposed to the actual OU.

Issuer CN often contains the issuer's server or as an indication of
Extended Validation certificate as opposed to the actual issuer
organization.

The Hostname part as extracted from the Subject is also confusing, as
in the case of a hostname mismatch, the Subject's CN, which
`nsm-format-certificate' naively calls the Hostname, will not actually
match the hostname in the problem preamble.

* lisp/net/nsm.el (nsm-format-certificate): Show full DN of Issuer and
  Subject.  Remove Hostname.
  (nsm-certificate-part, nsm-parse-subject): Removed.
2018-07-14 17:50:46 +01:00
Jimmy Yuen Ho Wong
87484dc27e
Full certificate chain details for NSM
* lisp/net/nsm.el (nsm-check-tls-connection): Fix issue with plural
  problems in message.  Prefix every problem with a bullet.
  (nsm-query-user): Add new view the full certificate chain by
  pressing d.
  (nsm-format-certificate): Improve basic certificate and session info
  formatting.

* src/gnutls.c (emacs_gnutls_certificate_export_pem): New function.
  (gnutls_certificate_details): Rename to
  emacs_gnutls_certificate_details.  Add :pem to result list.
  (Fgnutls_format_certificate):  New function for formatting a PEM to
  human-readable text.
2018-07-14 17:50:45 +01:00
Jimmy Yuen Ho Wong
682578fcf7
Add option to bypass NSM TLS checks on local networks
* lisp/net/net-utils.el (nslookup-host-ipv4, nslookup-host-ipv6,
  ipv6-expand): New functions to lookup IPv4 and IPv6 addresses from
  DNS.

* lisp/net/nsm.el (nsm-trust-local-network, nsm-should-check,
  nsm-check-tls-connection, nsm-check-plain-connection): New defcustom
  `nsm-trust-local-network' lets users customize whether NSM should
  check for TLS problems when connecting to the hosts on their local
  networks.  `nsm-should-check' determines whether
  `nsm-check-tls-connection' and `nsm-check-plain-connection' should
  perform checks.  localhost is implicitly trusted, thus checks are
  never performed there.
2018-07-14 17:50:44 +01:00
Jimmy Yuen Ho Wong
534a3d5d3a
Revamp Network Security manager checks for TLS
* lisp/net/nsm.el (network-security-level, nsm-level,
  nsm-new-fingerprint-ok-p): Remove `paranoid' level and related code.

* lisp/net/nsm.el (nsm-tls-checks, nsm-tls-check-version,
    nsm-tls-check-compression, nsm-tls-check-renegotiation-info-ext,
    nsm-tls-check-verify-cert, nsm-tls-check-same-cert,
    nsm-tls-check-null-suite, nsm-tls-check-export-kx,
    nsm-tls-check-anon-kx, nsm-tls-check-md5-sig,
    nsm-tls-check-rc4-cipher, nsm-tls-check-dhe-prime-kx,
    nsm-tls-check-sha1-sig, nsm-tls-check-ecdsa-cbc-cipher
    nsm-tls-check-dhe-kx, nsm-tls-check-rsa-kx,
    nsm-tls-check-3des-cipher, nsm-tls-check-cbc-cipher,
    nsm-save-fingerprint-maybe, nsm-tls-post-check-functions): New
    options and functions for checking TLS handshake problems.

* lisp/net/nsm.el (nsm-check-certificate,
  network-security-protocol-checks,
  nsm-protocol-check--diffie-hellman-prime-bits,
  nsm-protocol-check--3des, nsm-protocol-check--rc4,
  nsm-protocol-check--signature-sha1,
  nsm-protocol-check--intermediate-sha1, nsm-protocol-check--ssl,
  nsm-check-protocol): Remove in favor of `nsm-tls-checks' and
  `nsm-tls-check-*' functions.

* lisp/net/nsm.el (nsm-verify-connection): Ensure connection is
  checked even when `network-security-level' is `low'.

* lisp/net/nsm.el (nsm-check-tls-connection): Batch all problems found
  before querying the user.

* lisp/net/nsm.el (nsm--encryption): Renamed to `nsm-cipher-suite'.

* lisp/net/nsm.el (nsm-fingerprint-ok-p): No longer prompt when
  certificate fingerprints mismatch.  Returns a boolean instead when
  the fingerprint of the certificate received matches the saved
  fingerprints.

* lisp/net/nsm.el (nsm-query): Change signature.  Accepts a list of
  problems and a preformatted message instead of just a message format
  and the arguments for the message.

* lisp/net/nsm.el (nsm-query-user): Change signature.  Accepts a
  preformatted message and the peer status of the handshake instead of
  a message format, its arguments and the certificate for the host.

* lisp/net/nsm.el (nsm-save-host): Change signature.  Accepts a list of
  problems after the WHAT parameter.  Saves multiple fingerprints for
  the same host in case the host load balances a TLS server with more
  than one certificates signed with different keys.  Makes sure
  conditions are not removed when updating a fingerprint.

* lisp/net/nsm.el (nsm-format-certificate): Display the TLS handshake's
  renegotiation info extension, compression level, encrypt-then-MAC
  extension, and key exchange prime bit length.

* src/gnutls.c (gnutls-peer-status-warning-describe,
  gnutls-peer-status): Check for certificate verification problems
  introduced since GnuTLS 3.1.

* src/gnutls.c (gnutls-peer-status): `:compression', `:encrypt-then-mac'
  and `:safe-renegotiation' are now contained in the peer status
  result return value.
2018-07-14 17:50:44 +01:00
Lars Ingebrigtsen
c6de1f1592 Fix typo in sha1-intermediate check
* lisp/net/nsm.el (nsm-protocol-check--intermediate-sha1): Allow
storing the exception with a correct name.
2018-07-08 16:14:06 +02:00
Lars Ingebrigtsen
27a21970f6 Fix spelling of "intermediate" (it's not "intermediary")
* doc/emacs/misc.texi (Network Security): Ditto.

* lisp/net/nsm.el (network-security-protocol-checks): Fix spelling
on "intermediate".
(nsm-protocol-check--intermediate-sha1): Ditto.
2018-06-25 18:56:55 +02:00
Lars Ingebrigtsen
3e7692f07d Make the intermediary-sha1 check work
* lisp/net/nsm.el (nsm-protocol-check--intermediary-sha1): Make
the "skip the root cert" logic work (suggested by Noam Postavsky).
2018-06-25 02:40:25 +02:00
Lars Ingebrigtsen
5a285a4db9 Make more TLS checks trigger on the default `medium' level
* doc/emacs/misc.texi (Network Security): Update the doc to say
what's on the different levels.

* lisp/net/nsm.el (nsm-protocol-check--intermediary-sha1): Check
intermediary certificates for SHA1.
(nsm-protocol-check--3des): Check for 3DES ciphers.
(network-security-protocol-checks): Put most of the checks on
`medium'.
2018-06-24 22:57:27 +02:00
Lars Ingebrigtsen
eaa054a94b Fix reverse test in previous check-in
* lisp/net/nsm.el (nsm-check-protocol): Fix reverse test in
previous check-in.
2018-06-24 15:40:43 +02:00
Lars Ingebrigtsen
6584bc6720 Refactor the protocol NSM checks for flexibility
* doc/emacs/misc.texi (Network Security): Mention
network-security-protocol-checks.

* lisp/net/nsm.el (network-security-protocol-checks): New variable.
(nsm-check-protocol): Refactor the checks into separate functions
for greater flexibility.
(nsm-protocol-check--diffie-hellman-prime-bits)
(nsm-protocol-check--rc4, nsm-protocol-check--ssl)
(nsm-protocol-check--signature-sha1): Refactored out of the big
function.
2018-06-24 15:37:00 +02:00
Paul Eggert
5c7dd8a783 Update copyright year to 2018
Run admin/update-copyright.
2018-01-01 00:57:59 -08:00
Mark Oteiza
295457ae52 Move read-multiple-choice to its own library
* lisp/emacs-lisp/rmc.el: New file.
* lisp/emacs-lisp/subr-x.el (read-multiple-choice): Remove.
* lisp/gnus/message.el:
* lisp/net/nsm.el: Change required library.
2017-10-06 10:42:06 -04:00
Paul Eggert
bc511a64f6 Prefer HTTPS to FTP and HTTP in documentation
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November.  Change these FTP URLs to https://ftp.gnu.org
instead.  Make similar changes for URLs to other organizations moving
away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
2017-09-13 15:54:37 -07:00