Skip to content

Commit 0c75fd7

Browse files
committed
crypto/mbedtls: Use config defining flag globally
Now -DMBEDTLS_USER_CONFIG_FILE=<mbedtls/config_mynewt.h> flag is used globally for each build that depends on mbedtls package. This way we won't have to add this flag in each package that uses mbedtls.
1 parent 165790f commit 0c75fd7

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

apps/crypto_test/pkg.yml

-2
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@ pkg.deps:
2828
- "@apache-mynewt-core/sys/log"
2929
- "@apache-mynewt-core/crypto/mbedtls"
3030
- "@apache-mynewt-core/crypto/tinycrypt"
31-
32-
pkg.cflags: '-DMBEDTLS_USER_CONFIG_FILE="mbedtls/config_mynewt.h"'

apps/hash_test/pkg.yml

-2
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,3 @@ pkg.deps:
2828
- "@apache-mynewt-core/sys/log"
2929
- "@apache-mynewt-core/crypto/mbedtls"
3030
- "@apache-mynewt-core/crypto/tinycrypt"
31-
32-
pkg.cflags: '-DMBEDTLS_USER_CONFIG_FILE="mbedtls/config_mynewt.h"'

crypto/mbedtls/include/mbedtls/config_mynewt.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ extern "C" {
4242
#define MBEDTLS_NO_PLATFORM_ENTROPY
4343
#undef MBEDTLS_NET_C
4444

45-
#ifndef TEST
4645
#undef MBEDTLS_SELF_TEST
46+
#if MYNEWT_VAL(TEST)
47+
#define MBEDTLS_SELF_TEST
4748
#endif
4849

4950
#define MBEDTLS_SHA256_SMALLER /* Comes with performance hit */

crypto/mbedtls/pkg.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ pkg.keywords:
2626
- tls
2727
pkg.type: sdk
2828

29-
pkg.cflags:
29+
app.cflags:
3030
- '-DMBEDTLS_USER_CONFIG_FILE=<mbedtls/config_mynewt.h>'
31+
32+
pkg.cflags:
3133
- -Wno-maybe-uninitialized
3234
- -Wno-unknown-warning-option
3335
pkg.cflags.TEST: -DTEST

crypto/mbedtls/syscfg.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ syscfg.defs:
119119
value: 0
120120
MBEDTLS_CIPHER_MODE_CFB:
121121
value: 0
122+
# XXX: This should be 0 on default, but mcuboot's test needs this enabled. Until a new mcuboot version with this
123+
# config enabled is released we have to enable this by default.
122124
MBEDTLS_CIPHER_MODE_CTR:
123-
value: 0
125+
value: 1
124126
MBEDTLS_CIPHER_MODE_OFB:
125127
value: 0
126128
MBEDTLS_CIPHER_MODE_XTS:

0 commit comments

Comments
 (0)