From a337b5c30fd03d96f2483ccf5721f9b1f008bc66 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Tue, 26 Jul 2016 14:51:59 +0200 Subject: tests: rsa-md5-collision: run from top-level --- tests/Makefile.am | 8 +++-- tests/rsa-md5-collision/Makefile.am | 34 -------------------- tests/rsa-md5-collision/rsa-md5-collision | 48 ---------------------------- tests/rsa-md5-collision/rsa-md5-collision.sh | 48 ++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 85 deletions(-) delete mode 100644 tests/rsa-md5-collision/Makefile.am delete mode 100755 tests/rsa-md5-collision/rsa-md5-collision create mode 100755 tests/rsa-md5-collision/rsa-md5-collision.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 47d6fc3640..ed80f6ba0d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -19,7 +19,7 @@ # along with this file; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -SUBDIRS = . rsa-md5-collision pkcs1-padding pkcs8-decode pkcs12-decode \ +SUBDIRS = . pkcs1-padding pkcs8-decode pkcs12-decode \ userid cert-tests ocsp-tests key-tests sha2 safe-renegotiation dsa scripts ecdsa \ slow dtls srp windows @@ -36,7 +36,9 @@ EXTRA_DIST = suppressions.valgrind eagain-common.h cert-common.h test-chains.h \ certs/cert-rsa-2432.pem certs/ecc384.pem certs/ecc.pem \ certs/ca-ecc.pem certs/cert-ecc384.pem certs/cert-ecc.pem certs/ecc256.pem \ certs/ecc521.pem certs/rsa-2432.pem x509cert-dir/ca.pem psk.passwd \ - system.prio pkcs11/softhsm.h pkcs11/pkcs11-pubkey-import.c gnutls-asan.supp + system.prio pkcs11/softhsm.h pkcs11/pkcs11-pubkey-import.c gnutls-asan.supp \ + rsa-md5-collision/MD5CollisionCA.cer rsa-md5-collision/TargetCollidingCertificate1.cer \ + rsa-md5-collision/TargetCollidingCertificate2.cer rsa-md5-collision/README AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) AM_CPPFLAGS = \ @@ -250,7 +252,7 @@ name_constraints_merge_CPPFLAGS = $(CPPFLAGS) \ -I$(top_builddir)/gl check_PROGRAMS = $(ctests) -dist_check_SCRIPTS = rfc2253-escape-test +dist_check_SCRIPTS = rfc2253-escape-test rsa-md5-collision/rsa-md5-collision.sh if !WINDOWS dist_check_SCRIPTS += danetool.sh fastopen.sh diff --git a/tests/rsa-md5-collision/Makefile.am b/tests/rsa-md5-collision/Makefile.am deleted file mode 100644 index eef1e640b9..0000000000 --- a/tests/rsa-md5-collision/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -## Process this file with automake to produce Makefile.in -# Copyright (C) 2006, 2008, 2010, 2012 Free Software Foundation, Inc. -# -# Author: Simon Josefsson -# -# This file is part of GnuTLS. -# -# This file 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. -# -# This file 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 this file; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -EXTRA_DIST = MD5CollisionCA.cer \ - TargetCollidingCertificate1.cer \ - TargetCollidingCertificate2.cer \ - README - -dist_check_SCRIPTS = rsa-md5-collision - -TESTS = rsa-md5-collision - -TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) \ - LC_ALL="C" \ - top_builddir="$(top_builddir)" \ - srcdir="$(srcdir)" diff --git a/tests/rsa-md5-collision/rsa-md5-collision b/tests/rsa-md5-collision/rsa-md5-collision deleted file mode 100755 index 0ac6e8b45d..0000000000 --- a/tests/rsa-md5-collision/rsa-md5-collision +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2006, 2008, 2010, 2012 Free Software Foundation, Inc. -# -# Author: Simon Josefsson -# -# 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. - -set -e - -srcdir="${srcdir:-.}" -CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}" -TMPFILE1=rsa-md5.$$.tmp -TMPFILE2=rsa-md5-2.$$.tmp - -"${CERTTOOL}" --inder --certificate-info \ - --infile "${srcdir}/TargetCollidingCertificate1.cer" > $TMPFILE1 -"${CERTTOOL}" --inder --certificate-info \ - --infile "${srcdir}/TargetCollidingCertificate2.cer" > $TMPFILE2 - -"${CERTTOOL}" --inder --certificate-info \ - --infile "${srcdir}/MD5CollisionCA.cer" >> $TMPFILE1 -"${CERTTOOL}" --inder --certificate-info \ - --infile "${srcdir}/MD5CollisionCA.cer" >> $TMPFILE2 - -"${CERTTOOL}" --verify-chain < $TMPFILE1 | \ - grep 'Not verified.' | grep 'insecure algorithm' >/dev/null -"${CERTTOOL}" --verify-chain < $TMPFILE2 | \ - grep 'Not verified.' | grep 'insecure algorithm' >/dev/null - -rm -f $TMPFILE1 $TMPFILE2 - -# We're done. -exit 0 diff --git a/tests/rsa-md5-collision/rsa-md5-collision.sh b/tests/rsa-md5-collision/rsa-md5-collision.sh new file mode 100755 index 0000000000..de0e5ae77b --- /dev/null +++ b/tests/rsa-md5-collision/rsa-md5-collision.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +# Copyright (C) 2006, 2008, 2010, 2012 Free Software Foundation, Inc. +# +# Author: Simon Josefsson +# +# 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. + +set -e + +srcdir="${srcdir:-.}" +CERTTOOL="${CERTTOOL:-../src/certtool${EXEEXT}}" +TMPFILE1=rsa-md5.$$.tmp +TMPFILE2=rsa-md5-2.$$.tmp + +"${CERTTOOL}" --inder --certificate-info \ + --infile "${srcdir}/rsa-md5-collision/TargetCollidingCertificate1.cer" > $TMPFILE1 +"${CERTTOOL}" --inder --certificate-info \ + --infile "${srcdir}/rsa-md5-collision/TargetCollidingCertificate2.cer" > $TMPFILE2 + +"${CERTTOOL}" --inder --certificate-info \ + --infile "${srcdir}/rsa-md5-collision/MD5CollisionCA.cer" >> $TMPFILE1 +"${CERTTOOL}" --inder --certificate-info \ + --infile "${srcdir}/rsa-md5-collision/MD5CollisionCA.cer" >> $TMPFILE2 + +"${CERTTOOL}" --verify-chain < $TMPFILE1 | \ + grep 'Not verified.' | grep 'insecure algorithm' >/dev/null +"${CERTTOOL}" --verify-chain < $TMPFILE2 | \ + grep 'Not verified.' | grep 'insecure algorithm' >/dev/null + +rm -f $TMPFILE1 $TMPFILE2 + +# We're done. +exit 0 -- cgit v1.2.1