Merge branch 'mbedtls-2.7' into mbedtls-2.7-restricted

* mbedtls-2.7: (28 commits)
  A different approach of signed-to-unsigned comparison
  Update the copy of tests/data_files/server2-sha256.crt in certs.c
  Fix bug in redirection of unit test outputs
  Backport e2k support to mbedtls-2.7
  Don't forget to free G, P, Q, ctr_drbg, and entropy
  Regenerate server2-sha256.crt with a PrintableString issuer
  Regenerate test client certificates with a PrintableString issuer
  cert_write: support all hash algorithms
  compat.sh: stop using allow_sha1
  compat.sh: quit using SHA-1 certificates
  compat.sh: enable CBC-SHA-2 suites for GnuTLS
  Fix license header in pre-commit hook
  Update copyright notices to use Linux Foundation guidance
  Fix building on NetBSD 9.0
  Remove obsolete buildbot reference in compat.sh
  Fix misuse of printf in shell script
  Fix added proxy command when IPv6 is used
  Simplify test syntax
  Fix logic error in setting client port
  ssl-opt.sh: include test name in log files
  ...
This commit is contained in:
Manuel Pégourié-Gonnard 2020-08-25 10:59:51 +02:00
commit d863a67a74
283 changed files with 577 additions and 976 deletions

View file

@ -2,7 +2,7 @@
# all.sh
#
# Copyright (c) 2014-2017, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -43,8 +43,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)

View file

@ -2,7 +2,7 @@
# basic-build-tests.sh
#
# Copyright (c) 2016, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -44,8 +44,6 @@
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
#
# Purpose
#
# Executes the basic test suites, captures the results, and generates a simple

View file

@ -8,7 +8,7 @@
# but that would warn about any undocumented item, while our goal is to find
# items that are documented, but not marked as such by mistake.
#
# Copyright (C) 2012-2016, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -49,8 +49,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
use warnings;
use strict;

View file

