Use OpenSSL provider with BIND for Fedora 41+ and RHEL10+#103
Open
abbra wants to merge 2 commits into
Open
Conversation
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
OpenSSL Engine API is deprecated and ability to compile against it is removed in RHEL10. OpenSSL provider API is the future. Fedora 41+ also defaults to OpenSSL provider. With pkcs11-provider, the same PKCS#11 modules can be loaded transparently like with OpenSSL engines. Thus, we can update configuration to use the provider API. TODO: - dnssec-keyfromlabel does not work without engine, needs backport from bind 9.20 Fixes: https://pagure.io/freeipa/issue/9696 Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewer's Guide by SourceryThis pull request introduces support for the OpenSSL provider API in BIND configuration for Fedora 41+ and RHEL 10+. It modifies the configuration setup, named sysconfig, dnssec-keyfromlabel command, and upgrade process to accommodate the transition from the OpenSSL engine to the provider API. New configuration templates are added for the OpenSSL provider. Sequence diagram for setting up OpenSSL config for BIND with provider APIsequenceDiagram
participant dnskeysyncd
participant ipautil
participant directivesetter
dnskeysyncd->>dnskeysyncd: setup_named_openssl_conf()
alt constants.NAMED_OPENSSL_PROVIDER is not None
dnskeysyncd->>ipautil: template_file(bind.openssl.provider.cnf.template, conf_file_dict)
ipautil-->>dnskeysyncd: named_openssl_txt
end
dnskeysyncd->>dnskeysyncd: setup_named_sysconfig()
alt constants.NAMED_OPENSSL_PROVIDER is not None
dnskeysyncd->>directivesetter: set_directive(sysconfig, OPENSSL_CONF, paths.DNSSEC_OPENSSL_CONF)
end
dnskeysyncd->>dnskeysyncd: setup_ipa_dnskeysyncd_sysconfig()
alt constants.NAMED_OPENSSL_PROVIDER is not None
dnskeysyncd->>directivesetter: set_directive(sysconfig, OPENSSL_CONF, paths.DNSSEC_OPENSSL_CONF)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @abbra - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider using a helper function to encapsulate the logic for setting directives in
setup_named_sysconfigandsetup_ipa_dnskeysyncd_sysconfigto reduce code duplication. - The logic for removing '-E pkcs11' from options could be simplified by using
str.replace.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| ) | ||
| uri = None | ||
| if platformconstants.NAMED_OPENSSL_ENGINE is not None: | ||
| uri = "%s;pin-source=%s" % ( |
There was a problem hiding this comment.
issue (code-quality): Replace interpolated string formatting with f-string [×5] (replace-interpolation-with-fstring)
| if constants.NAMED_OPENSSL_ENGINE is not None: | ||
| if any([constants.NAMED_OPENSSL_ENGINE is not None, | ||
| constants.NAMED_OPENSSL_PROVIDER is not None]): | ||
| directivesetter.set_directive( |
There was a problem hiding this comment.
issue (code-quality): We've found these issues:
- Extract code out into method (
extract-method) - Replace call to format with f-string (
use-fstring-for-formatting)
167ae25 to
6796986
Compare
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.
OpenSSL Engine API is deprecated and ability to compile against it is removed in RHEL10. OpenSSL provider API is the future.
Fedora 41+ also defaults to OpenSSL provider. With pkcs11-provider, the same PKCS#11 modules can be loaded transparently like with OpenSSL engines. Thus, we can update configuration to use the provider API.
TODO:
Fixes: https://pagure.io/freeipa/issue/9696
Summary by Sourcery
This pull request updates the configuration to use the OpenSSL provider API instead of the deprecated OpenSSL Engine API for BIND on Fedora 41+ and RHEL 10+.
Enhancements: