Skip to content

Commit 08fbf3e

Browse files
committed
Make tdefaultslot to test stored pubkey slot
1 parent 4a35420 commit 08fbf3e

5 files changed

Lines changed: 9 additions & 358 deletions

File tree

tests/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ test_programs = {
105105
'treadkeys': ['treadkeys.c'],
106106
'tcmpkeys': ['tcmpkeys.c', 'util.c'],
107107
'tfork': ['tfork.c', 'util.c'],
108-
'trefresh': ['trefresh.c', 'util.c'],
109108
'tstorepubkey': ['tstorepubkey.c', 'util.c'],
110109
'tpkey': ['tpkey.c', 'util.c'],
111110
'pincache': ['pincache.c'],

tests/setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,7 @@ export BASEURI2WITHPINVALUE="${BASEURI2WITHPINVALUE}"
808808
export BASEURI2="${BASEURI2}"
809809
export PUBURI2="${PUBURI2}"
810810
export PRIURI2="${PRIURI2}"
811+
export SLOT2ID="${SLOT2ID}"
811812
DBGSCRIPT
812813
fi
813814

tests/tdefaultslot

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,16 @@
44

55
source "${TESTSSRCDIR}/helpers.sh"
66

7-
title PARA "Test PKCS11 SLOTS"
87
ORIG_OPENSSL_CONF=${OPENSSL_CONF}
98
sed -e "s/#pkcs11-module-default-slot-id/pkcs11-module-default-slot-id = 52/" \
109
-e "s/^pkcs11-module-token-pin.*$/pkcs11-module-token-pin = 11111111/" \
1110
"${OPENSSL_CONF}" > "${OPENSSL_CONF}.defaultslot"
1211
export OPENSSL_CONF=${OPENSSL_CONF}.defaultslot
1312

14-
title PARA "Sign and Verify with provided Hash and RSA"
15-
ossl 'pkey -in "${PRIURI2}" -pubout -out ${TMPPDIR}/defaultslot_public.pem'
16-
ossl 'dgst -sha256 -binary -out ${TMPPDIR}/sha256.bin ${SEEDFILE}'
17-
ossl '
18-
pkeyutl -sign -inkey "${PRIURI2}"
19-
-in ${TMPPDIR}/sha256.bin
20-
-out ${TMPPDIR}/sha256-sig.bin
21-
-pkeyopt digest:sha256'
13+
title PARA "Test PKCS11 SLOTS default slot - pub key storing"
14+
"${TESTBLDDIR}/tstorepubkey" "${PUBURI2}"
2215

23-
env
24-
25-
# echo $CHECKER "${TESTBLDDIR}/trefresh" "${PRIURI2}" "${PUBURI2}" ${SEEDFILE} "${TMPPDIR}/sha256-sig.bin"
26-
echo $CHECKER "${TESTBLDDIR}/tstorepubkey" "${PRIURI2}" "${PUBURI2}" ${SEEDFILE} "${TMPPDIR}/sha256-sig.bin"
16+
title PARA "Test PKCS11 SLOTS default slot - checking slot"
17+
pkcs11-tool --module "${P11LIB}" --slot "${SLOT2ID}" -O | grep 'id=%02%01;object=testKey' -q
2718

2819
export OPENSSL_CONF=${ORIG_OPENSSL_CONF}

tests/trefresh.c

Lines changed: 0 additions & 231 deletions
This file was deleted.

0 commit comments

Comments
 (0)