Skip to content

Commit 341020d

Browse files
authored
Merge pull request #343 from fortanix/yx/upgrade_vendor_mbedtls
- Upgrade vendor `mbedtls` code version to `0.28.7`. - Bump `mbedtls-sys-auto` code version to `0.28.7`. - Add a script to automate vendor code update process, see fe68f9c. - Save all patches we made to vendor code, see fe68f9c.
2 parents 6bcc23e + 880b3f0 commit 341020d

File tree

752 files changed

+11440
-11440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

752 files changed

+11440
-11440
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mbedtls-sys/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mbedtls-sys-auto"
3-
version = "2.28.4+mbedtls-2.28.3"
3+
version = "2.28.7"
44
authors = ["Jethro Beekman <[email protected]>"]
55
build = "build/build.rs"
66
license = "Apache-2.0 OR GPL-2.0-or-later"
@@ -15,8 +15,8 @@ links = "mbedtls"
1515

1616
[package.metadata.mbedtls]
1717
git = "https://github.com/Mbed-TLS/mbedtls.git"
18-
version = "2.28.3"
19-
rev = "981743de6fcdbe672e482b6fd724d31d0a0d2476"
18+
version = "2.28.7"
19+
rev = "555f84735aecdbd76a566cf087ec8425dfb0c8ab"
2020

2121
[lib]
2222
name = "mbedtls_sys"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
From cf13aecfd2270d83b0f466e8d967be95a3923e26 Mon Sep 17 00:00:00 2001
2+
From: Vardhan Thigle <[email protected]>
3+
Date: Fri, 25 Jan 2019 11:31:35 +0530
4+
Subject: [PATCH 1/2] Vendor Change:-
5+
6+
1. Added conditional compilation flags "MBEDTLS_FORCE_AESNI" and "MBEDTLS_FORCE_PADLOCK"
7+
2. This allows us to supress cpuid based feature detection on sgx platforms.
8+
3. "MBEDTLS_FORCE_AESNI" gets set if "force_aesni_support" flag is enabled.
9+
4. Please refer to the previous commit for rust side changes.
10+
11+
(cherry picked from commit d2317b0864e313d759671068e3d3aa52c8fab234)
12+
---
13+
mbedtls-sys/vendor/library/aesni.c | 2 ++
14+
mbedtls-sys/vendor/library/padlock.c | 2 ++
15+
2 files changed, 4 insertions(+)
16+
17+
diff --git a/mbedtls-sys/vendor/library/aesni.c b/mbedtls-sys/vendor/library/aesni.c
18+
index c909f654..b8f8e071 100644
19+
--- a/mbedtls-sys/vendor/library/aesni.c
20+
+++ b/mbedtls-sys/vendor/library/aesni.c
21+
@@ -45,6 +45,7 @@
22+
#include <immintrin.h>
23+
#endif
24+
25+
+#if !defined(MBEDTLS_CUSTOM_HAS_AESNI)
26+
/*
27+
* AES-NI support detection routine
28+
*/
29+
@@ -74,6 +75,7 @@ int mbedtls_aesni_has_support(unsigned int what)
30+
31+
return (c & what) != 0;
32+
}
33+
+#endif
34+
35+
#if MBEDTLS_AESNI_HAVE_CODE == 2
36+
37+
diff --git a/mbedtls-sys/vendor/library/padlock.c b/mbedtls-sys/vendor/library/padlock.c
38+
index 303f82c7..798e9b7c 100644
39+
--- a/mbedtls-sys/vendor/library/padlock.c
40+
+++ b/mbedtls-sys/vendor/library/padlock.c
41+
@@ -39,6 +39,7 @@
42+
43+
#if defined(MBEDTLS_HAVE_X86)
44+
45+
+#if !defined(MBEDTLS_CUSTOM_HAS_PADLOCK)
46+
/*
47+
* PadLock detection routine
48+
*/
49+
@@ -68,6 +69,7 @@ int mbedtls_padlock_has_support(int feature)
50+
51+
return flags & feature;
52+
}
53+
+#endif
54+
55+
/*
56+
* PadLock AES-ECB block en(de)cryption
57+
--
58+
2.25.1
59+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From 044be6ae4f75c915b44a085e5943a65a22b3414a Mon Sep 17 00:00:00 2001
2+
From: Raoul Strackx <[email protected]>
3+
Date: Tue, 10 Mar 2020 16:51:47 +0100
4+
Subject: [PATCH 2/2] Adding mpi_force_c_code feature
5+
6+
(cherry picked from commit 38522c212a441cb0c58b1ae6be6f2f43e3affb99)
7+
---
8+
mbedtls-sys/vendor/include/mbedtls/bn_mul.h | 4 ++--
9+
1 file changed, 2 insertions(+), 2 deletions(-)
10+
11+
diff --git a/mbedtls-sys/vendor/include/mbedtls/bn_mul.h b/mbedtls-sys/vendor/include/mbedtls/bn_mul.h
12+
index a0bc4d06..103e62a6 100644
13+
--- a/mbedtls-sys/vendor/include/mbedtls/bn_mul.h
14+
+++ b/mbedtls-sys/vendor/include/mbedtls/bn_mul.h
15+
@@ -85,7 +85,7 @@
16+
#endif /* bits in mbedtls_mpi_uint */
17+
18+
/* *INDENT-OFF* */
19+
-#if defined(MBEDTLS_HAVE_ASM)
20+
+#if defined(MBEDTLS_HAVE_ASM) && !defined(MBEDTLS_MPI_FORCE_C_CODE)
21+
22+
#ifndef asm
23+
#define asm __asm
24+
@@ -953,7 +953,7 @@
25+
#endif /* SSE2 */
26+
#endif /* MSVC */
27+
28+
-#endif /* MBEDTLS_HAVE_ASM */
29+
+#endif /* MBEDTLS_HAVE_ASM && !MBEDTLS_MPI_FORCE_C_CODE */
30+
31+
#if !defined(MULADDC_CORE)
32+
#if defined(MBEDTLS_HAVE_UDBL)
33+
--
34+
2.25.1
35+

