Skip to content

fix: Improve detection logic for NativeShims in 32 and 64 bit cases #284

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

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

Conversation

DennisDyallo
Copy link
Collaborator

@DennisDyallo DennisDyallo commented Jul 31, 2025

This pull request refines the logic for determining the native shims path in the Net47Implementation class by incorporating both OS architecture and process bitness. This change improves accuracy and robustness when selecting the appropriate directory for native shims.

Key change:

  • Yubico.Core/src/Yubico/PlatformInterop/Libraries.Net47.cs: Updated the NativeShimsPath property to use a tuple of RuntimeInformation.OSArchitecture and Environment.Is64BitProcess for more precise handling of architecture and process bitness. This ensures that 32-bit processes on 64-bit systems are correctly mapped to the "x86" directory.

Fixes: #193

Copy link

github-actions bot commented Jul 31, 2025

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 f6966ff.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 31, 2025

Test Results: Ubuntu

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

Results for commit f6966ff.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 31, 2025

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 f6966ff.

♻️ This comment has been updated with latest results.

@DennisDyallo DennisDyallo requested a review from Copilot July 31, 2025 12:14
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 improves the native shims path detection logic in the Net47Implementation class by considering both OS architecture and process bitness. The change ensures that 32-bit processes running on 64-bit systems are correctly mapped to the "x86" directory, providing more accurate architecture detection.

Key changes:

  • Updated NativeShimsPath property to use a tuple-based pattern matching approach
  • Incorporated both RuntimeInformation.OSArchitecture and Environment.Is64BitProcess for precise directory selection
  • Improved error message formatting by removing extra space

Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
Yubico.Core 40% 31% 4371
Yubico.YubiKey 51% 46% 20712
Summary 49% (35547 / 72561) 44% (8709 / 19851) 25083

Minimum allowed line rate is 40%

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.

[BUG] (NET47) The SDK does not correctly output Yubico.NativeShims.dll when targeting x86 or x64 for NET47
1 participant