Skip to content

tls-gnutls.c: Use system crypto policy if available - #1105

Merged
zdohnal merged 1 commit into
OpenPrinting:masterfrom
zdohnal:apply-system-crypto
Dec 6, 2024
Merged

tls-gnutls.c: Use system crypto policy if available#1105
zdohnal merged 1 commit into
OpenPrinting:masterfrom
zdohnal:apply-system-crypto

Conversation

@zdohnal

@zdohnal zdohnal commented Dec 4, 2024

Copy link
Copy Markdown
Member

Some Linux systems provide a way how to control cryptography on system or service level via cryptographic policies. OpenSSL implementation reflects system changes to some degree, however GnuTLS implementation does not take system policy into account.

GnuTLS supports fallback mechanism, so we can fallback to NORMAL if @System is not defined on the system.

Fortunately, the current GnuTLS implementation allows overrides via priority strings (so no "this cipher/hash is disabled" if we enabled them in our application by priority string), so allowing to honor system policy can save us work if someone wants to disable a specific cipher, so we don't have to implement it in libcups.

Some Linux systems provide a way how to control cryptography on system
or service level via cryptographic policies. OpenSSL implementation
reflects system changes to some degree, however GnuTLS implementation
does not take system policy into account.

GnuTLS supports fallback mechanism, so we can fallback to NORMAL if
@System is not defined on the system.

Fortunately, the current GnuTLS implementation allows overrides via
priority strings (so no "this cipher/hash is disabled" if we enabled
them in our application by priority string), so allowing to honor system
policy can save us work if someone wants to disable a specific cipher,
so we don't have to implement it in libcups.
@zdohnal
zdohnal requested a review from michaelrsweet December 4, 2024 18:27

@michaelrsweet michaelrsweet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't see "@System" documented explicitly in the GNU TLS docos, but "@Keyword" is allowed so I have no hard objection.

@zdohnal

zdohnal commented Dec 6, 2024

Copy link
Copy Markdown
Member Author

@michaelrsweet I saw both cases in https://gnutls.org/manual/html_node/Priority-Strings.html , but "SYSTEM" did not work as intended (it somehow replaced all other priority strings and our changes in implementation did not matter), but "@System" did the trick the way I expected - the cipher list stayed the same for specific SSLOptions, only the ciphers disabled by crypto policy were missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants