Skip to content

krb5: fix OTP authentication#8296

Merged
justin-stephenson merged 2 commits into
SSSD:masterfrom
sumit-bose:krb5_fix_otp
Dec 11, 2025
Merged

krb5: fix OTP authentication#8296
justin-stephenson merged 2 commits into
SSSD:masterfrom
sumit-bose:krb5_fix_otp

Conversation

@sumit-bose

Copy link
Copy Markdown
Contributor

Resolves: #8292

@alexey-tikhonov alexey-tikhonov added the no-backport This should go to target branch only. label Dec 11, 2025

@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 fixes an issue with OTP authentication in the Kerberos provider. The change correctly sets the kr->otp flag in the request_otp function, which is called during pre-authentication when OTP is available. This fix is necessary to ensure the user is prompted for OTP. The logic is now consistent with the corresponding answer_otp function. The change is simple, targeted, and I find it to be correct.

@alexey-tikhonov

Copy link
Copy Markdown
Member

JFTR: instructions how to run FreeIPA tests for this patch.

@sumit-bose

Copy link
Copy Markdown
Contributor Author

JFTR: instructions how to run FreeIPA tests for this patch.

PR to run FreeIPA tests: freeipa/freeipa#8055

@ikerexxe

Copy link
Copy Markdown
Contributor

Added an additional commit to fix a related issue

Comment thread src/providers/krb5/krb5_child.c
@justin-stephenson justin-stephenson added the coverity Trigger a coverity scan label Dec 11, 2025
@justin-stephenson justin-stephenson added Accepted and removed coverity Trigger a coverity scan labels Dec 11, 2025
@justin-stephenson

Copy link
Copy Markdown
Contributor

Covscan is green.

sumit-bose and others added 2 commits December 11, 2025 16:19
Resolves: SSSD#8292
Reviewed-by: Justin Stephenson <[email protected]>
The `tokeninfo_matches()` function already handles PAM stacked tokens
correctly by processing them through the 2FA single path, so the
`answer_otp()` function should allow this token type to proceed.

Add SSS_AUTHTOK_TYPE_PAM_STACKED to the allowed authentication token
types in `answer_otp()` to restore previous functionality.

Fixes: 4cb99a2 ("krb5_child: advertise authentication methods").
Signed-off-by: Iker Pedrosa <[email protected]>
Reviewed-by: Justin Stephenson <[email protected]>
@sssd-bot

Copy link
Copy Markdown
Contributor

The pull request was accepted by @justin-stephenson with the following PR CI status:


🟢 CodeFactor (success)
🟢 CodeQL (success)
🟢 osh-diff-scan:fedora-rawhide-x86_64:upstream (success)
🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 rpm-build:fedora-41-x86_64:upstream (success)
🟢 rpm-build:fedora-42-x86_64:upstream (success)
🟢 rpm-build:fedora-43-x86_64:upstream (success)
🟢 rpm-build:fedora-rawhide-x86_64:upstream (success)
🟢 Analyze (target) / cppcheck (success)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)
🟢 ci / intgcheck (centos-10) (success)
🟢 ci / intgcheck (fedora-41) (success)
🟢 ci / intgcheck (fedora-42) (success)
🟢 ci / intgcheck (fedora-43) (success)
🟢 ci / intgcheck (fedora-44) (success)
🟢 ci / prepare (success)
🟡 ci / system (centos-10) (in_progress)
🟡 ci / system (fedora-41) (in_progress)
🟡 ci / system (fedora-42) (in_progress)
🟡 ci / system (fedora-43) (in_progress)
🟡 ci / system (fedora-44) (in_progress)
➖ Coverity scan / coverity (skipped)
🟢 Static code analysis / codeql (success)
🟢 Static code analysis / pre-commit (success)
🟢 Static code analysis / python-system-tests (success)


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

@justin-stephenson

justin-stephenson commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

@ikerexxe @sumit-bose This will need manual backport to sssd-2-9 after passworldess GDM patches are merged there, yes?

@alexey-tikhonov

Copy link
Copy Markdown
Member

@ikerexxe @sumit-bose This will need manual backport to sssd-2-9 after passworldess GDM patches are merged there, yes?

Imo, it can be included in open PR directly.

@justin-stephenson
justin-stephenson merged commit df15165 into SSSD:master Dec 11, 2025
18 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.

Test failure: ssh with OTP login in IPA environment

5 participants