psa: Fix builds without MBEDTLS_PLATFORM_C
When `MBEDTLS_PLATFORM_C` is not enabled, our PSA Crypto implementation depends on the standard C library for functions like snprintf() and exit(). However, our implementation was not including the proper header files nor redefining all `mbedtls_*` symbols properly to ensure successful builds without MBEDTLS_PLATFORM_C. Add the necessary header files and macro definitions to our PSA Crypto implementation.
This commit is contained in:
parent
44a59ab3f5
commit
db29ab528a
4 changed files with 6 additions and 0 deletions
|
@ -38,6 +38,7 @@
|
|||
#if defined(MBEDTLS_PLATFORM_C)
|
||||
#include "mbedtls/platform.h"
|
||||
#else
|
||||
#include <stdlib.h>
|
||||
#define mbedtls_calloc calloc
|
||||
#define mbedtls_free free
|
||||
#endif
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#if defined(MBEDTLS_PLATFORM_C)
|
||||
#include "mbedtls/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define mbedtls_snprintf snprintf
|
||||
#endif
|
||||
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
#include "mbedtls/platform.h"
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE
|
||||
#define mbedtls_printf printf
|
||||
#define mbedtls_exit exit
|
||||
#endif
|
||||
|
||||
#define ASSERT( predicate ) \
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
#define mbedtls_calloc calloc
|
||||
#define mbedtls_free free
|
||||
#define mbedtls_printf printf
|
||||
#define mbedtls_exit exit
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
|
Loading…
Reference in a new issue