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#31946: 27.0.50; The NSM should warn about more TLS problems Date: Sun, 29 Jul 2018 10:45:38 -0400 Message-ID: <87effm2j8t.fsf@gmail.com> References: <87fu1apchn.fsf@gmail.com> <87sh4zlr6e.fsf@gmail.com> <871scdoli3.fsf@mouse.gnus.org> <877em5mva7.fsf@mouse.gnus.org> <87sh4td0kk.fsf@gmail.com> <877em5lcoz.fsf@mouse.gnus.org> <87d0vvdexg.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1532875456 20012 195.159.176.226 (29 Jul 2018 14:44:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 29 Jul 2018 14:44:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 31946@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 29 16:44:12 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 1fjmvb-00057S-Vt for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Jul 2018 16:44:12 +0200 Original-Received: from localhost ([::1]:48669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjmxi-00027d-I4 for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Jul 2018 10:46:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjmxS-00024a-5s for bug-gnu-emacs@gnu.org; Sun, 29 Jul 2018 10:46:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjmxO-0001Db-Hc for bug-gnu-emacs@gnu.org; Sun, 29 Jul 2018 10:46:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57201) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fjmxO-0001DR-D9 for bug-gnu-emacs@gnu.org; Sun, 29 Jul 2018 10:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fjmxO-0006yx-3q for bug-gnu-emacs@gnu.org; Sun, 29 Jul 2018 10:46: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: Sun, 29 Jul 2018 14:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31946 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: security Original-Received: via spool by 31946-submit@debbugs.gnu.org id=B31946.153287555526823 (code B ref 31946); Sun, 29 Jul 2018 14:46:02 +0000 Original-Received: (at 31946) by debbugs.gnu.org; 29 Jul 2018 14:45:55 +0000 Original-Received: from localhost ([127.0.0.1]:33986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjmxD-0006yT-PP for submit@debbugs.gnu.org; Sun, 29 Jul 2018 10:45:55 -0400 Original-Received: from mail-io0-f173.google.com ([209.85.223.173]:35743) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjmx8-0006yA-LG for 31946@debbugs.gnu.org; Sun, 29 Jul 2018 10:45:50 -0400 Original-Received: by mail-io0-f173.google.com with SMTP id w11-v6so7829645iob.2 for <31946@debbugs.gnu.org>; Sun, 29 Jul 2018 07:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=6gQW+YNCIFJdFHr9k6g+E1GkXMs14NArDKb9D9e/x7w=; b=fOzzLv2fjr0dOxsHPYR3UwtUTe73tmQt9sjQCXIotbt2ThCPEcogPQ04GLY5gNOEqs HDVnxi2cGIduythfOlFO/UVP3UgWFj4kjIy4zi1XHnl7hBdYEymPrXTrqK7Sss53GDSM jsguCuumU3bJ3VwxcrTitksrb034g09jvASp91q/9cxhaC3t+0+14OCYM+5YeONUrMX/ zBTRqG4R36IjVpEkom5C1uNWVsuo03ReNP/OTPeRLPTd8MI1jP74Ch4UXFcPgAm4df5C mheQs9+1vLA9UgU5PgFB3/VZs+Lx6XwhGuhoYiiYmtcWyLI/VJcz9BFIUGBrQ2lhM0ob 4SWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=6gQW+YNCIFJdFHr9k6g+E1GkXMs14NArDKb9D9e/x7w=; b=B2nxNrtcUWoLVrS01TM93NBQZfFNewCY3A/WkEN8HrLzdb6GQ1cd6bHnJIgTp3bqei X9Ny5ACKFFt0qEmZzUIhiHq+S9j6TjITyHzCoFjC4wAYYV9Ymq2oeNgKeGxzuo2cquEx yzyBfow2346evu5WqhQZcqCADj3EM/BPwFE5xZjX6GxbDx39vEI6AR30+if7YOcF6BCD 3BPQWb4EPdUTMOUXjJX/Rq/i0FyzYa9sKxH9PwNPWEBqSOyy5v5DeRQqoN+0fZNKxeex QjipDQuxCqGSDo+E2Iu5k8rGINv6PJ+pDvZgEVKYgDsEj4y/qyI/D394zetEbjhKgRnP va/g== X-Gm-Message-State: AOUpUlG3MaVle2egBLM0veKW4KJ6VUrcfqBT4/Yx+cs9sqlqEQlWJ89B w8BRvJpit40oA1uKgcZWY2knpzel X-Google-Smtp-Source: AAOMgpfqgbB4Hb7VansTtGV0qZlIZ12dozgC0JedVlu08P5vwY415O94YRxT/sZqIIvsXQ2UqnJbPQ== X-Received: by 2002:a6b:93d7:: with SMTP id v206-v6mr11233619iod.260.1532875540778; Sun, 29 Jul 2018 07:45:40 -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 v141-v6sm5649202itb.26.2018.07.29.07.45.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Jul 2018 07:45:39 -0700 (PDT) In-Reply-To: (Lars Ingebrigtsen's message of "Sun, 22 Jul 2018 13:05:58 +0200") 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:149050 Archived-At: Lars Ingebrigtsen writes: > Noam Postavsky writes: > >> Going by the certificate serial number, Firefox doesn't show this >> certificate at all in the chain. > Yeah, I didn't get any further here, and I don't know what more to > check... gnutls rejects SHA1 certificates by default as of 3.6.0, so I tried with the latest stable gnutls version (3.6.3), and it does reject sha1-intermediate.badssl.com while accepting www.usps.com. Stepping through with gdb I see the problematic certificate is dropped in _gnutls_verify_crt_status, the *second* time it's called from gnutls_x509_trust_list_verify_crt2. I'm not sure yet how we can use this from Emacs, but at least it's a direction to look in. int gnutls_x509_trust_list_verify_crt2(gnutls_x509_trust_list_t list, [...] { [...] hash_pjw_bare(cert_list[cert_list_size - 1]->raw_issuer_dn. [...] _gnutls_verify_crt_status(cert_list, cert_list_size, list->node[hash].trusted_cas, list-> node[hash].trusted_ca_size, flags, purpose, func); if (SIGNER_OLD_OR_UNKNOWN(*voutput) [...]) { /* if we couldn't find the issuer, try to see if the last * certificate is in the trusted list and try to verify against * (if it is not self signed) */ hash_pjw_bare(cert_list[cert_list_size - 1]->raw_dn. [...] _gnutls_debug_log("issuer in verification was not found or insecure; trying against trust list\n"); *voutput = _gnutls_verify_crt_status(cert_list, cert_list_size, list->node[hash].trusted_cas, list-> node[hash].trusted_ca_size, flags, purpose, func); unsigned int _gnutls_verify_crt_status(const gnutls_x509_crt_t * certificate_list, [...] { [...] /* We want to shorten the chain by removing the cert that matches * one of the certs we trust and all the certs after that i.e. if * cert chain is A signed-by B signed-by C signed-by D (signed-by * self-signed E but already removed above), and we trust B, remove * B, C and D. */ [...] for (; i < clist_size; i++) { [...] for (j = 0; j < tcas_size; j++) { [...] /* we check for a certificate that may not be identical with the one * sent by the client, but will have the same name and key. That is * because it can happen that a CA certificate is upgraded from intermediate * CA to self-signed CA at some point. */ if (_gnutls_check_if_same_key (certificate_list[i], trusted_cas[j], i) != 0) { /* explicit time check for trusted CA that we remove from * list. GNUTLS_VERIFY_DISABLE_TRUSTED_TIME_CHECKS */ [...] clist_size = i;