libcurl-gnutls: update to version 8.5.0
[feed/packages.git] / net / libcurl-gnutls / patches / 0001-gnutls-fix-build-with-disable-verbose.patch
1 From af520ac9fec7d88e942f05fdcd90704adb9fa566 Mon Sep 17 00:00:00 2001
2 From: Baruch Siach <baruch@tkos.co.il>
3 Date: Mon, 11 Dec 2023 20:45:01 +0200
4 Subject: [PATCH] gnutls: fix build with --disable-verbose
5
6 infof() parameters must be defined event with --disable-verbose since
7 commit dac293cfb702 ("lib: apache style infof and trace
8 macros/functions").
9
10 Move also 'ptr' definition under !CURL_DISABLE_VERBOSE_STRINGS.
11
12 Fixes the following build failure:
13
14 In file included from ../lib/sendf.h:29,
15 from vtls/gtls.c:44:
16 vtls/gtls.c: In function 'Curl_gtls_verifyserver':
17 vtls/gtls.c:841:34: error: 'version' undeclared (first use in this function); did you mean 'session'?
18 841 | gnutls_protocol_get_name(version), ptr);
19 | ^~~~~~~
20
21 Closes #12505
22 ---
23 lib/vtls/gtls.c | 4 +++-
24 1 file changed, 3 insertions(+), 1 deletion(-)
25
26 --- a/lib/vtls/gtls.c
27 +++ b/lib/vtls/gtls.c
28 @@ -822,16 +822,17 @@ Curl_gtls_verifyserver(struct Curl_easy
29 char certname[65] = ""; /* limited to 64 chars by ASN.1 */
30 size_t size;
31 time_t certclock;
32 - const char *ptr;
33 int rc;
34 CURLcode result = CURLE_OK;
35 #ifndef CURL_DISABLE_VERBOSE_STRINGS
36 + const char *ptr;
37 unsigned int algo;
38 unsigned int bits;
39 gnutls_protocol_t version = gnutls_protocol_get_version(session);
40 #endif
41 long * const certverifyresult = &ssl_config->certverifyresult;
42
43 +#ifndef CURL_DISABLE_VERBOSE_STRINGS
44 /* the name of the cipher suite used, e.g. ECDHE_RSA_AES_256_GCM_SHA384. */
45 ptr = gnutls_cipher_suite_get_name(gnutls_kx_get(session),
46 gnutls_cipher_get(session),
47 @@ -839,6 +840,7 @@ Curl_gtls_verifyserver(struct Curl_easy
48
49 infof(data, "SSL connection using %s / %s",
50 gnutls_protocol_get_name(version), ptr);
51 +#endif
52
53 /* This function will return the peer's raw certificate (chain) as sent by
54 the peer. These certificates are in raw format (DER encoded for