diff options
| author | Lars Magne Ingebrigtsen | 2014-11-23 15:13:13 +0100 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2014-11-23 15:13:13 +0100 |
| commit | b10d90066338c88a371fef1b59e2f455a37a3ba2 (patch) | |
| tree | 7c476d6ef70070e5ae39610089a2a15b49e0fbfc | |
| parent | a345ff6bf2af54db2ee03296965165127f7758ec (diff) | |
| download | emacs-b10d90066338c88a371fef1b59e2f455a37a3ba2.tar.gz emacs-b10d90066338c88a371fef1b59e2f455a37a3ba2.zip | |
Rename `nsm-security-level' to `network-security-level'
* net/nsm.el (network-security-level): Rename from
`nsm-security-level' and documented.
| -rw-r--r-- | doc/lispref/processes.texi | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/net/nsm.el | 39 |
3 files changed, 36 insertions, 10 deletions
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index 48429e6fd93..3c9da5c64cd 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi | |||
| @@ -2088,8 +2088,8 @@ entirely. | |||
| 2088 | If the connection is unencrypted, but it was encrypted in previous | 2088 | If the connection is unencrypted, but it was encrypted in previous |
| 2089 | sessions, the user will also be notified about this. | 2089 | sessions, the user will also be notified about this. |
| 2090 | 2090 | ||
| 2091 | @vindex nsm-security-level | 2091 | @vindex network-security-level |
| 2092 | The @code{nsm-security-level} variable determines the security level. | 2092 | The @code{network-security-level} variable determines the security level. |
| 2093 | If this is @code{low}, no security checks are performed. | 2093 | If this is @code{low}, no security checks are performed. |
| 2094 | 2094 | ||
| 2095 | 2095 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 34ac2d31c4b..b4e5b7954e3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2014-11-23 Lars Magne Ingebrigtsen <larsi@gnus.org> | 1 | 2014-11-23 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 2 | ||
| 3 | * net/nsm.el (network-security-level): Rename from | ||
| 4 | `nsm-security-level' and documented. | ||
| 5 | |||
| 3 | * mail/smtpmail.el (smtpmail-via-smtp): Warn unless encrypted and | 6 | * mail/smtpmail.el (smtpmail-via-smtp): Warn unless encrypted and |
| 4 | we're sending a password. | 7 | we're sending a password. |
| 5 | 8 | ||
diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el index f51201a1270..fdbcd13d3ee 100644 --- a/lisp/net/nsm.el +++ b/lisp/net/nsm.el | |||
| @@ -34,8 +34,31 @@ | |||
| 34 | :version "25.1" | 34 | :version "25.1" |
| 35 | :group 'comm) | 35 | :group 'comm) |
| 36 | 36 | ||
| 37 | (defcustom nsm-security-level 'medium | 37 | (defcustom network-security-level 'low |
| 38 | "How secure the network should be." | 38 | "How secure the network should be. |
| 39 | If a potential problem with the security of the network | ||
| 40 | connection is found, the user is asked to give input into how the | ||
| 41 | connection should be handled. | ||
| 42 | |||
| 43 | The following values are possible: | ||
| 44 | |||
| 45 | `low': Absolutely no checks are performed. | ||
| 46 | |||
| 47 | `medium': This is the default level, and the following things will | ||
| 48 | be prompted for. | ||
| 49 | |||
| 50 | * invalid, self-signed or otherwise unverifiable certificates | ||
| 51 | * whether a previously accepted unverifiable certificate has changed | ||
| 52 | * when a connection that was previously protected by STARTTLS is | ||
| 53 | now unencrypted | ||
| 54 | |||
| 55 | `high': In addition to the above. | ||
| 56 | |||
| 57 | * any certificate that changes its public key | ||
| 58 | |||
| 59 | `paranoid': In addition to the above. | ||
| 60 | |||
| 61 | * any new certificate that you haven't seen before" | ||
| 39 | :version "25.1" | 62 | :version "25.1" |
| 40 | :group 'nsm | 63 | :group 'nsm |
| 41 | :type '(choice (const :tag "Low" low) | 64 | :type '(choice (const :tag "Low" low) |
| @@ -80,7 +103,7 @@ to keep track of the TLS status of STARTTLS servers. | |||
| 80 | 103 | ||
| 81 | If WARN-UNENCRYPTED, query the user if the connection is | 104 | If WARN-UNENCRYPTED, query the user if the connection is |
| 82 | unencrypted." | 105 | unencrypted." |
| 83 | (if (eq nsm-security-level 'low) | 106 | (if (eq network-security-level 'low) |
| 84 | process | 107 | process |
| 85 | (let* ((status (gnutls-peer-status process)) | 108 | (let* ((status (gnutls-peer-status process)) |
| 86 | (id (nsm-id host port)) | 109 | (id (nsm-id host port)) |
| @@ -108,21 +131,21 @@ unencrypted." | |||
| 108 | ;; certificate pinning. | 131 | ;; certificate pinning. |
| 109 | ((null warnings) | 132 | ((null warnings) |
| 110 | (cond | 133 | (cond |
| 111 | ((< (nsm-level nsm-security-level) (nsm-level 'high)) | 134 | ((< (nsm-level network-security-level) (nsm-level 'high)) |
| 112 | process) | 135 | process) |
| 113 | ;; The certificate is fine, but if we're paranoid, we might | 136 | ;; The certificate is fine, but if we're paranoid, we might |
| 114 | ;; want to check whether it's changed anyway. | 137 | ;; want to check whether it's changed anyway. |
| 115 | ((and (>= (nsm-level nsm-security-level) (nsm-level 'high)) | 138 | ((and (>= (nsm-level network-security-level) (nsm-level 'high)) |
| 116 | (not (nsm-fingerprint-ok-p host port status settings))) | 139 | (not (nsm-fingerprint-ok-p host port status settings))) |
| 117 | (delete-process process) | 140 | (delete-process process) |
| 118 | nil) | 141 | nil) |
| 119 | ;; We haven't seen this before, and we're paranoid. | 142 | ;; We haven't seen this before, and we're paranoid. |
| 120 | ((and (eq nsm-security-level 'paranoid) | 143 | ((and (eq network-security-level 'paranoid) |
| 121 | (null settings) | 144 | (null settings) |
| 122 | (not (nsm-new-fingerprint-ok-p host port status))) | 145 | (not (nsm-new-fingerprint-ok-p host port status))) |
| 123 | (delete-process process) | 146 | (delete-process process) |
| 124 | nil) | 147 | nil) |
| 125 | ((>= (nsm-level nsm-security-level) (nsm-level 'high)) | 148 | ((>= (nsm-level network-security-level) (nsm-level 'high)) |
| 126 | ;; Save the host fingerprint so that we can check it the | 149 | ;; Save the host fingerprint so that we can check it the |
| 127 | ;; next time we connect. | 150 | ;; next time we connect. |
| 128 | (nsm-save-host host port status 'fingerprint 'always) | 151 | (nsm-save-host host port status 'fingerprint 'always) |
| @@ -131,7 +154,7 @@ unencrypted." | |||
| 131 | process))) | 154 | process))) |
| 132 | 155 | ||
| 133 | ;; The certificate did not validate. | 156 | ;; The certificate did not validate. |
| 134 | ((not (equal nsm-security-level 'low)) | 157 | ((not (equal network-security-level 'low)) |
| 135 | ;; We always want to pin the certificate of invalid connections | 158 | ;; We always want to pin the certificate of invalid connections |
| 136 | ;; to track man-in-the-middle or the like. | 159 | ;; to track man-in-the-middle or the like. |
| 137 | (if (not (nsm-fingerprint-ok-p host port status settings)) | 160 | (if (not (nsm-fingerprint-ok-p host port status settings)) |