Skip to content

[autobackport: sssd-2-13] krb5: restart krb5_child for Smartcard authentication#8700

Merged
alexey-tikhonov merged 1 commit into
SSSD:sssd-2-13from
sssd-bot:SSSD-sssd-backport-pr8629-to-sssd-2-13
May 12, 2026
Merged

[autobackport: sssd-2-13] krb5: restart krb5_child for Smartcard authentication#8700
alexey-tikhonov merged 1 commit into
SSSD:sssd-2-13from
sssd-bot:SSSD-sssd-backport-pr8629-to-sssd-2-13

Conversation

@sssd-bot

Copy link
Copy Markdown
Contributor

This is an automatic backport of PR#8629 krb5: restart krb5_child for Smartcard authentication to branch sssd-2-13, created by @sumit-bose.

Please make sure this backport is correct.

Note

The commits were cherry-picked without conflicts.

You can push changes to this pull request

git remote add sssd-bot git@github.com:sssd-bot/sssd.git
git fetch sssd-bot refs/heads/SSSD-sssd-backport-pr8629-to-sssd-2-13
git checkout SSSD-sssd-backport-pr8629-to-sssd-2-13
git push sssd-bot SSSD-sssd-backport-pr8629-to-sssd-2-13 --force

Original commits
f3a36be - krb5: restart krb5_child for Smartcard authentication

Backported commits

  • 372d189 - krb5: restart krb5_child for Smartcard authentication

Original Pull Request Body

In contrast to other authentication methods for PKINIT some information about the used Smartcard and certificate are already needed for the pre-authentication step to trigger the MIT Kerberos PKINIT module to get back the information if PKINIT is possible or not and if the Smartcard can be used for authentication. If krb5_child is kept running between the pre-authentication and the authentication step the information given during pre-authentication is used if Smartcard authentication was selected.

As long as only a single certificate is available there is no issue. But if there are multiple certificates which all apply to the given mapping and matching rules for the user trying to log in and the user can choose a certificate for authentication the authentication might fail if the certificate use during pre-authentication and the one selected by the user differ. Before the change to keep krb5_child running for all authentication methods this was not an issue since the fresh instance started during the authentication step was using the certificate selected by the user.

With this patch krb5_child is restart during the authentication step is Smartcard authentication was selected.

@alexey-tikhonov alexey-tikhonov added the no-backport This should go to target branch only. label May 12, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the Kerberos authentication provider in src/providers/krb5/krb5_auth.c to restart the krb5_child process during Smartcard authentication if a different certificate is selected. The change introduces a check to terminate the existing child process when a Smartcard authentication token is used during a PAM authentication command, ensuring the correct certificate is processed. I have no feedback to provide as there were no review comments to evaluate.

In contrast to other authentication methods for PKINIT some information
about the used Smartcard and certificate are already needed for the
pre-authentication step to trigger the MIT Kerberos PKINIT module to get
back the information if PKINIT is possible or not and if the Smartcard
can be used for authentication. If krb5_child is kept running between
the pre-authentication and the authentication step the information given
during pre-authentication is used if Smartcard authentication was
selected.

As long as only a single certificate is available there is no issue. But
if there are multiple certificates which all apply to the given mapping
and matching rules for the user trying to log in and the user can choose
a certificate for authentication the authentication might fail if the
certificate use during pre-authentication and the one selected by the
user differ. Before the change to keep krb5_child running for all
authentication methods this was not an issue since the fresh instance
started during the authentication step was using the certificate
selected by the user.

With this patch krb5_child is restart during the authentication step is
Smartcard authentication was selected.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Justin Stephenson <jstephen@redhat.com>
(cherry picked from commit f3a36be)
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
@sssd-bot

Copy link
Copy Markdown
Contributor Author

The pull request was accepted by @alexey-tikhonov with the following PR CI status:


🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 rpm-build:fedora-42-x86_64:upstream (success)
🟢 rpm-build:fedora-43-x86_64:upstream (success)
🟢 rpm-build:fedora-44-x86_64:upstream (success)
🟢 rpm-build:fedora-rawhide-x86_64:upstream (success)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)


There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging.

@sssd-bot sssd-bot force-pushed the SSSD-sssd-backport-pr8629-to-sssd-2-13 branch from 372d189 to a9b7bcc Compare May 12, 2026 16:08
@alexey-tikhonov alexey-tikhonov merged commit 22ee184 into SSSD:sssd-2-13 May 12, 2026
3 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accepted no-backport This should go to target branch only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants