Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtls: Fixed compilation when GnuTLS < 3.5.0 #4984

Closed

Conversation

@captain-caveman2k
Copy link
Member

@captain-caveman2k captain-caveman2k commented Feb 27, 2020

Commit 41fcb4f from #4958 breaks compiling with GnuTLS older than 3.5.0 (Specifically 3.4.10) with the following error:

/curl/lib/vtls/gtls.c:667:32: error: 'GNUTLS_FORCE_CLIENT_CERT' undeclared (first use in this function)
init_flags = GNUTLS_CLIENT | GNUTLS_FORCE_CLIENT_CERT;

See this autobuild for more details.

With this fix, curl builds successfully and executes runtest.pl with the following summary:

Warning: dict server unexpectedly alive
Warning: smb server unexpectedly alive
TESTDONE: 1247 tests out of 1247 reported OK: 100%
TESTDONE: 1319 tests were considered during 462 seconds.
make[1]: Leaving directory '/home/steve/Development/cc2k/tests'
@jay
Copy link
Member

@jay jay commented Feb 27, 2020

LGTM except the commit subject should be in the imperative. travis isn't showing in the CI not sure what that's about.

@bagder
bagder approved these changes Feb 27, 2020
init_flags = GNUTLS_CLIENT | GNUTLS_FORCE_CLIENT_CERT;
init_flags = GNUTLS_CLIENT;

#if defined(GNUTLS_FORCE_CLIENT_CERT)

This comment has been minimized.

@bagder

bagder Feb 27, 2020
Member

Maybe just do #ifdef as that's how we normally check for the presence of a single define.

This comment has been minimized.

@captain-caveman2k

captain-caveman2k Feb 27, 2020
Author Member

Whilst I'm the first to admit that I'm a fully fledged member of the #if everywhere club, I do "try" and use the style of the code that is around me.

As such I noted the following on line 673 and kept the styling the same:

#if defined(GNUTLS_NO_TICKETS)

This comment has been minimized.

@bagder

bagder Feb 27, 2020
Member

I think "fixing the code while changing it" is better than sticking to the "wrong" style...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.