diff options
author | Daiki Ueno <ueno@gnu.org> | 2020-07-03 19:26:26 +0000 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2020-07-03 19:26:26 +0000 |
commit | 661f94641e590e0e7c4c65c5df7ae5e11b920d59 (patch) | |
tree | 56e08fabd3f4ed68eb76ca7c6d64930eb19fd18d | |
parent | 22e0678dd23d138eb0f30851ac8361a3b7399f13 (diff) | |
parent | 5d0a11409903ed301173de800d1036c1e5af9378 (diff) | |
download | gnutls-661f94641e590e0e7c4c65c5df7ae5e11b920d59.tar.gz |
Merge branch 'split-up-tests-s-o-sig-hash' into 'master'
tests: split up system-override-sig-hash.sh
See merge request gnutls/gnutls!1298
-rw-r--r-- | tests/Makefile.am | 3 | ||||
-rwxr-xr-x | tests/system-override-hash.sh | 39 | ||||
-rwxr-xr-x | tests/system-override-sig.sh (renamed from tests/system-override-sig-hash.sh) | 24 |
3 files changed, 46 insertions, 20 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 13d7ba3855..8d71fc4bf0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -515,7 +515,8 @@ dist_check_SCRIPTS += fastopen.sh pkgconfig.sh starttls.sh starttls-ftp.sh start server-weak-keys.sh if !DISABLE_SYSTEM_CONFIG -dist_check_SCRIPTS += system-override-sig-hash.sh system-override-versions.sh system-override-invalid.sh \ +dist_check_SCRIPTS += system-override-sig.sh system-override-hash.sh \ + system-override-versions.sh system-override-invalid.sh \ system-override-curves.sh system-override-profiles.sh system-override-tls.sh \ system-override-kx.sh system-override-default-priority-string.sh endif diff --git a/tests/system-override-hash.sh b/tests/system-override-hash.sh new file mode 100755 index 0000000000..cb027c2fad --- /dev/null +++ b/tests/system-override-hash.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# Copyright (C) 2019 Nikos Mavrogiannopoulos +# +# Author: Nikos Mavrogiannopoulos +# +# This file is part of GnuTLS. +# +# GnuTLS is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GnuTLS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GnuTLS; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +: ${builddir=.} +TMPFILE=c.$$.tmp +export GNUTLS_SYSTEM_PRIORITY_FAIL_ON_INVALID=1 + +cat <<_EOF_ > ${TMPFILE} +[overrides] + +insecure-hash = sha256 +insecure-hash = sha512 +_EOF_ + +export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}" + +"${builddir}/system-override-hash" +rc=$? +rm ${TMPFILE} +exit $rc diff --git a/tests/system-override-sig-hash.sh b/tests/system-override-sig.sh index 37980ec584..68bf759048 100755 --- a/tests/system-override-sig-hash.sh +++ b/tests/system-override-sig.sh @@ -20,24 +20,13 @@ # along with GnuTLS; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -srcdir="${srcdir:-.}" +: ${builddir=.} TMPFILE=c.$$.tmp export GNUTLS_SYSTEM_PRIORITY_FAIL_ON_INVALID=1 cat <<_EOF_ > ${TMPFILE} [overrides] -insecure-hash = sha256 -insecure-hash = sha512 -_EOF_ - -export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}" - -${builddir}/system-override-hash - -cat <<_EOF_ > ${TMPFILE} -[overrides] - insecure-sig-for-cert = rsa-sha256 insecure-sig = rsa-sha512 insecure-sig = rsa-sha1 @@ -45,10 +34,7 @@ _EOF_ export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}" -${builddir}/system-override-sig -if test $? != 0;then - echo "Could not parse config file" - exit 1 -fi - -exit 0 +"${builddir}/system-override-sig" +rc=$? +rm ${TMPFILE} +exit $rc |