Debian Codegraph @

tests/ec-testfork.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 # Copyright (C) 2015 Red Hat, Inc.
7 #
8 # This is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by the
10 # Free Software Foundation; either version 3 of the License, or (at
11 # your option) any later version.
12 #
13 # GnuTLS is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with GnuTLS; if not, write to the Free Software Foundation,
20 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
22 outdir="output.$$"
23
24 # Load common test functions
25 . ${srcdir}/common.sh
26
27 # Do the token initialization
28 init_token "ec" "1" "libp11" ${ID} "server-key" "privkey" "pubkey" "cert"
29
30 # Load openssl settings
31 . ${srcdir}/openssl-settings.sh
32
33 # Restore openssl settings
34 trap cleanup EXIT
35
36 # Run the test
37 ${WRAPPER} ./fork-test ${MODULE} ${PIN}
38 rc=$?
39 if [[ $rc -eq 77 ]]; then
40 echo "Fork test skipped."
41 rm -rf "$outdir"
42 exit 77
43 elif [[ $rc -ne 0 ]]; then
44 echo "Fork test failed."
45 exit 1
46 fi
47
48 rm -rf "$outdir"
49
50 exit 0