Skip to content

Dennisdyallo/hid share mode #295

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

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

DennisDyallo
Copy link
Collaborator

Description

Please include a summary of the change and which issue is fixed, as well as relevant motivation and context. Finally, list any dependencies that are required for this change if any.

Fixes: # <link to issue(s)>

Type of change

  • Refactor (non-breaking change which improves code quality or performance)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Test configuration:

  • OS version: e.g. Windows 11
  • Firmware version: e.g. 5.7.2
  • Yubikey model1:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have run dotnet format to format my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Footnotes

  1. See Yubikey models (Multi-protocol, Security Key, FIPS, Bio, YubiHSM, YubiHSM FIPS)

@DennisDyallo DennisDyallo requested a review from Copilot August 11, 2025 18:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for configurable HID device sharing modes, allowing applications to open HID handles exclusively or in shared mode. The changes introduce a new compatibility switch for HID devices that mirrors the existing smart card functionality.

  • Adds new IOKit constants for HID device sharing options on macOS
  • Introduces OpenHidHandlesExclusively compatibility switch for HID devices
  • Refactors existing smart card sharing mode logic for better readability
  • Updates Windows HID connection to use consistent field naming conventions

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
IOKitHidConstants.cs Adds IOKit HID option constants for device sharing modes
DesktopSmartCardDevice.cs Refactors smart card share mode logic to use ternary operator
WindowsHidFeatureReportConnection.cs Updates field naming to use underscore prefix convention
MacOSHidIOReportConnection.cs Implements HID sharing mode based on new compatibility switch
CoreCompatSwitches.cs Adds new compatibility switch for HID handle exclusivity

Copy link

Test Results: Windows

    2 files      2 suites   9s ⏱️
3 905 tests 3 905 ✅ 0 💤 0 ❌
3 907 runs  3 907 ✅ 0 💤 0 ❌

Results for commit 34f596a.

Copy link

Test Results: Ubuntu

    2 files      2 suites   19s ⏱️
3 897 tests 3 897 ✅ 0 💤 0 ❌
3 899 runs  3 899 ✅ 0 💤 0 ❌

Results for commit 34f596a.

Copy link

Test Results: MacOS

    2 files      2 suites   10s ⏱️
3 897 tests 3 897 ✅ 0 💤 0 ❌
3 899 runs  3 899 ✅ 0 💤 0 ❌

Results for commit 34f596a.

Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
Yubico.Core 40% 31% 4377
Yubico.YubiKey 51% 46% 20712
Summary 49% (35550 / 72579) 44% (8709 / 19857) 25089

Minimum allowed line rate is 40%

@DennisDyallo
Copy link
Collaborator Author

the PR doesn't change/manage the open mode for Linux or Windows.. It couldve done so in a similar manner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant