Skip to content

gnutls: fix building with older supported GnuTLS versions#18335

Closed
vszakats wants to merge 10 commits into
curl:masterfrom
vszakats:gnutls-fix
Closed

gnutls: fix building with older supported GnuTLS versions#18335
vszakats wants to merge 10 commits into
curl:masterfrom
vszakats:gnutls-fix

Conversation

@vszakats

@vszakats vszakats commented Aug 21, 2025

Copy link
Copy Markdown
Member

Also:

  • GHA/linux-old: switch jobs from OpenSSL 1.0.2 to GnuTLS 3.5.8.

Ref: https://gitlab.com/gnutls/gnutls/blob/master/NEWS
Follow-up to fa0ccd9 #15774
Follow-up to 68bd759 #15667
Cherry-picked from #18330


w/o sp https://github.com/curl/curl/pull/18335/files?w=1

@vszakats vszakats added TLS CI Continuous Integration labels Aug 21, 2025
@vszakats
vszakats requested a review from icing August 21, 2025 11:02
@vszakats
vszakats marked this pull request as draft August 21, 2025 11:50
@vszakats

This comment was marked as resolved.

@bagder

bagder commented Aug 21, 2025

Copy link
Copy Markdown
Member

The failing test is TestDownload::test_02_32_earlydata and since this version is too old for early data support, maybe we should just not run the test there? @icing

@icing

icing commented Aug 21, 2025

Copy link
Copy Markdown
Contributor

we could add something like

        if env.curl_uses_lib('gnutls') and \
           not env.curl_lib_version_at_least('gnutls', '3.6.0'):
            pytest.skip('gnutls does not support early data before 3.6.0')

replace 3.6.0 with whatever version this has.

@vszakats

Copy link
Copy Markdown
Member Author

Added that to pytest, though a bit differently. Also found the wrong guard causing the CI fail.

@vszakats
vszakats marked this pull request as ready for review August 21, 2025 13:48
@testclutch

This comment was marked as resolved.

```
/__w/curl/curl/lib/vtls/gtls.c: In function 'Curl_gtls_cache_session':
/__w/curl/curl/lib/vtls/gtls.c:693:19: error: implicit declaration of function 'gnutls_record_get_max_early_data_size' [-Wimplicit-function-declaration]
   earlydata_max = gnutls_record_get_max_early_data_size(session);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/__w/curl/curl/lib/vtls/gtls.c:693:3: error: nested extern declaration of 'gnutls_record_get_max_early_data_size' [-Werror=nested-externs]
   earlydata_max = gnutls_record_get_max_early_data_size(session);
   ^~~~~~~~~~~~~
/__w/curl/curl/lib/vtls/gtls.c: In function 'Curl_glts_get_ietf_proto':
/__w/curl/curl/lib/vtls/gtls.c:730:8: error: 'GNUTLS_TLS1_3' undeclared (first use in this function)
   case GNUTLS_TLS1_3:
        ^~~~~~~~~~~~~
/__w/curl/curl/lib/vtls/gtls.c:730:8: note: each undeclared identifier is reported only once for each function it appears in
/__w/curl/curl/lib/vtls/gtls.c: In function 'gtls_client_init':
/__w/curl/curl/lib/vtls/gtls.c:887:19: error: 'GNUTLS_ENABLE_EARLY_DATA' undeclared (first use in this function)
     init_flags |= GNUTLS_ENABLE_EARLY_DATA | GNUTLS_NO_END_OF_EARLY_DATA;
                   ^~~~~~~~~~~~~~~~~~~~~~~~
/__w/curl/curl/lib/vtls/gtls.c:887:46: error: 'GNUTLS_NO_END_OF_EARLY_DATA' undeclared (first use in this function)
     init_flags |= GNUTLS_ENABLE_EARLY_DATA | GNUTLS_NO_END_OF_EARLY_DATA;
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/__w/curl/curl/lib/vtls/gtls.c: In function 'Curl_gtls_ctx_init':
/__w/curl/curl/lib/vtls/gtls.c:1164:5: error: implicit declaration of function 'gnutls_session_set_keylog_function' [-Wimplicit-function-declaration]
     gnutls_session_set_keylog_function(gctx->session, keylog_callback);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/__w/curl/curl/lib/vtls/gtls.c:1164:5: error: nested extern declaration of 'gnutls_session_set_keylog_function' [-Werror=nested-externs]
/__w/curl/curl/lib/vtls/gtls.c: In function 'gtls_verifyserver':
/__w/curl/curl/lib/vtls/gtls.c:1798:45: error: 'GNUTLS_TLS1_3' undeclared (first use in this function)
   if(gnutls_protocol_get_version(session) < GNUTLS_TLS1_3)
                                             ^~~~~~~~~~~~~
/__w/curl/curl/lib/vtls/gtls.c: In function 'gtls_send_earlydata':
/__w/curl/curl/lib/vtls/gtls.c:1819:9: error: implicit declaration of function 'gnutls_record_send_early_data' [-Wimplicit-function-declaration]
     n = gnutls_record_send_early_data(backend->gtls.session, buf, blen);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/__w/curl/curl/lib/vtls/gtls.c:1819:5: error: nested extern declaration of 'gnutls_record_send_early_data' [-Werror=nested-externs]
     n = gnutls_record_send_early_data(backend->gtls.session, buf, blen);
     ^
/__w/curl/curl/lib/vtls/gtls.c: In function 'gtls_connect_common':
/__w/curl/curl/lib/vtls/gtls.c:1926:10: error: 'GNUTLS_SFLAGS_EARLY_DATA' undeclared (first use in this function)
          GNUTLS_SFLAGS_EARLY_DATA) ?
          ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration tests TLS

Development

Successfully merging this pull request may close these issues.

4 participants