Skip to content

Commit

Permalink
update PIV test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
z4yx committed Jul 6, 2024
1 parent 474c83e commit bd03713
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test-real/test-piv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ PIVSignDec() {
key=$1
pinArgs=
op=$3
algo=$4
inp_file=$TEST_TMP_DIR/cert-$key.pem
if [[ $key == X25519 ]]; then inp_file=$TEST_TMP_DIR/pubkey-$key.pem; fi
if [[ $algo == X25519 ]]; then inp_file=$TEST_TMP_DIR/pubkey-$key.pem; fi
if [[ -n "$2" ]]; then pinArgs="-P 654321 -a verify-pin"; fi
if [[ -z "$op" || s = "$op" ]]; then
YPT $pinArgs -a test-signature -s $key < $inp_file;
assertEquals 'yubico-piv-tool test-signature' 0 $?
fi
if [[ -z "$op" || d = "$op" ]]; then
YPT $pinArgs -a test-decipher -s $key < $inp_file;
YPT $pinArgs -a test-decipher -s $key -A $algo < $inp_file;
assertEquals 'yubico-piv-tool test-decipher' 0 $?
fi
}
Expand Down Expand Up @@ -120,8 +121,8 @@ ec_tests() {
for s in 9a 9c 9d 9e; do PIVGenKeyCert $s "/CN=CertAtSlot$s/" $1; done
YPT -a status
for s in 9a 9c 9d 9e; do
if [[ $1 != "X25519" ]]; then PIVSignDec $s 1 s; fi
if [[ $1 != "ED25519" ]]; then PIVSignDec $s 1 d; fi
if [[ $1 != "X25519" ]]; then PIVSignDec $s 1 s $1; fi
if [[ $1 != "ED25519" ]]; then PIVSignDec $s 1 d $1; fi
done
if [[ $1 != *25519 ]]; then
out=$(pkcs15-tool --reader "$RDID" --read-certificate 01 | openssl x509 -text)
Expand Down

0 comments on commit bd03713

Please sign in to comment.