Skip to content

Commit

Permalink
increase test coverage of PIV applet
Browse files Browse the repository at this point in the history
  • Loading branch information
z4yx committed Jan 4, 2025
1 parent bc34eeb commit e9fc4c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ jobs:
# change the algorithm identifier of ED25519
piv-tool --admin M:9B:03 -s '00 EE 02 00 07 01 22 05 51 52 53 54' | grep 'SW1=0x90, SW2=0x00' # PIV_INS_ALGORITHM_EXTENSION, Yubico
piv-tool --admin M:9B:03 -s '00 EE 01 00 10' | grep '01 22 05 51 52 53 54'
cd piv-go; go test -v ./piv --wipe-yubikey; cd -
piv-tool --admin M:9B:03 -s '00 EE 02 00 07 01 E0 05 16 E1 53 54' | grep 'SW1=0x90, SW2=0x00' # PIV_INS_ALGORITHM_EXTENSION, Yubico
Expand Down Expand Up @@ -456,6 +457,9 @@ jobs:
yubico-piv-tool -r "$RDID" -a generate -A ECCP256 -s 9e
yubico-piv-tool -r "$RDID" -a generate -A X25519 -s 82 > /tmp/pubkey-9e.pem
yubico-piv-tool -r "$RDID" -a test-decipher -s 9e -A X25519 </tmp/pubkey-9e.pem 2>&1 | grep "Failed ECDH exchange"; # Wrong slot
yubico-piv-tool -r "$RDID" -a test-decipher -s 84 -A X25519 </tmp/pubkey-9e.pem 2>&1 | grep "Failed ECDH exchange"; # Unsupported slot
opensc-tool -r "$RDID" -s '00 24 00 01 02 00 00' | grep 'SW1=0x6A, SW2=0x88' # change ref data, not found
opensc-tool -r "$RDID" -s '00 87 FF 9B 02 00 00' | grep 'SW1=0x6A, SW2=0x80' # general auth, invalid P1
## RSA tests
for s in 9a 9c 9d 9e 82 83; do PIVGenKeyCert $s "/CN=CertAtSlot$s/" RSA3072; done
yubico-piv-tool -r "$RDID" -a status
Expand Down
1 change: 1 addition & 0 deletions virt-card/fabrication.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ int card_fs_init(const char *lfs_root) {
int card_fabrication_procedure(const char *lfs_root) {
if (card_fs_init(lfs_root)) return 1;
init_apdu_buffer();
device_init();
applets_install();

// reset state of applets
Expand Down

0 comments on commit e9fc4c9

Please sign in to comment.