Skip to content

Use CCID when needed to connect to the nitrokey 3#398

Merged
sosthene-nitrokey merged 1 commit intoNitrokey:mainfrom
sosthene-nitrokey:ccid
Mar 11, 2026
Merged

Use CCID when needed to connect to the nitrokey 3#398
sosthene-nitrokey merged 1 commit intoNitrokey:mainfrom
sosthene-nitrokey:ccid

Conversation

@sosthene-nitrokey
Copy link
Contributor

@sosthene-nitrokey sosthene-nitrokey commented Jan 15, 2026

The approach taken is to instead of re-opening the connection for every command, we hold an exclusive CCID connection for the entire application, and never re-open it.

We can't use the same strategy as CTAHID because

  • When using an exclusive connection, re-opening one fails.
  • Closing and re-opening exclusive connections is not an option without major refactor to avoid having multiple connections opened at the same time.
  • When using a non-exclusive connection, security status changes such as pin validation will fail because operations over a key will not be using the same transaction.

@sosthene-nitrokey sosthene-nitrokey force-pushed the ccid branch 3 times, most recently from d03f6e2 to 6172942 Compare January 15, 2026 16:35
@sosthene-nitrokey sosthene-nitrokey marked this pull request as ready for review January 15, 2026 16:41
@sosthene-nitrokey sosthene-nitrokey requested review from daringer, mmerklinger and robin-nitrokey and removed request for daringer January 15, 2026 16:41
@robin-nitrokey
Copy link
Member

Note that this conflicts with #387 though it should not be too hard to resolve the conflicts.

@sosthene-nitrokey sosthene-nitrokey force-pushed the ccid branch 6 times, most recently from 33ab702 to c8a4854 Compare January 20, 2026 08:40
@sosthene-nitrokey
Copy link
Contributor Author

Tested to work properly on windows. Including the settings page. I think on Windows it's less likely to have something like gpg-agent running in the background to be in conflict for the PC/SC connection.

@sosthene-nitrokey
Copy link
Contributor Author

Just rebased on top of main. I still need to re-test on Windows to be sure it works.

@mmerklinger
Copy link
Member

Just tested on Windows Server 2025 and seems to work.

@sosthene-nitrokey sosthene-nitrokey force-pushed the ccid branch 3 times, most recently from a001527 to 96a238c Compare March 3, 2026 11:07
@mmerklinger
Copy link
Member

Is this ready to be merged?

@sosthene-nitrokey
Copy link
Contributor Author

Yes

@sosthene-nitrokey sosthene-nitrokey merged commit b6de2a0 into Nitrokey:main Mar 11, 2026
33 checks passed
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.

3 participants