Skip to content

Commit 0c77b0e

Browse files
Merge pull request #198 from gilles-peskine-arm/psa-api-1.0-beta-merge_development_20190801
Merge mbed-crypto/development into psa-api-1.0-beta
2 parents 82a5711 + 5386f6b commit 0c77b0e

File tree

185 files changed

+1241
-937
lines changed

Some content is hidden

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

185 files changed

+1241
-937
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ massif-*
3131
# Python build artifacts:
3232
*.pyc
3333

34+
# CMake generates *.dir/ folders for in-tree builds (used by MSVC projects), ignore all of those:
35+
*.dir/
36+
37+
# Visual Studio artifacts
38+
/visualc/VS2010/.localhistory/
39+
/visualc/VS2010/.vs/
40+
/visualc/VS2010/Debug/
41+
/visualc/VS2010/Release/
42+
/visualc/VS2010/*.vcxproj.filters
43+
/visualc/VS2010/*.vcxproj.user
44+
3445
# Generated documentation:
3546
/apidoc
3647

CMakeLists.txt

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ else()
55
project("mbed TLS" C)
66
endif()
77

8+
# Set the project root directory.
9+
set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
10+
811
option(ENABLE_PROGRAMS "Build mbed TLS programs." ON)
912

1013
option(UNSAFE_BUILD "Allow unsafe builds. These builds ARE NOT SECURE." OFF)
@@ -121,7 +124,10 @@ if(CMAKE_COMPILER_IS_GNU)
121124
# note: starting with CMake 2.8 we could use CMAKE_C_COMPILER_VERSION
122125
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
123126
OUTPUT_VARIABLE GCC_VERSION)
124-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings")
127+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wwrite-strings")
128+
if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
129+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wvla")
130+
endif()
125131
if (GCC_VERSION VERSION_GREATER 4.5 OR GCC_VERSION VERSION_EQUAL 4.5)
126132
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wlogical-op")
127133
endif()
@@ -138,7 +144,7 @@ if(CMAKE_COMPILER_IS_GNU)
138144
endif(CMAKE_COMPILER_IS_GNU)
139145

140146
if(CMAKE_COMPILER_IS_CLANG)
141-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow")
147+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow -Wvla")
142148
set(CMAKE_C_FLAGS_RELEASE "-O2")
143149
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
144150
set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
@@ -216,13 +222,13 @@ if(ENABLE_TESTING)
216222
COMMAND mv DartConfiguration.tcl.bak DartConfiguration.tcl
217223
)
218224
endif(UNIX)
219-
endif()
220225

221-
# Make scripts needed for testing available in an out-of-source build.
222-
if (NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
223-
link_to_source(scripts)
224-
# Copy (don't link) DartConfiguration.tcl, needed for memcheck, to
225-
# keep things simple with the sed commands in the memcheck target.
226-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DartConfiguration.tcl
227-
${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl COPYONLY)
226+
# Make scripts needed for testing available in an out-of-source build.
227+
if (NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
228+
link_to_source(scripts)
229+
# Copy (don't link) DartConfiguration.tcl, needed for memcheck, to
230+
# keep things simple with the sed commands in the memcheck target.
231+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DartConfiguration.tcl
232+
${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl COPYONLY)
233+
endif()
228234
endif()

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
DESTDIR=/usr/local
32
PREFIX=mbedtls_
43

configs/config-no-entropy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@
8181
/* Miscellaneous options */
8282
#define MBEDTLS_AES_ROM_TABLES
8383

84-
#include "check_config.h"
84+
#include "mbedtls/check_config.h"
8585

8686
#endif /* MBEDTLS_CONFIG_H */

configs/config-psa-crypto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1971,6 +1971,6 @@
19711971
#include MBEDTLS_USER_CONFIG_FILE
19721972
#endif
19731973

1974-
#include "check_config.h"
1974+
#include "mbedtls/check_config.h"
19751975

19761976
#endif /* MBEDTLS_CONFIG_H */

docs/architecture/mbed-crypto-storage-specification.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,21 @@ The library integration and the PSA platform integration use different sets of f
161161