@ -1,6 +1,6 @@
#! /usr/bin/env sh
# Copyright (c) 2018, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -42,19 +42,35 @@
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
#
# Purpose
#
# Check if generated files are up-to-date.
set -eu
if [ $# -ne 0 ] && [ "$1" = "--help" ]; then
cat <<EOF
$0 [-u]
This script checks that all generated file are up-to-date. If some aren't, by
default the scripts reports it and exits in error; with the -u option, it just
updates them instead.
-u Update the files rather than return an error for out-of-date files.
EOF
exit
fi
if [ -d library -a -d include -a -d tests ]; then :; else
echo "Must be run from mbed TLS root" >&2
exit 1
fi
UPDATE=
if [ $# -ne 0 ] && [ "$1" = "-u" ]; then
shift
UPDATE='y'
fi
check()
{
SCRIPT=$1
@ -80,9 +96,15 @@ check()
for FILE in $FILES; do
if ! diff $FILE $FILE.bak >/dev/null 2>&1; then
echo "'$FILE' was either modified or deleted by '$SCRIPT'"
exit 1
if [ -z "$UPDATE" ]; then
exit 1
fi
fi
if [ -z "$UPDATE" ]; then
mv $FILE.bak $FILE
else
rm $FILE.bak
fi
mv $FILE.bak $FILE
if [ -d $TO_CHECK ]; then
# Create a grep regular expression that we can check against the
@ -99,7 +121,9 @@ check()
# Check if there are any new files
if ls -1 $TO_CHECK | grep -v "$PATTERN" >/dev/null 2>&1; then
echo "Files were created by '$SCRIPT'"
exit 1
if [ -z "$UPDATE" ]; then
exit 1
fi
fi
fi
}

View file

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2015-2019, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -41,8 +41,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
set -eu

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright (c) 2018, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -41,8 +41,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
"""
This script checks the current state of the source code for minor issues,

View file

@ -2,7 +2,7 @@
# curves.pl
#
# Copyright (c) 2014-2016, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -44,8 +44,6 @@
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
#
# Purpose
#
# To test the code dependencies on individual curves in each test suite. This

View file

@ -2,7 +2,7 @@
# depends-hashes.pl
#
# Copyright (c) 2017, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -44,8 +44,6 @@
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
#
# Purpose
#
# To test the code dependencies on individual hashes in each test suite. This

View file

@ -2,7 +2,7 @@
# depends-pkalgs.pl
#
# Copyright (c) 2017, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -44,8 +44,6 @@
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
#
# Purpose
#
# To test the code dependencies on individual PK algs (those that can be used

View file

@ -2,7 +2,7 @@
# Make sure the doxygen documentation builds without warnings
#
# Copyright (C) 2016, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -43,8 +43,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
# Abort on errors (and uninitiliased variables)
set -eu

View file

@ -4,7 +4,7 @@
# Only uses AES-256-CTR cases that use a Derivation function
# and concats nonce and personalization for initialization.
#
# Copyright (C) 2011, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -45,8 +45,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
use strict;

View file

@ -3,7 +3,7 @@
# Based on NIST gcmDecryptxxx.rsp validation files
# Only first 3 of every set used for compile time saving
#
# Copyright (C) 2012-2013, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -44,8 +44,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
use strict;

View file

@ -3,7 +3,7 @@
# Based on NIST gcmEncryptIntIVxxx.rsp validation files
# Only first 3 of every set used for compile time saving
#
# Copyright (C) 2012-2013, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -44,8 +44,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
use strict;

View file

@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
# Copyright (C) 2011-2015, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -41,8 +41,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
use strict;

View file

@ -8,7 +8,7 @@
# <test data file path> - should be the path to one of the test suite files
# such as 'test_suite_mpi.data'
#
# Copyright (C) 2016, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -49,8 +49,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
# Abort on errors
set -e

View file

@ -2,7 +2,7 @@
# generate_code.pl
#
# Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -44,8 +44,6 @@
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
#
# Purpose
#
# Generates the test suite code given inputs of the test suite directory that
@ -222,8 +220,6 @@ print TEST_FILE << "END";
* Test suite file : $test_case_file
* Test suite data : $test_case_data
*
*
* This file is part of mbed TLS (https://tls.mbed.org)
*/
#if !defined(MBEDTLS_CONFIG_FILE)

View file

@ -2,7 +2,7 @@
# key-exchanges.pl
#
# Copyright (c) 2015-2017, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -44,8 +44,6 @@
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
#
# Purpose
#
# To test the code dependencies on individual key exchanges in the SSL module.

View file

@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
# Copyright (C) 2015, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -41,8 +41,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
use warnings;
use strict;

View file

@ -6,7 +6,7 @@
#
# Usage: list-identifiers.sh [ -i | --internal ]
#
# Copyright (C) 2015-2019, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -47,8 +47,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
set -eu

View file

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2015, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -41,8 +41,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
set -eu

View file

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2015-2019, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -41,8 +41,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
set -eu

View file

@ -8,7 +8,7 @@
#
# Typical usage: scripts/recursion.pl library/*.c
#
# Copyright (C) 2014-2015, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -49,8 +49,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
use warnings;
use strict;

View file

@ -2,7 +2,7 @@
# run-test-suites.pl
#
# Copyright (c) 2015-2018, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -43,8 +43,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
=head1 SYNOPSIS

View file

@ -5,7 +5,7 @@
# DATA: hex-encoded data to send to the server
# RESPONSE: regexp that must match the server's response
#
# Copyright (C) 2017, Arm Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -46,8 +46,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
use warnings;
use strict;

View file

@ -2,7 +2,7 @@
# test-ref-configs.pl
#
# Copyright (c) 2013-2016, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -44,8 +44,6 @@
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
#
# Purpose
#
# For each reference configuration file in the configs directory, build the

View file

@ -2,7 +2,7 @@
# travis-log-failure.sh
#
# Copyright (c) 2016, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -44,8 +44,6 @@
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
#
# Purpose
#
# List the server and client logs on failed ssl-opt.sh and compat.sh tests.

View file

@ -2,7 +2,7 @@
# yotta-build.sh
#
# Copyright (c) 2015-2016, ARM Limited, All Rights Reserved
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
#
# This file is provided under the Apache License 2.0, or the
@ -44,8 +44,6 @@
#
# **********
#
# This file is part of Mbed TLS (https://tls.mbed.org)
#
# Purpose
#
# To run test builds of the yotta module for all supported targets.