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

Fixed incorrect management key algorithm used for FIPS in TryChangeManagementKey #162

Merged
merged 6 commits into from
Nov 18, 2024

Conversation

DennisDyallo
Copy link
Collaborator

@DennisDyallo DennisDyallo commented Nov 14, 2024

Description

The PivSession.ChangeManagementKey method was incorrectly assuming TripleDes as management key algorithm. This is now fixed.

Fixes: #160

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?

Had both FIPS and normal 5.7 keys. Ran the TryChangeManagementKey method and reproduced and fixed the bug.

Test configuration:

  • OS version: Windows 11
  • Firmware version: 5.7.2, 5.4.3
  • Yubikey model1:
    Normal 5 Multiprotocol, FIPS

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)

…lgorithm handling

Update management key algorithm refresh • Add FIPS-specific test cases • Enhance test coverage for key changes • Adjust for firmware version differences
@DennisDyallo DennisDyallo added bug Something isn't working known issue Used to indicate known issues by Yubico labels Nov 14, 2024
@DennisDyallo DennisDyallo self-assigned this Nov 14, 2024
@DennisDyallo DennisDyallo marked this pull request as ready for review November 14, 2024 15:26
@DennisDyallo DennisDyallo requested a review from AdamVe November 14, 2024 15:27
Copy link
Member

@AdamVe AdamVe left a comment

Choose a reason for hiding this comment

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

The PR looks good, please check my comments.

Copy link

Test Results: Windows

    2 files      2 suites   4s ⏱️
3 703 tests 3 703 ✅ 0 💤 0 ❌
3 705 runs  3 705 ✅ 0 💤 0 ❌

Results for commit 9de0750.

Copy link

Test Results: Ubuntu

    2 files      2 suites   10s ⏱️
3 695 tests 3 695 ✅ 0 💤 0 ❌
3 697 runs  3 697 ✅ 0 💤 0 ❌

Results for commit 9de0750.

Copy link

Test Results: MacOS

    2 files      2 suites   4s ⏱️
3 695 tests 3 695 ✅ 0 💤 0 ❌
3 697 runs  3 697 ✅ 0 💤 0 ❌

Results for commit 9de0750.

Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
Yubico.Core 43% 32% 4221
Yubico.YubiKey 50% 47% 19155
Summary 49% (32222 / 66084) 44% (8191 / 18579) 23376

Minimum allowed line rate is 40%

@DennisDyallo DennisDyallo merged commit ff022c6 into develop Nov 18, 2024
12 checks passed
@DennisDyallo DennisDyallo deleted the dennisdyallo/bugfix/160-default-mgmtkey branch November 18, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working known issue Used to indicate known issues by Yubico
3 participants