C_Login can fail with CKR_USER_ALREADY_LOGGED_IN
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 170
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Description
This happens fairly reliably if, within a loop that looks like this:
while True:
try:
with pkcs11lib.get_token(/**/).open(/**/) as session:
key = session.get_key(/**/)
while True:
key.sign(/**/)
except Exception:
pass
you put the client (Mac in my case) computer to sleep while running an Amphetamine session or equivalent.
I don't think this is a common issue but when it does happen it may be good to workaround the issue gracefully.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the sleep-and-resume loop described in the issue and trace the C_Login path that encounters CKR_USER_ALREADY_LOGGED_IN. Check how this error is currently surfaced after a session interruption; done means the reported scenario is handled gracefully without leaving the loop unusable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100