Fix ignored GnuTLS options when SYSTEM priorities are unavailable - #1701
Open
Shubham-Padkonde wants to merge 2 commits into
Open
Shubham-Padkonde wants to merge 2 commits into
Shubham-Padkonde wants to merge 2 commits into
Conversation
Signed-off-by: Shubham Padkonde <shubhampadkonde12@gmail.com>
zdohnal
reviewed
Sep 18, 2026
|
|
||
| #ifdef HAVE_GNUTLS_PRIORITY_SET_DIRECT | ||
| gnutls_priority_set_direct(http->tls, priority_string, NULL); | ||
| status = gnutls_priority_set_direct(http->tls, priority_string, NULL); |
Member
There was a problem hiding this comment.
IMO it would be better to have the check for @System before we assign it into priority string, instead of handling it here, although it adds new set of HAVE_GNUTLS_PRIORITY_SET_DIRECT ifdef.
Just do not forget to initialize the string with NULL terminator in case of error, as I did :( .
Author
There was a problem hiding this comment.
Done in db6e871: @SYSTEM is now probed before the priority string is built (with set_direct or priority_init/deinit depending on HAVE_GNUTLS_PRIORITY_SET_DIRECT), priority_string is initialized to an empty string first, and the retry after failure is removed. test/testssloptions.py passes all 8 cases with GnuTLS 3.7.3 on both the set_direct and the priority_init code paths.
Probe @System first and only prepend it when it is configured, instead of retrying without it after the combined priority string fails. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When GnuTLS has no named
SYSTEMpriority,@SYSTEM,NORMAL:...is rejected: both names are interpreted as configured priorities, soNORMALis not a built-in fallback there. CUPS discards that error and can negotiate TLS 1.3 despiteMaxTLS1.2, or accept TLS 1.2 despiteMinTLS1.3.Retry an unresolved priority string without the
@SYSTEM,prefix, retaining the requested protocol and cipher options. Check the result in both the direct and legacy GnuTLS API paths and release the session/credentials if priority setup still fails. A valid named system policy andNoSystemretain their existing behavior.Add eight local TLS handshake checks and run them in the GnuTLS CI job. The tests create temporary certificates/configuration and compile a small client against the built CUPS library; they require Python 3, a C compiler, and the
opensslcommand. No external server or printer is contacted.Validation on Ubuntu 22.04, GCC 11.4 and GnuTLS 3.7.3:
gnutls_priority_set_directand withac_cv_func_gnutls_priority_set_direct=noto exercise the older API path.make testis not green in this environment: the external Google OIDC certificate-validation check fails and the scheduler reports 35 errors instead of 33 because Avahi is not running. The unchanged-source legacy-API build reproduces the same failures. Other scheduler command, restart and job-history checks pass.git diff --checkpass.This addresses the missing-system-policy part of #1677. The separate observation about the default maximum re-enabling protocols restricted by a valid system policy remains outside this patch, so this PR does not close the entire issue. macOS, Windows, physical printers, and older GnuTLS releases were not tested locally; the legacy API was exercised on GnuTLS 3.7.3.
Assisted by Codex/GPT-6 for investigation, coding, and validation.