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
p11_child: do_card partially fix loop exit condition (redo of #5705) #5746
Conversation
…or token This commit fixes the exit condition when searching for a token in p11_child/do_card, specifically in case a token is present in a slot, but there are empty slots before it. This commit partially fixes issue #5025, thanks to this comment by @sumit-bose: #5025 (comment) :relnote: p11_child does not stop at the first empty slot when searching for tokens Co-Authored-By: Sumit Bose <sbose@redhat.com>
Hi, thanks for the patch, the commit message is looking good now. ACK bye, |
FYI this change breaks some existing assumptions in the code after it When this code is reached: sssd/src/p11_child/p11_child_openssl.c Lines 1777 to 1781 in 606daca
it will now exit if it did not find a removable slot with a token in it. So the wait_for_card handling right after it will never get executed:sssd/src/p11_child/p11_child_openssl.c Lines 1785 to 1797 in 606daca
|
Hi, thanks for the hint, I have to admit that I didn't test the patch with @assafmo, would you like to add a patch that fixes this? bye, |
Honestly I don't feel comfortable tinkering with this coee any more then I did. I can confirm that this patch did solve my issue and I was able to test it on multiple setups. |
Previously, the loop in do_card() would find the first PKCS#11 slot with support for removable tokens, whether or not a token was present. If one was not, and --wait_for_card was specified, then it would wait for a token to be inserted in this slot (or any slot in the same PKCS#11 module). Commit b9f8c2f ("p11_child: do_card partially fix loop exit condition when searching for token") changed the loop so it finds the first PKCS#11 slot that has a removable token present. Adjust this to allow the existing handling of --wait_for_card to work when no token is found. Fixes #5746. Reviewed-by: Sumit Bose <sbose@redhat.com>
This PR fixes the exit condition when searching for a token in p11_child/do_card, specifically in case a token is present in a slot, but there are empty slots before it.
This PR partially fixes issue #5025, thanks to this comment by @sumit-bose: #5025 (comment)
:relnote: p11_child does not stop at the first empty slot when searching for tokens
This PR is a redo of PR #5705, because it was orphaned and changes were requested by the maintainers.