Commit 3f4f29a
committed
Add tests for CTAP 2.2/2.3 EncCredStoreState and AuthenticatorConfigCommands
This commit adds comprehensive test coverage for the new CTAP 2.2/2.3
properties and methods:
Unit Tests (Fido2InfoTests.cs):
- Updated Decode_AuthenticatorInfo() to verify both new properties
- Added GetSampleEncoded() entries for EncCredStoreState (key 0x1E)
and AuthenticatorConfigCommands (key 0x1F)
- Added Decode_AuthenticatorConfigCommands_Correct() to validate
parsing of authenticator config command list
- Added Decode_NoAuthenticatorConfigCommands_Null() to verify null
handling when field is absent
- Added Decode_EncCredStoreState_Correct() to validate parsing of
encrypted credential store state
- Added Decode_NoEncCredStoreState_Null() to verify null handling
when field is absent
- Added CompareIntLists() helper method for integer list comparison
Integration Tests (Fido2Tests.cs):
- Added AuthenticatorInfo_GetCredStoreState_BothRuns_Returns_SameCredStoreState()
test that mirrors the GetIdentifier test pattern
- Verifies GetCredStoreState() decrypts credential store state correctly
using persistent PIN/UV auth token
- Tests that credential store state remains consistent across multiple
sessions with the same persistent token
- Requires YubiKey firmware 5.8.0+ and physical device for execution
The tests follow the same patterns as existing EncIdentifier tests,
ensuring consistency with the codebase testing standards.1 parent 2e96bf2 commit 3f4f29a
File tree
2 files changed
+121
-1
lines changed- Yubico.YubiKey/tests
- integration/Yubico/YubiKey/Fido2
- unit/Yubico/YubiKey/Fido2
2 files changed
+121
-1
lines changedLines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
75 | 110 | | |
76 | 111 | | |
77 | 112 | | |
| |||
Lines changed: 86 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
625 | 627 | | |
626 | 628 | | |
627 | 629 | | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
628 | 711 | | |
629 | 712 | | |
630 | 713 | | |
| |||
744 | 827 | | |
745 | 828 | | |
746 | 829 | | |
747 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
748 | 833 | | |
749 | 834 | | |
750 | 835 | | |
| |||
0 commit comments