|
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 |
# GnuTLS is free software; you can redistribute it and/or modify it
|
|
Packit |
6b81fa |
# under the terms of the GNU General Public License as published by the
|
|
Packit |
6b81fa |
# Free Software Foundation; either version 3 of the License, or (at
|
|
Packit |
6b81fa |
# your option) any later version.
|
|
Packit |
6b81fa |
#
|
|
Packit |
6b81fa |
# GnuTLS is distributed in the hope that it will be useful, but
|
|
Packit |
6b81fa |
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6b81fa |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6b81fa |
# 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 GnuTLS; if not, write to the Free Software Foundation,
|
|
Packit |
6b81fa |
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
# This test if the PKCS#11 URI scheme detection is case insensitive
|
|
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 |
ALL_LOWER_PRIV_KEY="pkcs11:token=libp11-test;id=%01%02%03%04;object=server-key;type=private;pin-value=1234"
|
|
Packit |
6b81fa |
ALL_LOWER_PUB_KEY="pkcs11:token=libp11-test;id=%01%02%03%04;object=server-key;type=public;pin-value=1234"
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
ALL_UPPER_PRIV_KEY="PKCS11:token=libp11-test;id=%01%02%03%04;object=server-key;type=private;pin-value=1234"
|
|
Packit |
6b81fa |
ALL_UPER_PUB_KEY="PKCS11:token=libp11-test;id=%01%02%03%04;object=server-key;type=public;pin-value=1234"
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
MIXED_PRIV_KEY="PkCs11:token=libp11-test;id=%01%02%03%04;object=server-key;type=private;pin-value=1234"
|
|
Packit |
6b81fa |
MIXED_PUB_KEY="pKcS11:token=libp11-test;id=%01%02%03%04;object=server-key;type=public;pin-value=1234"
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
./evp-sign default false "${outdir}/engines.cnf" ${ALL_LOWER_PRIV_KEY} ${ALL_LOWER_PUB_KEY} ${MODULE}
|
|
Packit |
6b81fa |
if test $? != 0;then
|
|
Packit |
6b81fa |
echo "All lower case PKCS#11 URI scheme detection failed"
|
|
Packit |
6b81fa |
exit 1;
|
|
Packit |
6b81fa |
fi
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
./evp-sign default false "${outdir}/engines.cnf" ${ALL_UPPER_PRIV_KEY} ${ALL_UPER_PUB_KEY} ${MODULE}
|
|
Packit |
6b81fa |
if test $? != 0;then
|
|
Packit |
6b81fa |
echo "All upper case PKCS#11 URI scheme detection failed"
|
|
Packit |
6b81fa |
exit 1;
|
|
Packit |
6b81fa |
fi
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
./evp-sign default false "${outdir}/engines.cnf" ${MIXED_PRIV_KEY} ${MIXED_PUB_KEY} ${MODULE}
|
|
Packit |
6b81fa |
if test $? != 0;then
|
|
Packit |
6b81fa |
echo "Mixed case PKCS#11 URI scheme detection failed"
|
|
Packit |
6b81fa |
exit 1;
|
|
Packit |
6b81fa |
fi
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
rm -rf "$outdir"
|
|
Packit |
6b81fa |
|
|
Packit |
6b81fa |
exit 0
|