Skip to content

Commit 4c2406e

Browse files
ccli8adbridge
authored andcommitted
Fix compile error with Travis CI
Use MBED_CONF_RTOS_PRESENT to filter out mbedtls alternative for mbed OS 2.
1 parent e525e96 commit 4c2406e

File tree

8 files changed

+40
-0
lines changed

8 files changed

+40
-0
lines changed

targets/TARGET_NUVOTON/TARGET_NUC472/crypto/aes/aes_alt.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
* http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf
2222
*/
2323

24+
/* Compatible with mbed OS 2 which doesn't support mbedtls */
25+
#if MBED_CONF_RTOS_PRESENT
26+
2427
#if !defined(MBEDTLS_CONFIG_FILE)
2528
#include "mbedtls/config.h"
2629
#else
@@ -588,3 +591,5 @@ int mbedtls_aes_crypt_ctr( mbedtls_aes_context *ctx,
588591

589592

590593
#endif /* MBEDTLS_AES_C */
594+
595+
#endif /* MBED_CONF_RTOS_PRESENT */

targets/TARGET_NUVOTON/TARGET_NUC472/crypto/des/des_alt.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17+
/* Compatible with mbed OS 2 which doesn't support mbedtls */
18+
#if MBED_CONF_RTOS_PRESENT
19+
1720
#if !defined(MBEDTLS_CONFIG_FILE)
1821
#include "mbedtls/config.h"
1922
#else
@@ -408,3 +411,5 @@ static int mbedtls_des_docrypt(uint16_t keyopt, uint8_t key[3][MBEDTLS_DES_KEY_S
408411

409412
#endif /* MBEDTLS_DES_ALT */
410413
#endif /* MBEDTLS_DES_C */
414+
415+
#endif /* MBED_CONF_RTOS_PRESENT */

targets/TARGET_NUVOTON/TARGET_NUC472/crypto/des/des_alt_sw.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
* http://csrc.nist.gov/publications/fips/fips46-3/fips46-3.pdf
2626
*/
2727

28+
/* Compatible with mbed OS 2 which doesn't support mbedtls */
29+
#if MBED_CONF_RTOS_PRESENT
30+
2831
#if !defined(MBEDTLS_CONFIG_FILE)
2932
#include "mbedtls/config.h"
3033
#else
@@ -795,3 +798,5 @@ int mbedtls_des3_sw_crypt_cbc( mbedtls_des3_sw_context *ctx,
795798

796799
#endif /* MBEDTLS_DES_ALT */
797800
#endif /* MBEDTLS_DES_C */
801+
802+
#endif /* MBED_CONF_RTOS_PRESENT */

targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha1_alt.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17+
/* Compatible with mbed OS 2 which doesn't support mbedtls */
18+
#if MBED_CONF_RTOS_PRESENT
19+
1720
#if !defined(MBEDTLS_CONFIG_FILE)
1821
#include "mbedtls/config.h"
1922
#else
@@ -136,3 +139,5 @@ void mbedtls_sha1_process(mbedtls_sha1_context *ctx, const unsigned char data[64
136139

137140
#endif /* MBEDTLS_SHA1_ALT */
138141
#endif /* MBEDTLS_SHA1_C */
142+
143+
#endif /* MBED_CONF_RTOS_PRESENT */

targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha1_alt_sw.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
* http://www.itl.nist.gov/fipspubs/fip180-1.htm
2525
*/
2626

27+
/* Compatible with mbed OS 2 which doesn't support mbedtls */
28+
#if MBED_CONF_RTOS_PRESENT
29+
2730
#if !defined(MBEDTLS_CONFIG_FILE)
2831
#include "mbedtls/config.h"
2932
#else
@@ -343,3 +346,5 @@ void mbedtls_sha1_sw_finish( mbedtls_sha1_sw_context *ctx, unsigned char output[
343346
#endif /* MBEDTLS_SHA1_ALT */
344347

345348
#endif /* MBEDTLS_SHA1_C */
349+
350+
#endif /* MBED_CONF_RTOS_PRESENT */

targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha256_alt.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17+
/* Compatible with mbed OS 2 which doesn't support mbedtls */
18+
#if MBED_CONF_RTOS_PRESENT
19+
1720
#if !defined(MBEDTLS_CONFIG_FILE)
1821
#include "mbedtls/config.h"
1922
#else
@@ -137,3 +140,5 @@ void mbedtls_sha256_process(mbedtls_sha256_context *ctx, const unsigned char dat
137140

138141
#endif /* MBEDTLS_SHA256_ALT */
139142
#endif /* MBEDTLS_SHA256_C */
143+
144+
#endif /* MBED_CONF_RTOS_PRESENT */

targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha256_alt_sw.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
* http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
2525
*/
2626

27+
/* Compatible with mbed OS 2 which doesn't support mbedtls */
28+
#if MBED_CONF_RTOS_PRESENT
29+
2730
#if !defined(MBEDTLS_CONFIG_FILE)
2831
#include "mbedtls/config.h"
2932
#else
@@ -317,3 +320,5 @@ void mbedtls_sha256_sw_finish( mbedtls_sha256_sw_context *ctx, unsigned char out
317320
#endif /* MBEDTLS_SHA256_ALT */
318321

319322
#endif /* MBEDTLS_SHA256_C */
323+
324+
#endif /* MBED_CONF_RTOS_PRESENT */

targets/TARGET_NUVOTON/TARGET_NUC472/crypto/sha/sha_alt_hw.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17+
/* Compatible with mbed OS 2 which doesn't support mbedtls */
18+
#if MBED_CONF_RTOS_PRESENT
19+
1720
#if !defined(MBEDTLS_CONFIG_FILE)
1821
#include "mbedtls/config.h"
1922
#else
@@ -331,3 +334,5 @@ void crypto_sha_getinternstate(unsigned char output[], size_t olen)
331334
#endif /* MBEDTLS_SHA1_ALT || MBEDTLS_SHA256_ALT || MBEDTLS_SHA512_ALT */
332335

333336
#endif /* MBEDTLS_SHA1_C || MBEDTLS_SHA256_C || MBEDTLS_SHA512_C */
337+
338+
#endif /* MBED_CONF_RTOS_PRESENT */

0 commit comments

Comments
 (0)