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

Implement abort handling #5

Merged
merged 1 commit into from
Jan 31, 2023
Merged

Conversation

robin-nitrokey
Copy link
Member

Previously, we just panicked when receiving an abort request. This caused a long delay in scdaemon/gnupg when the NK3 was connected. With this patch, we add abort handling to usb-ccid to fix this issue.

The implementation is based on Section 5.3.1 of the CCID specification [0]. The device is expected to send two abort messages, one over the bulk endpoint and one over the control pipe. We perform the abort once we have received both messages. In the time between receiving the first and the second message, we reject all incoming messages on the bulk endpoint.

[0] https://www.usb.org/sites/default/files/DWG_Smart-Card_CCID_Rev110.pdf

Previously, we just panicked when receiving an abort request.  This
caused a long delay in scdaemon/gnupg when the NK3 was connected.  With
this patch, we add abort handling to usb-ccid to fix this issue.

The implementation is based on Section 5.3.1 of the CCID specification
[0].  The device is expected to send two abort messages, one over the
bulk endpoint and one over the control pipe.  We perform the abort once
we have received both messages.  In the time between receiving the first
and the second message, we reject all incoming messages on the bulk
endpoint.

[0] https://www.usb.org/sites/default/files/DWG_Smart-Card_CCID_Rev110.pdf
Copy link
Contributor

@sosthene-nitrokey sosthene-nitrokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@robin-nitrokey robin-nitrokey merged commit 7de7b41 into trussed-dev:main Jan 31, 2023
@robin-nitrokey robin-nitrokey deleted the abort branch January 31, 2023 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants