Debian Codegraph @

tests/rsa-testpkcs11.softhsm

raw
1 #!/bin/bash
2
3 # Copyright © 2024 Mobi - Com Polska Sp. z o.o.
4 # Author: Małgorzata Olszówka <[email protected]>
5 # Copyright (C) 2013 Nikos Mavrogiannopoulos
6 #
7 # This file is part of GnuTLS.
8 #
9 # GnuTLS is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by the
11 # Free Software Foundation; either version 3 of the License, or (at
12 # your option) any later version.
13 #
14 # GnuTLS is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with GnuTLS; if not, write to the Free Software Foundation,
21 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
23 outdir="output.$$"
24
25 # Load common test functions
26 . ${srcdir}/common.sh
27
28 # Do the token initialization
29 init_token "rsa" "1" "libp11" ${ID} "server-key" "privkey" "pubkey" "cert"
30
31 # Load openssl settings
32 . ${srcdir}/openssl-settings.sh
33
34 # Restore openssl settings
35 trap cleanup EXIT
36
37 # Run the test
38 ${WRAPPER} ../examples/auth ${MODULE} ${PIN}
39 rc=$?
40 if [[ $rc -eq 77 ]]; then
41 echo "Basic PKCS #11 test skipped."
42 rm -rf "$outdir"
43 exit 77
44 elif [[ $rc -ne 0 ]]; then
45 echo "Basic PKCS #11 test failed."
46 exit 1
47 fi
48
49 rm -rf "$outdir"
50
51 exit 0