From 5e5416923cb9929d7e030f6649261ed7ee4dc361 Mon Sep 17 00:00:00 2001 From: z4yx Date: Thu, 7 Nov 2024 23:01:34 +0800 Subject: [PATCH] more tests in test-piv.sh --- test-real/test-piv.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test-real/test-piv.sh b/test-real/test-piv.sh index 9f82e2eb..30960d5a 100755 --- a/test-real/test-piv.sh +++ b/test-real/test-piv.sh @@ -97,6 +97,9 @@ rsa_tests() { PIVSignDec 9e # PIN not required for key 9e for s in 9a 9c 9d; do PIVSignDec $s 1; done + if (( $1 == RSA2048 )); then + return + fi out=$(pkcs15-tool --reader "$RDID" --read-certificate 04 | openssl x509 -text) assertContains 'CERT' "$out" 'CN = CertAtSlot9e' echo -n hello >$TEST_TMP_DIR/hello.txt @@ -216,6 +219,10 @@ test_FactoryReset() { test_FillData() { openssl req -x509 -newkey rsa:4096 -keyout $TEST_TMP_DIR/key.pem -out $TEST_TMP_DIR/cert.pem -days 365 -nodes -subj "/CN=www.example.com" assertEquals 'openssl gen key' 0 $? + openssl rand -base64 -out $TEST_TMP_DIR/rand-pi 242 + YPT -a write-object --id 0x5fc109 -i $TEST_TMP_DIR/rand-pi -f base64 + YPT -a write-object --id 0x5fc108 -i $TEST_TMP_DIR/rand-pi -f base64 + YPT -a write-object --id 0x5fc103 -i $TEST_TMP_DIR/rand-pi -f base64 for s in 9a 9c 9d 9e 82 83; do PIVImportKeyCert $s $TEST_TMP_DIR/key.pem $TEST_TMP_DIR/cert.pem assertEquals 'import-key' 0 $?