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

Drop workarounds for GnuTLS <3.4.6 #3790

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions lib/common/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ pcmk__free_tls(pcmk__tls_t *tls)

free(tls);
tls = NULL;

gnutls_global_deinit();
}

int
Expand All @@ -190,14 +188,6 @@ pcmk__init_tls(pcmk__tls_t **tls, bool server, gnutls_credentials_type_t cred_ty

signal(SIGPIPE, SIG_IGN);

/* gnutls_global_init is safe to call multiple times, but we have to call
* gnutls_global_deinit the same number of times for that function to do
* anything.
*
* FIXME: When we can use gnutls >= 3.3.0, we don't have to call
* gnutls_global_init anymore.
*/
gnutls_global_init();
gnutls_global_set_log_level(8);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're here, can you also add a comment to remind us to not bump the log level beyond 8, since higher levels can log sensitive information? I should have done this when I added the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

gnutls_global_set_log_function(_gnutls_log_func);

Expand Down
4 changes: 3 additions & 1 deletion lib/common/utils.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2024 the Pacemaker project contributors
* Copyright 2004-2025 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
Expand Down Expand Up @@ -445,6 +445,8 @@ pcmk__timeout_ms2s(guint timeout_ms)
// Deprecated functions kept only for backward API compatibility
// LCOV_EXCL_START

#include <gnutls/gnutls.h> // gnutls_global_init(), etc.

#include <crm/common/util_compat.h>

static void
Expand Down