Repository navigation
feat(keyring): update the saved password when the login password changes - #243
Merged
Merged
Conversation
pam_sm_chauthtok hands the new password to `biopass-keyring update`, which re-seals it (same PCR 7 binding) for users who saved one. The Debian/Ubuntu profile adds it as an optional "Additional" password rule; it always returns PAM_IGNORE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # auth/keyring/keyring_tool.cc # docs/Keyring.md
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.
Summary
When users changed their login password, the password saved for keyring unlock went stale until they saved it again in the app. Now
pam_sm_chauthtokpasses the new password tobiopass-keyring update. If the user has a saved password, that command seals the new one with the same PCR 7 binding.Closes # N/A / Discussion: none yet. This changes a PAM flow, so CLAUDE.md requires a linked discussion before merge.
Changes
pam_sm_chauthtokacts only onPAM_UPDATE_AUTHTOKwhen running as euid 0. It writesPAM_AUTHTOKto a pipe beforefork(). The child becomes full root, sends stdout/stderr to/dev/null, gets a fixed env, and execs/usr/libexec/biopass/biopass-keyring update <PAM_USER>. The wait useswaitForHelperwith a 30 s timeout. The function always returnsPAM_IGNORE. On failure it sends aPAM_ERROR_MSGunlessquietorPAM_SILENTis set.update USERsubcommand. It requires uid and euid 0 and refuses to run whenPKEXEC_UIDis set, so polkit can't reach it. With no saved password it exits 0 and does nothing. Otherwise it reads the PCR 7 flag from the existing sealed file, checks the new password against/etc/shadow, then seals and stores it.sealand the new path sharesealPassword(). The 2 s wrong-password delay stays onsealonly.Password-Type: Additional/optional libbiopass_pam.so. That puts it afterpam_unixβrequisite pam_denyβrequired pam_permitincommon-password, the same place aspam_gnome_keyring. Reviewers should check this first.usermod -p,chpasswd -e. PAM.md covers the manualpasswordline (Archsystem-auth) and Fedora'ssufficientpam_unix.Verification
Manual testing:
.deb/.rpm/AUR/source)Not tested: the full flow (save a password in the app β
passwdβ face login unlocks the keyring), GNOME Settings password change, andpam-auth-update --packageon upgrade. These need a VM with a TPM (swtpm). Per CLAUDE.md, PAM changes aren't tested on the host.Review report
/etc/pam.d/system-passwd, which Arch doesn't have. Changed tosystem-auth, with a note that arequiredpam_unixlets the line run after a failed change, where the shadow check rejects it.update./security-review). No findings.Risk
What could break, and for whom: Debian/Ubuntu users with the Biopass profile enabled get a new
optionalpassword rule. It always returnsPAM_IGNORE, so it can't block a password change. For users with a saved password,passwdcan take up to 30 s longer if the TPM hangs. Ifbiopass-keyring updatefails,passwdprints one extra error line.How to revert
git revertand a new release. On Debian/Ubuntu the upgrade'spam-auth-update --packagedrops thepasswordline fromcommon-password. Manual setups remove the line by hand.Checklist
π€ Generated with Claude Code