Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up connections #88

Merged
merged 2 commits into from
Dec 16, 2021
Merged

Clean up connections #88

merged 2 commits into from
Dec 16, 2021

Conversation

smlx
Copy link
Owner

@smlx smlx commented Dec 16, 2021

Previously piv-agent would sometimes get into a state where an exclusive connection to the card blocked access

{"card": "Yubico YubiKey FIDO+CCID 01 00", "error": "couldn't open card \"Yubico YubiKey FIDO+CCID 01 00\": connecting to smart card: the smart card cannot be accessed because of other connections outstanding"}

This seemed to happen after an idle timeout and restart.

According to the pcsc-lite documentation the context should always be released. So this PR makes sure to do so in ServeCmd.Run().

smlx added 2 commits December 16, 2021 10:03
This fixes a bug where if piv-agent exited due to an idle or exit timer
then connections to the card were left in pcscd, and then when piv-agent
started up again it couldn't (re)open the card.
@smlx smlx added the bug Something isn't working label Dec 16, 2021
@smlx smlx enabled auto-merge December 16, 2021 02:09
@smlx smlx merged commit a9ed224 into main Dec 16, 2021
@smlx smlx deleted the cleanup-connections branch December 16, 2021 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant