From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#31457: 27.0.50; Move starttls.el and tls.el to lisp/obsolete/ Date: Mon, 14 May 2018 20:03:12 -0400 Message-ID: <87in7pkcov.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1526342526 8653 195.159.176.226 (15 May 2018 00:02:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 15 May 2018 00:02:06 +0000 (UTC) To: 31457@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 15 02:02:01 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fINPl-00027U-CZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 May 2018 02:02:01 +0200 Original-Received: from localhost ([::1]:55654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fINRs-0001Xd-KF for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 May 2018 20:04:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fINRl-0001XH-OH for bug-gnu-emacs@gnu.org; Mon, 14 May 2018 20:04:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fINRi-0006Mw-Ie for bug-gnu-emacs@gnu.org; Mon, 14 May 2018 20:04:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55103) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fINRi-0006M0-ED for bug-gnu-emacs@gnu.org; Mon, 14 May 2018 20:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fINRi-0001op-3O for bug-gnu-emacs@gnu.org; Mon, 14 May 2018 20:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 May 2018 00:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31457 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15263426096945 (code B ref -1); Tue, 15 May 2018 00:04:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 May 2018 00:03:29 +0000 Original-Received: from localhost ([127.0.0.1]:34767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fINRA-0001nx-T7 for submit@debbugs.gnu.org; Mon, 14 May 2018 20:03:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53333) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fINR9-0001nl-RV for submit@debbugs.gnu.org; Mon, 14 May 2018 20:03:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fINR3-0004AC-BR for submit@debbugs.gnu.org; Mon, 14 May 2018 20:03:22 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:50561) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fINR3-00049G-6l for submit@debbugs.gnu.org; Mon, 14 May 2018 20:03:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fINR1-0001Kz-Bf for bug-gnu-emacs@gnu.org; Mon, 14 May 2018 20:03:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fINQy-0003to-5x for bug-gnu-emacs@gnu.org; Mon, 14 May 2018 20:03:19 -0400 Original-Received: from mail-it0-x232.google.com ([2607:f8b0:4001:c0b::232]:39031) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fINQx-0003s5-Ty for bug-gnu-emacs@gnu.org; Mon, 14 May 2018 20:03:16 -0400 Original-Received: by mail-it0-x232.google.com with SMTP id c3-v6so15619019itj.4 for ; Mon, 14 May 2018 17:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=VcTOYOZeyK2s5twPx/ojop1VrLyOP6jQU2LR0vQidhY=; b=Wt992hv4RrKwACGr08C/tSN1OmkAVNnsFg4MGIKV0Z7glmPdVG+GPFz+hN56OW1R0u P1u9wGOzMxBI3dlfmzZuqA1aYo8P+lT0PvQ2OFGUokleLC/6JHbOu0CzZ8/uh4Jl3ZAj K+sMHtm/HqmvjSYMwnqYCypy9zXHjp+PIwk0BCHPumAGZLFd6AjR8eOHsYYTNnn8l6+p bAv3gzgBnEvFM4k2ghQlTn+26XGi6PVYdd260fwks0Fk/mbPzLRogKesuPh9wHP7uu2l xTaxEjvXGFpj7c7kBhxkXcPUfQSO8jFac06nWjCa5ZOsFNf7VhzhFA/zSVrJSDE4IPYk wHIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=VcTOYOZeyK2s5twPx/ojop1VrLyOP6jQU2LR0vQidhY=; b=fTFiWZQrhmPxb2bSOunqEkJxTiq+3FKaJI1emYsOZsHsZBovMZjm3R+voRM693Y/4V cgN6EKrEFo7GUU/dKgfUVPkw739HSeysWsvDQ9Vn88GULomnRxQ0HOMVQNJoXV4QyvIJ /eDjJkSu1COIsaedlPn1mP3ct/IfDv9kwbOvj4hrpCA+k2ixzD9g0EWuhEoKYIsOSQ4h e9fCQXKK/9R9q5SvCginw1SE03j1tb9M/6pZ9OnSl6+E9VLyZ00puIcHtUDiz6v7gm9I qS9X3sgqXkoVwIdQVk3+sfRALce7UVe0rtcUz7NNqEQdQ6yFI4TsjzBwJoBxUK1bc8WD b20g== X-Gm-Message-State: ALKqPwfrA2ErEHOmRYrJXj2iB/ZF3HLiRBsOU8CpEIrBDMOLLTtWB8Mh FkWACkI3lxS59zdciAz8btc+yg== X-Google-Smtp-Source: AB8JxZp+dy0koP5hZRYGBDxdDvtuxmNlbNQqDhispIMe1ucSpghvxbiQAEgGK99qnVNUDPRUJuH9tw== X-Received: by 2002:a6b:9a91:: with SMTP id c139-v6mr11838765ioe.99.1526342595075; Mon, 14 May 2018 17:03:15 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id d143-v6sm4754116itd.35.2018.05.14.17.03.13 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 17:03:13 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:146179 Archived-At: --=-=-= Content-Type: text/plain Tags: patch Severity: minor Use of an external program such as gnutls-cli instead of the builtin libgnutls based functions is already de-facto obsolete: see bugs 15905, 23759, 27658, and 31339. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Move-tls.el-and-starttls.el-to-lisp-obsolete.patch Content-Description: patch >From e87446e3f1cdecbb270337fe158a702615b5ac54 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 13 Jul 2017 08:52:39 -0400 Subject: [PATCH v1] Move tls.el and starttls.el to lisp/obsolete/ * lisp/obsolete/tls.el: Moved from lisp/net/tls.el. * lisp/gnus/nnimap.el: * lisp/url/url-http.el: Don't require tls, since it's obsolete. * lisp/net/network-stream.el: Only require tls if we actually try to use it (i.e., when (gnutls-available-p) returns nil). Declare some functions to fix compilation warnings. * lisp/obsolete/starttls.el: Moved from lisp/net/starttls.el. * lisp/net/sieve-manage.el: * lisp/net/network-stream.el: Don't require `starttls' at the top-level, declare the variables and functions used instead. (network-stream-open-starttls): Only require `starttls' if needed (i.e., gnutls-available-p fails). * etc/NEWS: Announce obsoletion. --- etc/NEWS | 3 +++ lisp/gnus/nnimap.el | 1 - lisp/net/network-stream.el | 22 ++++++++++++++++++---- lisp/net/sieve-manage.el | 1 - lisp/{net => obsolete}/starttls.el | 0 lisp/{net => obsolete}/tls.el | 0 lisp/url/url-http.el | 1 - 7 files changed, 21 insertions(+), 7 deletions(-) rename lisp/{net => obsolete}/starttls.el (100%) rename lisp/{net => obsolete}/tls.el (100%) diff --git a/etc/NEWS b/etc/NEWS index 77ef3f3457..8193545d9f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -419,6 +419,9 @@ or NextCloud hosted files and directories. ** The options.el library has been removed. It was obsolete since Emacs 22.1, replaced by customize. +** The tls.el and starttls.el libraries are now marked obsolete. +Use of builtin of function based on libgnutls is recommended instead. + ** Message diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index dc51b5f0f0..3b39731927 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -36,7 +36,6 @@ (require 'nnoo) (require 'netrc) (require 'utf7) -(require 'tls) (require 'parse-time) (require 'nnmail) diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index 19e0c6421f..a0589e25a4 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el @@ -42,14 +42,20 @@ ;;; Code: -(require 'tls) -(require 'starttls) (require 'auth-source) (require 'nsm) (require 'puny) +(declare-function starttls-available-p "starttls" ()) +(declare-function starttls-negotiate "starttls" (process)) + (autoload 'gnutls-negotiate "gnutls") (autoload 'open-gnutls-stream "gnutls") +(defvar starttls-extra-arguments) +(defvar starttls-extra-args) +(defvar starttls-use-gnutls) +(defvar starttls-gnutls-program) +(defvar starttls-program) ;;;###autoload (defun open-network-stream (name buffer host service &rest parameters) @@ -255,7 +261,8 @@ network-stream-open-starttls (or (gnutls-available-p) (and (or require-tls (plist-get parameters :use-starttls-if-possible)) - (starttls-available-p)))) + (require 'starttls) + (starttls-available-p)))) (not (eq (plist-get parameters :type) 'plain))) ;; If using external STARTTLS, drop this connection and start ;; anew with `starttls-open-stream'. @@ -336,7 +343,8 @@ network-stream-open-starttls ;; See `starttls-available-p'. If this predicate ;; changes to allow running under Windows, the error ;; message below should be amended. - (if (memq system-type '(windows-nt ms-dos)) + (if (or (memq system-type '(windows-nt ms-dos)) + (not (featurep 'starttls))) (concat "Emacs does not support TLS") (concat "Emacs does not support TLS, and no external `" (if starttls-use-gnutls @@ -373,6 +381,8 @@ network-stream-get-response (unless (= start (point)) (buffer-substring start (point))))))) +(declare-function open-tls-stream "tls" (name buffer host port)) + (defun network-stream-open-tls (name buffer host service parameters) (with-current-buffer buffer (let* ((start (point-max)) @@ -380,6 +390,7 @@ network-stream-open-tls (if (gnutls-available-p) (open-gnutls-stream name buffer host service (plist-get parameters :nowait)) + (require 'tls) (open-tls-stream name buffer host service))) (eoc (plist-get parameters :end-of-command))) (if (plist-get parameters :nowait) @@ -406,6 +417,9 @@ network-stream-open-tls (network-stream-command stream capability-command eo-capa) 'tls))))))) +(declare-function format-spec "format-spec" (format spec)) +(declare-function format-spec-make "format-spec" (&rest pairs)) + (defun network-stream-open-shell (name buffer host service parameters) (require 'format-spec) (let* ((capability-command (plist-get parameters :capability-command)) diff --git a/lisp/net/sieve-manage.el b/lisp/net/sieve-manage.el index cd40307238..8c70ae037a 100644 --- a/lisp/net/sieve-manage.el +++ b/lisp/net/sieve-manage.el @@ -77,7 +77,6 @@ (eval-when-compile (require 'cl-lib)) (require 'sasl) -(require 'starttls) (autoload 'sasl-find-mechanism "sasl") (autoload 'auth-source-search "auth-source") diff --git a/lisp/net/starttls.el b/lisp/obsolete/starttls.el similarity index 100% rename from lisp/net/starttls.el rename to lisp/obsolete/starttls.el diff --git a/lisp/net/tls.el b/lisp/obsolete/tls.el similarity index 100% rename from lisp/net/tls.el rename to lisp/obsolete/tls.el diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 0b95453b30..53798f77c3 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -1600,7 +1600,6 @@ url-http-options ;; HTTPS. This used to be in url-https.el, but that file collides ;; with url-http.el on systems with 8-character file names. -(require 'tls) (defconst url-https-asynchronous-p t "HTTPS retrievals are asynchronous.") -- 2.11.0 --=-=-=--