all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: lo2net <fangtao0901@gmail.com>
To: 20908@debbugs.gnu.org
Subject: bug#20908: 25.0.50; gnutls-negotiate error "Invalid format operation %u"
Date: Sat, 27 Jun 2015 11:55:43 +0800	[thread overview]
Message-ID: <87bng1yfcw.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 773 bytes --]

Hi all,
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:

[-- Attachment #2: 0001-gnutls-boot-fix-error-Invalid-format-operation-u-whe.patch --]
[-- Type: text/plain, Size: 834 bytes --]

From d046b24f7cee1b30e45dd094c0299304cfd7c270 Mon Sep 17 00:00:00 2001
From: lo2net <fangtao0901@gmail.com>
Date: Thu, 25 Jun 2015 17:00:03 +0800
Subject: [PATCH] gnutls-boot: fix error "Invalid format operation %u" when
 certificate validation fail

---
 src/gnutls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gnutls.c b/src/gnutls.c
index cab2404..6a2c873 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1512,7 +1512,7 @@ one trustfile (usually a CA bundle).  */)
           || !NILP (Fmember (QCgnutls_bootprop_trustfiles, verify_error)))
         {
 	  emacs_gnutls_deinit (proc);
-	  error ("Certificate validation failed %s, verification code %u",
+	  error ("Certificate validation failed %s, verification code %d",
 		 c_hostname, peer_verification);
         }
       else
-- 
1.9.5.msysgit.1


             reply	other threads:[~2015-06-27  3:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-27  3:55 lo2net [this message]
2015-06-27  8:05 ` bug#20908: 25.0.50; gnutls-negotiate error "Invalid format operation %u" Eli Zaretskii
2015-06-27 12:39   ` tao fang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bng1yfcw.fsf@gmail.com \
    --to=fangtao0901@gmail.com \
    --cc=20908@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.