mbedtls-sys/vendor/.github/issue_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ github issues for questions.
2020
**OS**
2121
Mbed OS|linux|windows|
2222

23-
**mbed TLS build:**
23+
**Mbed TLS build:**
2424
Version: x.x.x or git commit id
2525
OS version: x.x.x
2626
Configuration: please attach config.h file where possible

mbedtls-sys/vendor/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Random seed file created by test scripts and sample programs
22
seedfile
3+
# MBEDTLS_PSA_INJECT_ENTROPY seed file created by the test framework
4+
00000000ffffff52.psa_its
35

46
# CMake build artifacts:
57
CMakeCache.txt
@@ -28,6 +30,9 @@ massif-*
2830
.project
2931
/.settings
3032

33+
# Unix-like build artifacts:
34+
*.o
35+
3136
# MSVC build artifacts:
3237
*.exe
3338
*.pdb
@@ -65,3 +70,6 @@ massif-*
6570
/TAGS
6671
/cscope*.out
6772
/tags
73+
74+
# Clangd compilation database
75+
compile_commands.json
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Set the version of Python and other tools you might need
9+
build:
10+
os: ubuntu-20.04
11+
tools:
12+
python: "3.9"
13+
jobs:
14+
pre_build:
15+
- ./scripts/apidoc_full.sh
16+
- breathe-apidoc -o docs/api apidoc/xml
17+
18+
# Build documentation in the docs/ directory with Sphinx
19+
sphinx:
20+
builder: dirhtml
21+
configuration: docs/conf.py
22+
23+
# Optionally declare the Python requirements required to build your docs
24+
python:
25+
install:
26+
- requirements: docs/requirements.txt

mbedtls-sys/vendor/.travis.yml

Lines changed: 13 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,24 @@
1-
language: c
2-
compiler: gcc
3-
sudo: false
4-
cache: ccache
5-
6-
jobs:
7-
include:
8-
- name: basic checks and reference configurations
9-
addons:
10-
apt:
11-
packages:
12-
- gnutls-bin
13-
- doxygen
14-
- graphviz
15-
- gcc-arm-none-eabi
16-
- libnewlib-arm-none-eabi
17-
- gcc-arm-linux-gnueabi
18-
- libc6-dev-armel-cross
19-
language: python # Needed to get pip for Python 3
20-
python: 3.5 # version from Ubuntu 16.04
21-
install:
22-
- scripts/min_requirements.py
23-
script:
24-
- tests/scripts/all.sh -k 'check_*'
25-
- tests/scripts/all.sh -k test_default_out_of_box
26-
- tests/scripts/all.sh -k test_ref_configs
27-
- tests/scripts/all.sh -k build_arm_linux_gnueabi_gcc_arm5vte build_arm_none_eabi_gcc_m0plus
1+
# Declare python as our language. This way we get our chosen Python version,
2+
# and pip is available. Gcc and clang are available anyway.
3+
dist: jammy
4+
os: linux
5+
language: python
6+
python: 3.10
287

