Merge pull request #4407 from ARMmbed/dev3_signoffs
Merge development_3.0 into development
This commit is contained in:
commit
12f93f4fc2
183 changed files with 834 additions and 12758 deletions
|
@ -183,7 +183,6 @@ EXCLUDE_FROM_FULL = frozenset([
|
|||
'MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES', # removes a feature
|
||||
'MBEDTLS_NO_PLATFORM_ENTROPY', # removes a feature
|
||||
'MBEDTLS_NO_UDBL_DIVISION', # influences anything that uses bignum
|
||||
'MBEDTLS_PKCS11_C', # build dependency (libpkcs11-helper)
|
||||
'MBEDTLS_PLATFORM_NO_STD_FUNCTIONS', # removes a feature
|
||||
'MBEDTLS_PSA_CRYPTO_CONFIG', # toggles old/new style PSA config
|
||||
'MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG', # behavior change + build dependency
|
||||
|
@ -191,15 +190,12 @@ EXCLUDE_FROM_FULL = frozenset([
|
|||
'MBEDTLS_PSA_CRYPTO_SPM', # platform dependency (PSA SPM)
|
||||
'MBEDTLS_PSA_INJECT_ENTROPY', # build dependency (hook functions)
|
||||
'MBEDTLS_REMOVE_3DES_CIPHERSUITES', # removes a feature
|
||||
'MBEDTLS_REMOVE_ARC4_CIPHERSUITES', # removes a feature
|
||||
'MBEDTLS_RSA_NO_CRT', # influences the use of RSA in X.509 and TLS
|
||||
'MBEDTLS_SHA512_NO_SHA384', # removes a feature
|
||||
'MBEDTLS_SSL_HW_RECORD_ACCEL', # build dependency (hook functions)
|
||||
'MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN', # build dependency (clang+memsan)
|
||||
'MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND', # build dependency (valgrind headers)
|
||||
'MBEDTLS_TEST_NULL_ENTROPY', # removes a feature
|
||||
'MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION', # influences the use of X.509 in TLS
|
||||
'MBEDTLS_ZLIB_SUPPORT', # build dependency (libz)
|
||||
])
|
||||
|
||||
def is_seamless_alt(name):
|
||||
|
@ -242,7 +238,6 @@ EXCLUDE_FROM_BAREMETAL = frozenset([
|
|||
#pylint: disable=line-too-long
|
||||
'MBEDTLS_ENTROPY_NV_SEED', # requires a filesystem and FS_IO or alternate NV seed hooks
|
||||
'MBEDTLS_FS_IO', # requires a filesystem
|
||||
'MBEDTLS_HAVEGE_C', # requires a clock
|
||||
'MBEDTLS_HAVE_TIME', # requires a clock
|
||||
'MBEDTLS_HAVE_TIME_DATE', # requires a clock
|
||||
'MBEDTLS_NET_C', # requires POSIX-like networking
|
||||
|
@ -279,10 +274,8 @@ def include_in_crypto(name):
|
|||
name.startswith('MBEDTLS_KEY_EXCHANGE_'):
|
||||
return False
|
||||
if name in [
|
||||
'MBEDTLS_CERTS_C', # part of libmbedx509
|
||||
'MBEDTLS_DEBUG_C', # part of libmbedtls
|
||||
'MBEDTLS_NET_C', # part of libmbedtls
|
||||
'MBEDTLS_PKCS11_C', # part of libmbedx509
|
||||
]:
|
||||
return False
|
||||
return True
|
||||
|
@ -301,11 +294,6 @@ def crypto_adapter(adapter):
|
|||
return adapter(name, active, section)
|
||||
return continuation
|
||||
|
||||
DEPRECATED = frozenset([
|
||||
'MBEDTLS_SSL_PROTO_SSL3',
|
||||
'MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO',
|
||||
])
|
||||
|
||||
def no_deprecated_adapter(adapter):
|
||||
"""Modify an adapter to disable deprecated symbols.
|
||||
|
||||
|
@ -316,8 +304,6 @@ def no_deprecated_adapter(adapter):
|
|||
def continuation(name, active, section):
|
||||
if name == 'MBEDTLS_DEPRECATED_REMOVED':
|
||||
return True
|
||||
if name in DEPRECATED:
|
||||
return False
|
||||
if adapter is None:
|
||||
return active
|
||||
return adapter(name, active, section)
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
* default value when that configuration is not set in the config.h.
|
||||
*/
|
||||
#include "mbedtls/aes.h"
|
||||
#include "mbedtls/aesni.h"
|
||||
#include "mbedtls/arc4.h"
|
||||
#include "mbedtls/aria.h"
|
||||
#include "mbedtls/asn1.h"
|
||||
|
@ -47,7 +46,6 @@
|
|||
#include "mbedtls/blowfish.h"
|
||||
#include "mbedtls/camellia.h"
|
||||
#include "mbedtls/ccm.h"
|
||||
#include "mbedtls/certs.h"
|
||||
#include "mbedtls/chacha20.h"
|
||||
#include "mbedtls/chachapoly.h"
|
||||
#include "mbedtls/cipher.h"
|
||||
|
@ -61,10 +59,8 @@
|
|||
#include "mbedtls/ecjpake.h"
|
||||
#include "mbedtls/ecp.h"
|
||||
#include "mbedtls/entropy.h"
|
||||
#include "mbedtls/entropy_poll.h"
|
||||
#include "mbedtls/error.h"
|
||||
#include "mbedtls/gcm.h"
|
||||
#include "mbedtls/havege.h"
|
||||
#include "mbedtls/hkdf.h"
|
||||
#include "mbedtls/hmac_drbg.h"
|
||||
#include "mbedtls/md.h"
|
||||
|
@ -75,10 +71,8 @@
|
|||
#include "mbedtls/net_sockets.h"
|
||||
#include "mbedtls/nist_kw.h"
|
||||
#include "mbedtls/oid.h"
|
||||
#include "mbedtls/padlock.h"
|
||||
#include "mbedtls/pem.h"
|
||||
#include "mbedtls/pk.h"
|
||||
#include "mbedtls/pkcs11.h"
|
||||
#include "mbedtls/pkcs12.h"
|
||||
#include "mbedtls/pkcs5.h"
|
||||
#include "mbedtls/platform_time.h"
|
||||
|
@ -93,7 +87,6 @@
|
|||
#include "mbedtls/ssl_cache.h"
|
||||
#include "mbedtls/ssl_ciphersuites.h"
|
||||
#include "mbedtls/ssl_cookie.h"
|
||||
#include "mbedtls/ssl_internal.h"
|
||||
#include "mbedtls/ssl_ticket.h"
|
||||
#include "mbedtls/threading.h"
|
||||
#include "mbedtls/timing.h"
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -129,7 +129,7 @@ do_config "ccm-psk-tls1_2" \
|
|||
"psk=000102030405060708090A0B0C0D0E0F"
|
||||
|
||||
do_config "suite-b" \
|
||||
"MBEDTLS_BASE64_C MBEDTLS_PEM_PARSE_C MBEDTLS_CERTS_C" \
|
||||
"MBEDTLS_BASE64_C MBEDTLS_PEM_PARSE_C" \
|
||||
""
|
||||
|
||||
# cleanup
|
||||
|
|
|
@ -1,133 +0,0 @@
|
|||
#!/usr/bin/env perl
|
||||
#
|
||||
# Copyright The Mbed TLS Contributors
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# Purpose
|
||||
#
|
||||
# This script migrates application source code from the mbed TLS 1.3 API to the
|
||||
# mbed TLS 2.0 API.
|
||||
#
|
||||
# The script processes the given source code and renames identifiers - functions
|
||||
# types, enums etc, as
|
||||
#
|
||||
# Usage: rename.pl [-f datafile] [-s] [--] [filenames...]
|
||||
#
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
use utf8;
|
||||
use Path::Class;
|
||||
use open qw(:std utf8);
|
||||
|
||||
my $usage = "Usage: $0 [-f datafile] [-s] [--] [filenames...]\n";
|
||||
|
||||
(my $datafile = $0) =~ s/rename.pl$/data_files\/rename-1.3-2.0.txt/;
|
||||
my $do_strings = 0;
|
||||
|
||||
while( @ARGV && $ARGV[0] =~ /^-/ ) {
|
||||
my $opt = shift;
|
||||
if( $opt eq '--' ) {
|
||||
last;
|
||||
} elsif( $opt eq '-f' ) {
|
||||
$datafile = shift;
|
||||
} elsif( $opt eq '-s' ) {
|
||||
$do_strings = 1; shift;
|
||||
} else {
|
||||
die $usage;
|
||||
}
|
||||
}
|
||||
|
||||
my %subst;
|
||||
open my $nfh, '<', $datafile or die "Could not read $datafile\n";
|
||||
my $ident = qr/[_A-Za-z][_A-Za-z0-9]*/;
|
||||
while( my $line = <$nfh> ) {
|
||||
chomp $line;
|
||||
my ( $old, $new ) = ( $line =~ /^($ident)\s+($ident)$/ );
|
||||
if( ! $old || ! $new ) {
|
||||
die "$0: $datafile:$.: bad input '$line'\n";
|
||||
}
|
||||
$subst{$old} = $new;
|
||||
}
|
||||
close $nfh or die;
|
||||
|
||||
my $string = qr/"(?:\\.|[^\\"])*"/;
|
||||
my $space = qr/\s+/;
|
||||
my $idnum = qr/[a-zA-Z0-9_]+/;
|
||||
my $symbols = qr/[-!#\$%&'()*+,.\/:;<=>?@[\\\]^_`{|}~]+|"/;
|
||||
|
||||
my $lib_include_dir = dir($0)->parent->parent->subdir('include', 'mbedtls');
|
||||
my $lib_source_dir = dir($0)->parent->parent->subdir('library');
|
||||
|
||||
# if we replace inside strings, we don't consider them a token
|
||||
my $token = $do_strings ? qr/$space|$idnum|$symbols/
|
||||
: qr/$string|$space|$idnum|$symbols/;
|
||||
|
||||
my %warnings;
|
||||
|
||||
# If no files were passed, exit...
|
||||
if ( not defined($ARGV[0]) ){ die $usage; }
|
||||
|
||||
while( my $filename = shift )
|
||||
{
|
||||
print STDERR "$filename... ";
|
||||
|
||||
if( dir($filename)->parent eq $lib_include_dir ||
|
||||
dir($filename)->parent eq $lib_source_dir )
|
||||
{
|
||||
die "Script cannot be executed on the mbed TLS library itself.";
|
||||
}
|
||||
|
||||
if( -d $filename ) { print STDERR "skip (directory)\n"; next }
|
||||
|
||||
open my $rfh, '<', $filename or die;
|
||||
my @lines = <$rfh>;
|
||||
close $rfh or die;
|
||||
|
||||
my @out;
|
||||
for my $line (@lines) {
|
||||
if( $line =~ /#include/ ) {
|
||||
$line =~ s/polarssl/mbedtls/;
|
||||
$line =~ s/POLARSSL/MBEDTLS/;
|
||||
push( @out, $line );
|
||||
next;
|
||||
}
|
||||
|
||||
my @words = ($line =~ /$token/g);
|
||||
my $checkline = join '', @words;
|
||||
if( $checkline eq $line ) {
|
||||
my @new = map { exists $subst{$_} ? $subst{$_} : $_ } @words;
|
||||
push( @out, join '', @new );
|
||||
} else {
|
||||
$warnings{$filename} = [] unless $warnings{$filename};
|
||||
push @{ $warnings{$filename} }, $line;
|
||||
push( @out, $line );
|
||||
}
|
||||
}
|
||||
|
||||
open my $wfh, '>', $filename or die;
|
||||
print $wfh $_ for @out;
|
||||
close $wfh or die;
|
||||
print STDERR "done\n";
|
||||
}
|
||||
|
||||
if( %warnings ) {
|
||||
print "\nWarning: lines skipped due to unexpected characters:\n";
|
||||
for my $filename (sort keys %warnings) {
|
||||
print "in $filename:\n";
|
||||
print for @{ $warnings{$filename} };
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue