Blame tests/rsa-pss-sign.softhsm
|
Packit |
6b81fa |
#!/bin/sh
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
# Copyright (C) 2015 Nikos Mavrogiannopoulos
|
|
Packit |
6b81fa |
# Copyright (C) 2018 Anderson Toshiyuki Sasaki
|
|
Packit |
6b81fa |
#
|
|
Packit |
6b81fa |
# This program is free software: you can redistribute it and/or modify
|
|
Packit |
6b81fa |
# it under the terms of the GNU General Public License as published by
|
|
Packit |
6b81fa |
# the Free Software Foundation, either version 3 of the License, or
|
|
Packit |
6b81fa |
# (at your option) any later version.
|
|
Packit |
6b81fa |
#
|
|
Packit |
6b81fa |
# This program is distributed in the hope that it will be useful,
|
|
Packit |
6b81fa |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6b81fa |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
6b81fa |
# GNU General Public License for more details.
|
|
Packit |
6b81fa |
#
|
|
Packit |
6b81fa |
# You should have received a copy of the GNU General Public License
|
|
Packit |
6b81fa |
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
outdir="output.$$"
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
# Load common test functions
|
|
Packit |
6b81fa |
. ${srcdir}/rsa-common.sh
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
# Do the common test initialization
|
|
Packit |
6b81fa |
common_init
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
sed -e "s|@MODULE_PATH@|${MODULE}|g" -e "s|@ENGINE_PATH@|../src/.libs/pkcs11.so|g" <"${srcdir}/engines.cnf.in" >"${outdir}/engines.cnf"
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
export OPENSSL_ENGINES="../src/.libs/"
|
|
Packit |
6b81fa |
PRIVATE_KEY="pkcs11:token=libp11-test;id=%01%02%03%04;object=server-key;type=private;pin-value=1234"
|
|
Packit |
6b81fa |
PUBLIC_KEY="pkcs11:token=libp11-test;id=%01%02%03%04;object=server-key;type=public;pin-value=1234"
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
./rsa-pss-sign 1234 "${outdir}/engines.cnf" ${PRIVATE_KEY} ${PUBLIC_KEY} ${MODULE}
|
|
Packit |
6b81fa |
if test $? != 0;then
|
|
Packit |
6b81fa |
echo "RSA-PSS signature/verification test failed."
|
|
Packit |
6b81fa |
exit 1;
|
|
Packit |
6b81fa |
fi
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
rm -rf "$outdir"
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
exit 0
|