From d0f068729727942d3e05e31a0955616fe12004d1 Mon Sep 17 00:00:00 2001 From: z4yx Date: Fri, 3 Jan 2025 13:33:28 +0800 Subject: [PATCH] test error handling --- .github/workflows/tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dcba439d..f45f3f9e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -451,10 +451,17 @@ jobs: for s in 9a 9c 9d 9e 82 83; do PIVGenKeyCert $s "/CN=CertAtSlot$s/" X25519; done yubico-piv-tool -r "$RDID" -a status for s in 9a 9c 9d 9e 82 83; do PIVSignDec $s 1 d X25519; done + ## Error tests + yubico-piv-tool -r "$RDID" -a generate -A RSA2048 -s 84 2>&1 | grep "Key generation failed"; # Unsupported slot + 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 &1 | grep "Failed ECDH exchange"; # Wrong slot ## 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 for s in 9a 9c 9d 9e 82 83; do PIVSignDec $s 1; done for s in 9a 9c 9d 9e 82 83; do PIVGenKeyCert $s "/CN=CertAtSlot$s/" RSA4096; done + yubico-piv-tool -r "$RDID" -a status for s in 9a 9c 9d 9e 82 83; do PIVSignDec $s 1; done for s in 9a 9c 9d 9e 82 83; do PIVGenKeyCert $s "/CN=CertAtSlot$s/" RSA2048; done yubico-piv-tool -r "$RDID" -a status