From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: tao fang Newsgroups: gmane.emacs.bugs Subject: bug#20908: 25.0.50; gnutls-negotiate error "Invalid format operation %u" Date: Sat, 27 Jun 2015 20:39:06 +0800 Message-ID: References: <87bng1yfcw.fsf@gmail.com> <837fqpd1a8.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113a08a27886a305197f2490 X-Trace: ger.gmane.org 1435408834 5876 80.91.229.3 (27 Jun 2015 12:40:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Jun 2015 12:40:34 +0000 (UTC) Cc: 20908-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 27 14:40:25 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z8pP8-0004DZ-Cp for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 14:40:18 +0200 Original-Received: from localhost ([::1]:35456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8pP7-0000fN-1Z for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 08:40:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8pP3-0000fH-1n for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2015 08:40:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8pOw-0005Zx-2c for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2015 08:40:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8pOv-0005Yw-SN for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2015 08:40:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z8pOu-0003dl-Qg for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2015 08:40:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: tao fang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Jun 2015 12:40:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20908 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20908-done@debbugs.gnu.org id=D20908.143540875513932 (code D ref 20908); Sat, 27 Jun 2015 12:40:04 +0000 Original-Received: (at 20908-done) by debbugs.gnu.org; 27 Jun 2015 12:39:15 +0000 Original-Received: from localhost ([127.0.0.1]:58873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8pO6-0003cc-Gw for submit@debbugs.gnu.org; Sat, 27 Jun 2015 08:39:15 -0400 Original-Received: from mail-yk0-f176.google.com ([209.85.160.176]:34767) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8pO4-0003cM-Jz for 20908-done@debbugs.gnu.org; Sat, 27 Jun 2015 08:39:13 -0400 Original-Received: by ykfy125 with SMTP id y125so80184014ykf.1 for <20908-done@debbugs.gnu.org>; Sat, 27 Jun 2015 05:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=j9AUn7tZ2jtC5vzaqV4oxBGyZH5J15DmA7ORlxjA6N0=; b=BH3ZwMPWir1nLGD4ijRt4j5r03TrFKbphI7aupb+C/tkRB96Vp5g7j17Nm6pemHGIW 318sjQdsGRoP5/cb8DXPU+JjQ9iA4RpnSe2UCjII3fkjDWy6a9huziRsxfuvSDOPUgr0 LKUTM1E585llObjhKgGB/GAX/HXfaE2fCGjcH4egxvPLT1UHOUhec0GoELCXWTw0b/jf oQmd4DExPKwsiLc/ruw+UK3aTYA2PhnTr0vJW3nfOurkZxAGT0UTHLjZPapvugUv1vHP WPY+k7Rwf7y3s0PAJvUOFeTgSM4FRqfs/NCo4m4xICRLRTB6dV78+FDrfzl0OGOt6oSD gbxg== X-Received: by 10.170.79.5 with SMTP id v5mr7882824ykv.15.1435408746971; Sat, 27 Jun 2015 05:39:06 -0700 (PDT) Original-Received: by 10.37.195.6 with HTTP; Sat, 27 Jun 2015 05:39:06 -0700 (PDT) In-Reply-To: <837fqpd1a8.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104403 Archived-At: --001a113a08a27886a305197f2490 Content-Type: text/plain; charset=UTF-8 Okay, thanks! On Sat, Jun 27, 2015 at 4:05 PM, Eli Zaretskii wrote: > > From: lo2net > > Date: Sat, 27 Jun 2015 11:55:43 +0800 > > > > I've got a problem: when using (gnutls-negotiate :verify-error t) to > initialize a SSL/TLS > > connection , server has an expired certificate cause gnutls-boot signal > > an error "Invalid format operation %u", apparently it's not related to > > gnutls-error. So digging into the source > > code, here is the error signal: > > > > src/gnutls.c:1511 > > > > if (verify_error_all > > || !NILP (Fmember (QCgnutls_bootprop_trustfiles, > verify_error))) > > { > > emacs_gnutls_deinit (proc); > > error ("Certificate validation failed %s, verification code %u", > > c_hostname, peer_verification); > > } > > > > After checking elisp manual and source code, function Fformat(error call > > it to format string) does not > > support '%u', here should using '%d' instead. > > > > I made a simple patch for this: > > Thanks. I used %x instead of %d in the change I just pushed, because > the peer_verification value is actually a bitwise OR of the various > bits, so displaying it in hex will make its interpretation easier. > > With that, I'm marking this bug done. > --001a113a08a27886a305197f2490 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Okay, thanks!

On Sat, Jun 27, 2015 at 4:05 PM, Eli Zaretskii <eliz@gnu.org= > wrote:
> From: lo2net = <fangtao0901@gmail.com><= br> > Date: Sat, 27 Jun 2015 11:55:43 +0800
>
> I've got a problem: when using (gnutls-negotiate :verify-error t) = to initialize a SSL/TLS
> connection , server has an expired certificate cause gnutls-boot signa= l
> an error "Invalid format operation %u", apparently it's = not related to
> gnutls-error. So digging into the source
> code, here is the error signal:
>
> src/gnutls.c:1511
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if (verify_error_all
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|| !NILP (Fmember (QCgnutls_bo= otprop_trustfiles, verify_error)))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0emacs_gnutls_deinit (proc);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0error ("Certificate validation f= ailed %s, verification code %u",
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 c_hostname, pee= r_verification);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> After checking elisp manual and source code, function Fformat(error ca= ll
> it to format string) does not
> support '%u', here should using '%d' instead.
>
> I made a simple patch for this:

Thanks.=C2=A0 I used %x instead of %d in the change I just pushed, because<= br> the peer_verification value is actually a bitwise OR of the various
bits, so displaying it in hex will make its interpretation easier.

With that, I'm marking this bug done.

--001a113a08a27886a305197f2490--