GNU bug report logs -
#19231
25.0.50; [PATCH] Fix recent GnuTLS change for MinGW-w64
Previous Next
Reported by: Chris Zheng <chriszheng99 <at> gmail.com>
Date: Sun, 30 Nov 2014 19:19:02 UTC
Severity: normal
Tags: fixed, patch
Found in version 25.0.50
Fixed in version 25.1
Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19231 in the body.
You can then email your comments to 19231 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19231
; Package
emacs
.
(Sun, 30 Nov 2014 19:19:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Chris Zheng <chriszheng99 <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 30 Nov 2014 19:19:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Dear maintainers,
Two recent changes to gnutls.c breaks GnuTLS support in a
MSYS2/MinGW-w64 build. The first is:
a859504 Add functions to gnutls.c for exporting certificate details.
In GnuTLS v3.3.10 from MinGW-w64, the `gnutls_sign_algorithm_get_name'
is defined as a macro, so it can't be loaded by the macro
`LOAD_GNUTLS_FN'. This leads to `nil' from `(gnutls-available-p)'. The second is:
ccae04f | * gnutls.c (Fgnutls_boot): Send the server name over
where `gnutls_server_name_set' is not loaded in Windows. This cause
Emacs to crash. I think the following patch fixes these bugs. I have
tested it with MSYS2/MinGW-w64 combination, where GnuTLS version is
3.3.10. Can it be applied? Thanks.
From 3b747a7bc4d05a41f53ecc1fdbd4a45838bc9d5a Mon Sep 17 00:00:00 2001
From: Chris Zheng <chriszheng99 <at> gmail.com>
Date: Mon, 1 Dec 2014 02:13:04 +0800
Subject: [PATCH] Fix recent GnuTLS change for MinGW-w64.
* src/gnutls.c: In MinGW-w64, `gnutls_sign_algorithm_get_name' is
defined as a macro to `gnutls_sign_get_name', so use
`gnutls_sign_get_name' directly.
(init_gnutls_functions): Load missing `gnutls_server_name_set'.
(init_gnutls_functions): Use `gnutls_sign_get_name'.
(gnutls_certificate_details): Use `fn_gnutls_sign_get_name'.
---
src/gnutls.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/gnutls.c b/src/gnutls.c
index 752df3c..92333c5 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -185,8 +185,15 @@ DEF_GNUTLS_FN (int, gnutls_x509_crt_get_key_id,
(gnutls_x509_crt_t, unsigned int,
unsigned char *, size_t *_size));
DEF_GNUTLS_FN (const char*, gnutls_sec_param_get_name, (gnutls_sec_param_t));
+/* Use `gnutls_sign_get_name' instead of
+ `gnutls_sign_algorithm_get_name' for MinGW-w64. */
+#if defined(MINGW_W64) && defined(gnutls_sign_algorithm_get_name)
+DEF_GNUTLS_FN (const char*, gnutls_sign_get_name,
+ (gnutls_sign_algorithm_t));
+#else
DEF_GNUTLS_FN (const char*, gnutls_sign_algorithm_get_name,
(gnutls_sign_algorithm_t));
+#endif
DEF_GNUTLS_FN (int, gnutls_server_name_set, (gnutls_session_t,
gnutls_server_name_type_t,
const void *, size_t));
@@ -265,7 +272,14 @@ init_gnutls_functions (void)
LOAD_GNUTLS_FN (library, gnutls_x509_crt_get_signature);
LOAD_GNUTLS_FN (library, gnutls_x509_crt_get_key_id);
LOAD_GNUTLS_FN (library, gnutls_sec_param_get_name);
+ /* Use `gnutls_sign_get_name' instead of
+ `gnutls_sign_algorithm_get_name' for MinGW-w64. */
+#if defined(MINGW_W64) && defined(gnutls_sign_algorithm_get_name)
+ LOAD_GNUTLS_FN (library, gnutls_sign_get_name);
+#else
LOAD_GNUTLS_FN (library, gnutls_sign_algorithm_get_name);
+#endif
+ LOAD_GNUTLS_FN (library, gnutls_server_name_set);
max_log_level = global_gnutls_log_level;
@@ -928,7 +942,13 @@ gnutls_certificate_details (gnutls_x509_crt_t cert)
err = fn_gnutls_x509_crt_get_signature_algorithm (cert);
if (err >= GNUTLS_E_SUCCESS)
{
+/* Use `gnutls_sign_get_name' instead of
+ `gnutls_sign_algorithm_get_name' for MinGW-w64. */
+#if defined(MINGW_W64) && defined(gnutls_sign_algorithm_get_name)
+ const char *name = fn_gnutls_sign_get_name (err);
+#else
const char *name = fn_gnutls_sign_algorithm_get_name (err);
+#endif
if (name)
res = nconc2 (res, list2 (intern (":signature-algorithm"),
build_string (name)));
--
2.2.0
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19231
; Package
emacs
.
(Mon, 01 Dec 2014 17:48:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 19231 <at> debbugs.gnu.org (full text, mbox):
Chris Zheng <chriszheng99 <at> gmail.com> writes:
> * src/gnutls.c: In MinGW-w64, `gnutls_sign_algorithm_get_name' is
> defined as a macro to `gnutls_sign_get_name', so use
> `gnutls_sign_get_name' directly.
> (init_gnutls_functions): Load missing `gnutls_server_name_set'.
> (init_gnutls_functions): Use `gnutls_sign_get_name'.
> (gnutls_certificate_details): Use `fn_gnutls_sign_get_name'.
[...]
> +/* Use `gnutls_sign_get_name' instead of
> + `gnutls_sign_algorithm_get_name' for MinGW-w64. */
> +#if defined(MINGW_W64) && defined(gnutls_sign_algorithm_get_name)
> + const char *name = fn_gnutls_sign_get_name (err);
> +#else
> const char *name = fn_gnutls_sign_algorithm_get_name (err);
> +#endif
Instead of adding these ifdefs, perhaps we could just call
fn_gnutls_sign_get_name on all platforms? Or does that function not
exist on non-MingGW platforms?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19231
; Package
emacs
.
(Tue, 02 Dec 2014 13:04:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 19231 <at> debbugs.gnu.org (full text, mbox):
From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#19231: 25.0.50; [PATCH] Fix recent GnuTLS change for MinGW-w64
Date: Mon, 01 Dec 2014 18:46:48 +0100
Hi,
> Instead of adding these ifdefs, perhaps we could just call
> fn_gnutls_sign_get_name on all platforms? Or does that function not
> exist on non-MingGW platforms?
I have tested using fn_gnutls_sign_get_name in GNU/Linux (distro Arch
Linux with same version of GnuTLS as in Windows), and it works as
expected. This is all what I known.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19231
; Package
emacs
.
(Tue, 02 Dec 2014 16:38:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 19231 <at> debbugs.gnu.org (full text, mbox):
Chris Zheng <chriszheng99 <at> gmail.com> writes:
> I have tested using fn_gnutls_sign_get_name in GNU/Linux (distro Arch
> Linux with same version of GnuTLS as in Windows), and it works as
> expected. This is all what I known.
Great. Could you redo the patch without the #ifdefs, and just call
fn_gnutls_sign_get_name on all architectures?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19231
; Package
emacs
.
(Wed, 03 Dec 2014 04:39:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 19231 <at> debbugs.gnu.org (full text, mbox):
From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#19231: 25.0.50; [PATCH] Fix recent GnuTLS change for MinGW-w64
Date: Tue, 02 Dec 2014 17:37:12 +0100
Hi,
> Great. Could you redo the patch without the #ifdefs, and just call
> fn_gnutls_sign_get_name on all architectures?
I don't have older version, maybe we should ask for compatibility
check. The revised patch is as follows.
From 7c9c759c33e34c3cc5d031ae15ac9bb3d05a37e3 Mon Sep 17 00:00:00 2001
From: Chris Zheng <chriszheng99 <at> gmail.com>
Date: Wed, 3 Dec 2014 12:05:13 +0800
Subject: [PATCH] Use gnutls_sign_get_name and load missing function.
* src/gnutls.c (init_gnutls_functions, gnutls_certificate_details):
use `gnutls_sign_get_name' directly.
(init_gnutls_functions): Load missing `gnutls_server_name_set'.
---
src/gnutls.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/gnutls.c b/src/gnutls.c
index 752df3c..7c61445 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -185,7 +185,7 @@ DEF_GNUTLS_FN (int, gnutls_x509_crt_get_key_id,
(gnutls_x509_crt_t, unsigned int,
unsigned char *, size_t *_size));
DEF_GNUTLS_FN (const char*, gnutls_sec_param_get_name, (gnutls_sec_param_t));
-DEF_GNUTLS_FN (const char*, gnutls_sign_algorithm_get_name,
+DEF_GNUTLS_FN (const char*, gnutls_sign_get_name,
(gnutls_sign_algorithm_t));
DEF_GNUTLS_FN (int, gnutls_server_name_set, (gnutls_session_t,
gnutls_server_name_type_t,
@@ -265,7 +265,8 @@ init_gnutls_functions (void)
LOAD_GNUTLS_FN (library, gnutls_x509_crt_get_signature);
LOAD_GNUTLS_FN (library, gnutls_x509_crt_get_key_id);
LOAD_GNUTLS_FN (library, gnutls_sec_param_get_name);
- LOAD_GNUTLS_FN (library, gnutls_sign_algorithm_get_name);
+ LOAD_GNUTLS_FN (library, gnutls_sign_get_name);
+ LOAD_GNUTLS_FN (library, gnutls_server_name_set);
max_log_level = global_gnutls_log_level;
@@ -337,7 +338,7 @@ init_gnutls_functions (void)
#define fn_gnutls_x509_crt_get_signature gnutls_x509_crt_get_signature
#define fn_gnutls_x509_crt_get_key_id gnutls_x509_crt_get_key_id
#define fn_gnutls_sec_param_get_name gnutls_sec_param_get_name
-#define fn_gnutls_sign_algorithm_get_name gnutls_sign_algorithm_get_name
+#define fn_gnutls_sign_get_name gnutls_sign_get_name
#define fn_gnutls_server_name_set gnutls_server_name_set
#endif /* !WINDOWSNT */
@@ -928,7 +929,7 @@ gnutls_certificate_details (gnutls_x509_crt_t cert)
err = fn_gnutls_x509_crt_get_signature_algorithm (cert);
if (err >= GNUTLS_E_SUCCESS)
{
- const char *name = fn_gnutls_sign_algorithm_get_name (err);
+ const char *name = fn_gnutls_sign_get_name (err);
if (name)
res = nconc2 (res, list2 (intern (":signature-algorithm"),
build_string (name)));
--
2.2.0
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19231
; Package
emacs
.
(Wed, 03 Dec 2014 14:42:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 19231 <at> debbugs.gnu.org (full text, mbox):
Chris Zheng <chriszheng99 <at> gmail.com> writes:
> I don't have older version, maybe we should ask for compatibility
> check. The revised patch is as follows.
Thanks; applied.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 03 Dec 2014 14:42:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 25.1, send any further explanations to
19231 <at> debbugs.gnu.org and Chris Zheng <chriszheng99 <at> gmail.com>
Request was from
Lars Magne Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 03 Dec 2014 14:42:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 01 Jan 2015 12:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 10 years and 230 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.