29-
- name: full configuration
30-
os: linux
31-
dist: focal
32-
addons:
33-
apt:
34-
packages:
35-
- clang-10
36-
- gnutls-bin
37-
script:
38-
# Do a manual build+test sequence rather than using all.sh,
39-
# because there's no all.sh component that does what we want,
40-
# which is a build with Clang >= 10 and ASan, running all the SSL
41-
# testing.
42-
# - The clang executable in the default PATH is Clang 7 on
43-
# Travis's focal instances, but we want Clang >= 10.
44-
# - Running all the SSL testing requires a specific set of
45-
# OpenSSL and GnuTLS versions and we don't want to bother
46-
# with those on Travis.
47-
# So we explicitly select clang-10 as the compiler, and we
48-
# have ad hoc restrictions on SSL testing based on what is
49-
# passing at the time of writing. We will remove these limitations
50-
# gradually.
51-
- make CC=clang-10 CFLAGS='-Werror -Wall -Wextra -fsanitize=address,undefined -fno-sanitize-recover=all -O2' LDFLAGS='-Werror -Wall -Wextra -fsanitize=address,undefined -fno-sanitize-recover=all'
52-
- make test
53-
- programs/test/selftest
54-
- tests/scripts/test_psa_constant_names.py
55-
# Exclude a few test cases that are failing mysteriously.
56-
# https://github.com/Mbed-TLS/mbedtls/issues/6660
57-
- tests/ssl-opt.sh -e 'Fallback SCSV:\ .*list'
58-
# Modern OpenSSL does not support null or ancient ciphers.
59-
- tests/compat.sh -p OpenSSL -e 'NULL\|DES\|RC4'
60-
- tests/scripts/travis-log-failure.sh
61-
# GnuTLS supports CAMELLIA but compat.sh doesn't properly enable it.
62-
# Modern GnuTLS does not support DES.
63-
# One NULL cipher suite is strangely missing in pre-1.2 protocol
64-
# versions (it works with (D)TLS1.2, but don't bother).
65-
- tests/compat.sh -p GnuTLS -e 'CAMELLIA\|DES\|TLS-RSA-WITH-NULL-SHA256'
66-
- tests/scripts/travis-log-failure.sh
67-
- tests/context-info.sh
8+
cache: ccache
689

69-
- name: Windows
70-
os: windows
71-
script:
72-
- scripts/windows_msbuild.bat v141 # Visual Studio 2017
73-
- visualc/VS2010/x64/Release/selftest.exe --ci
10+
branches:
11+
only:
12+
coverity_scan
7413

75-
after_failure:
76-
- tests/scripts/travis-log-failure.sh
14+
install:
15+
- $PYTHON scripts/min_requirements.py
7716

7817
env:
7918
global:
8019
- SEED=1
81-
- secure: "JECCru6HASpKZ0OLfHh8f/KXhKkdrCwjquZghd/qbA4ksxsWImjR7KEPERcaPndXEilzhDbKwuFvJiQX2duVgTGoq745YGhLZIjzo1i8tySkceCVd48P8WceYGz+F/bmY7r+m6fFNuxDSoGGSVeA4Lnjvmm8PFUP45YodDV9no4="
82-
20+
- secure: "GF/Fde5fkm15T/RNykrjrPV5Uh1KJ70cP308igL6Xkk3eJmqkkmWCe9JqRH12J3TeWw2fu9PYPHt6iFSg6jasgqysfUyg+W03knRT5QNn3h5eHgt36cQJiJr6t3whPrRaiM6U9omE0evm+c0cAwlkA3GGSMw8Z+na4EnKI6OFCo="
8321
addons:
84-
apt:
85-
packages:
86-
- gnutls-bin
8722
coverity_scan:
8823
project:
8924
name: "ARMmbed/mbedtls"

mbedtls-sys/vendor/.uncrustify.cfg

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,7 @@
44
# to Mbed TLS.
55
#
66
# Copyright The Mbed TLS Contributors
7-
# SPDX-License-Identifier: Apache-2.0
8-
#
9-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
10-
# not use this file except in compliance with the License.
11-
# You may obtain a copy of the License at
12-
#
13-
# http://www.apache.org/licenses/LICENSE-2.0
14-
#
15-
# Unless required by applicable law or agreed to in writing, software
16-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18-
# See the License for the specific language governing permissions and
19-
# limitations under the License.
7+
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
208

219

2210
# Wrap lines at 100 characters
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
*.o
21
Makefile

0 commit comments

Comments
 (0)