162162
It would simplify things to always have a 32-bit owner, with a nonzero value, and thus reserve the range 0–0xffffffff for internal library use.
163163

164-
Mbed Crypto 1.0.1
164+
Mbed Crypto 1.1.0
165165
-----------------
166166

167-
Tags: TBD
167+
Tags: mbedcrypto-1.1.0
168168

169-
Released in May 2019. <br>
169+
Released in early June 2019. <br>
170170
Integrated in Mbed OS 5.13.
171171

172172
Identical to [1.0.0](#mbed-crypto-1.0.0) except for some changes in the key file format.
173173

174-
### Key file format for 1.0.1
174+
### Key file format for 1.1.0
175175

176176
The key file format is identical to [1.0.0](#key-file-format-for-1.0.0), except for the following changes:
177177

178-
* A new policy field, marked as [NEW:1.0.1] below.
178+
* A new policy field, marked as [NEW:1.1.0] below.
179179
* The encoding of key types, algorithms and key material has changed, therefore the storage format is not compatible (despite using the same value in the version field so far).
180180

181181
A self-contained description of the file layout follows.
@@ -189,7 +189,7 @@ The layout of a key file is:
189189
* type (4 bytes): `psa_key_type_t` value
190190
* policy usage flags (4 bytes): `psa_key_usage_t` value
191191
* policy usage algorithm (4 bytes): `psa_algorithm_t` value
192-
* policy enrollment algorithm (4 bytes): `psa_algorithm_t` value [NEW:1.0.1]
192+
* policy enrollment algorithm (4 bytes): `psa_algorithm_t` value [NEW:1.1.0]
193193
* key material length (4 bytes)
194194
* key material: output of `psa_export_key`
195195
* Any trailing data is rejected on load.

include/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if(INSTALL_MBEDTLS_HEADERS)
1616
endif(INSTALL_MBEDTLS_HEADERS)
1717

1818
# Make config.h available in an out-of-source build.
19-
if (NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
19+
if (ENABLE_TESTING AND NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
2020
link_to_source(mbedtls)
2121
link_to_source(psa)
2222
endif()

include/mbedtls/aes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#define MBEDTLS_AES_H
4343

4444
#if !defined(MBEDTLS_CONFIG_FILE)
45-
#include "config.h"
45+
#include "mbedtls/config.h"
4646
#else
4747
#include MBEDTLS_CONFIG_FILE
4848
#endif

include/mbedtls/aesni.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
#define MBEDTLS_AESNI_H
2929

3030
#if !defined(MBEDTLS_CONFIG_FILE)
31-
#include "config.h"
31+
#include "mbedtls/config.h"
3232
#else
3333
#include MBEDTLS_CONFIG_FILE
3434
#endif
3535

36-
#include "aes.h"
36+
#include "mbedtls/aes.h"
3737

3838
#define MBEDTLS_AESNI_AES 0x02000000u
3939
#define MBEDTLS_AESNI_CLMUL 0x00000002u

include/mbedtls/arc4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#define MBEDTLS_ARC4_H
3030

3131
#if !defined(MBEDTLS_CONFIG_FILE)
32-
#include "config.h"
32+
#include "mbedtls/config.h"
3333
#else
3434
#include MBEDTLS_CONFIG_FILE
3535
#endif

include/mbedtls/aria.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
#define MBEDTLS_ARIA_H
3232

3333
#if !defined(MBEDTLS_CONFIG_FILE)
34-
#include "config.h"
34+
#include "mbedtls/config.h"
3535
#else
3636
#include MBEDTLS_CONFIG_FILE
3737
#endif
3838

3939
#include <stddef.h>
4040
#include <stdint.h>
4141

42-
#include "platform_util.h"
42+
#include "mbedtls/platform_util.h"
4343

4444
#define MBEDTLS_ARIA_ENCRYPT 1 /**< ARIA encryption. */
4545
#define MBEDTLS_ARIA_DECRYPT 0 /**< ARIA decryption. */

include/mbedtls/asn1.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
#define MBEDTLS_ASN1_H
2626

2727
#if !defined(MBEDTLS_CONFIG_FILE)
28-
#include "config.h"
28+
#include "mbedtls/config.h"
2929
#else
3030
#include MBEDTLS_CONFIG_FILE
3131
#endif
3232

3333
#include <stddef.h>
3434

3535
#if defined(MBEDTLS_BIGNUM_C)
36-
#include "bignum.h"
36+
#include "mbedtls/bignum.h"
3737
#endif
3838

3939
/**

include/mbedtls/asn1write.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
#define MBEDTLS_ASN1_WRITE_H
2626

2727
#if !defined(MBEDTLS_CONFIG_FILE)
28-
#include "config.h"
28+
#include "mbedtls/config.h"
2929
#else
3030
#include MBEDTLS_CONFIG_FILE
3131
#endif
3232

33-
#include "asn1.h"
33+
#include "mbedtls/asn1.h"
3434

3535
#define MBEDTLS_ASN1_CHK_ADD(g, f) \
3636
do \

include/mbedtls/base64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#define MBEDTLS_BASE64_H
2626

2727
#if !defined(MBEDTLS_CONFIG_FILE)
28-
#include "config.h"
28+
#include "mbedtls/config.h"
2929
#else
3030
#include MBEDTLS_CONFIG_FILE
3131
#endif

include/mbedtls/bignum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#define MBEDTLS_BIGNUM_H
2626

2727
#if !defined(MBEDTLS_CONFIG_FILE)
28-
#include "config.h"
28+
#include "mbedtls/config.h"
2929
#else
3030
#include MBEDTLS_CONFIG_FILE
3131
#endif

include/mbedtls/blowfish.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
#define MBEDTLS_BLOWFISH_H
2626

2727
#if !defined(MBEDTLS_CONFIG_FILE)
28-
#include "config.h"
28+
#include "mbedtls/config.h"
2929
#else
3030
#include MBEDTLS_CONFIG_FILE
3131
#endif
3232

3333
#include <stddef.h>
3434
#include <stdint.h>
3535

36-
#include "platform_util.h"
36+
#include "mbedtls/platform_util.h"
3737

3838
#define MBEDTLS_BLOWFISH_ENCRYPT 1
3939
#define MBEDTLS_BLOWFISH_DECRYPT 0

include/mbedtls/bn_mul.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
#define MBEDTLS_BN_MUL_H
4040

4141
#if !defined(MBEDTLS_CONFIG_FILE)
42-
#include "config.h"
42+
#include "mbedtls/config.h"
4343
#else
4444
#include MBEDTLS_CONFIG_FILE
4545
#endif
4646

47-
#include "bignum.h"
47+
#include "mbedtls/bignum.h"
4848

4949
#if defined(MBEDTLS_HAVE_ASM)
5050

include/mbedtls/camellia.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
#define MBEDTLS_CAMELLIA_H
2626

2727
#if !defined(MBEDTLS_CONFIG_FILE)
28-
#include "config.h"
28+
#include "mbedtls/config.h"
2929
#else
3030
#include MBEDTLS_CONFIG_FILE
3131
#endif
3232

3333
#include <stddef.h>
3434
#include <stdint.h>
3535

36-
#include "platform_util.h"
36+
#include "mbedtls/platform_util.h"
3737

3838
#define MBEDTLS_CAMELLIA_ENCRYPT 1
3939
#define MBEDTLS_CAMELLIA_DECRYPT 0

include/mbedtls/ccm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@
5050
#define MBEDTLS_CCM_H
5151

5252
#if !defined(MBEDTLS_CONFIG_FILE)
53-
#include "config.h"
53+
#include "mbedtls/config.h"
5454
#else
5555
#include MBEDTLS_CONFIG_FILE
5656
#endif
5757

58-
#include "cipher.h"
58+
#include "mbedtls/cipher.h"
5959

6060
#define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D /**< Bad input parameters to the function. */
6161
#define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F /**< Authenticated decryption failed. */

0 commit comments

Comments
 (0)