Mbed OS Reference
Loading...
Searching...
No Matches
Platform Abstraction Layer

Data Structures

struct  mbedtls_platform_context
 The platform context structure. More...
 

Macros

#define MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED   -0x0070
 Hardware accelerator failed. More...
 
#define MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED   -0x0072
 The requested feature is not supported by the platform. More...
 

Typedefs

typedef struct mbedtls_platform_context mbedtls_platform_context
 The platform context structure. More...
 

Functions

int mbedtls_platform_setup (mbedtls_platform_context *ctx)
 This function performs any platform-specific initialization operations. More...
 
void mbedtls_platform_teardown (mbedtls_platform_context *ctx)
 This function performs any platform teardown operations. More...
 
void mbedtls_platform_zeroize (void *buf, size_t len)
 Securely zeroize a buffer. More...
 

SECTION: Module settings

The configuration options you can set for this module are in this section.

Either change them in config.h or define them on the compiler command line.

#define MBEDTLS_PLATFORM_STD_SNPRINTF   snprintf
 The default snprintf function to use. More...
 
#define MBEDTLS_PLATFORM_STD_VSNPRINTF   vsnprintf
 The default vsnprintf function to use. More...
 
#define MBEDTLS_PLATFORM_STD_PRINTF   printf
 The default printf function to use. More...
 
#define MBEDTLS_PLATFORM_STD_FPRINTF   fprintf
 The default fprintf function to use. More...
 
#define MBEDTLS_PLATFORM_STD_CALLOC   calloc
 The default calloc function to use. More...
 
#define MBEDTLS_PLATFORM_STD_FREE   free
 The default free function to use. More...
 
#define MBEDTLS_PLATFORM_STD_EXIT   exit
 The default exit function to use. More...
 
#define MBEDTLS_PLATFORM_STD_TIME   time
 The default time function to use. More...
 
#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS   EXIT_SUCCESS
 The default exit value to use. More...
 
#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE   EXIT_FAILURE
 The default exit value to use. More...
 

Detailed Description

Macro Definition Documentation

◆ MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED

#define MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED   -0x0070

Hardware accelerator failed.

Definition at line 51 of file connectivity/mbedtls/include/mbedtls/platform.h.

◆ MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED

#define MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED   -0x0072

The requested feature is not supported by the platform.

Definition at line 52 of file connectivity/mbedtls/include/mbedtls/platform.h.

◆ MBEDTLS_PLATFORM_STD_SNPRINTF

#define MBEDTLS_PLATFORM_STD_SNPRINTF   snprintf

The default snprintf function to use.


Definition at line 83 of file connectivity/mbedtls/include/mbedtls/platform.h.

◆ MBEDTLS_PLATFORM_STD_VSNPRINTF

#define MBEDTLS_PLATFORM_STD_VSNPRINTF   vsnprintf

The default vsnprintf function to use.


Definition at line 90 of file connectivity/mbedtls/include/mbedtls/platform.h.

◆ MBEDTLS_PLATFORM_STD_PRINTF

#define MBEDTLS_PLATFORM_STD_PRINTF   printf

The default printf function to use.

Definition at line 94 of file connectivity/mbedtls/include/mbedtls/platform.h.

◆ MBEDTLS_PLATFORM_STD_FPRINTF

#define MBEDTLS_PLATFORM_STD_FPRINTF   fprintf

The default fprintf function to use.

Definition at line 97 of file connectivity/mbedtls/include/mbedtls/platform.h.

◆ MBEDTLS_PLATFORM_STD_CALLOC

#define MBEDTLS_PLATFORM_STD_CALLOC   calloc

The default calloc function to use.

Definition at line 100 of file connectivity/mbedtls/include/mbedtls/platform.h.

◆ MBEDTLS_PLATFORM_STD_FREE

#define MBEDTLS_PLATFORM_STD_FREE   free

The default free function to use.

Definition at line 103 of file connectivity/mbedtls/include/mbedtls/platform.h.

◆ MBEDTLS_PLATFORM_STD_EXIT

#define MBEDTLS_PLATFORM_STD_EXIT   exit

The default exit function to use.

Definition at line 106 of file connectivity/mbedtls/include/mbedtls/platform.h.

◆ MBEDTLS_PLATFORM_STD_TIME

#define MBEDTLS_PLATFORM_STD_TIME   time

The default time function to use.

Definition at line 109 of file connectivity/mbedtls/include/mbedtls/platform.h.

◆ MBEDTLS_PLATFORM_STD_EXIT_SUCCESS

#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS   EXIT_SUCCESS

The default exit value to use.

Definition at line 112 of file connectivity/mbedtls/include/mbedtls/platform.h.

◆ MBEDTLS_PLATFORM_STD_EXIT_FAILURE

#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE   EXIT_FAILURE

The default exit value to use.

Definition at line 115 of file connectivity/mbedtls/include/mbedtls/platform.h.

Typedef Documentation

◆ mbedtls_platform_context

The platform context structure.

Note
This structure may be used to assist platform-specific setup or teardown operations.

Function Documentation

◆ mbedtls_platform_setup()

int mbedtls_platform_setup ( mbedtls_platform_context ctx)

This function performs any platform-specific initialization operations.

Note
This function should be called before any other library functions.
     Its implementation is platform-specific, and unless
     platform-specific code is provided, it does nothing.
The usage and necessity of this function is dependent on the platform.
Parameters
ctxThe platform context.
Returns
0 on success.

◆ mbedtls_platform_teardown()

void mbedtls_platform_teardown ( mbedtls_platform_context ctx)

This function performs any platform teardown operations.

Note
This function should be called after every other Mbed TLS module has been correctly freed using the appropriate free function.

Its implementation is platform-specific, and unless platform-specific code is provided, it does nothing.

Note
The usage and necessity of this function is dependent on the platform.
Parameters
ctxThe platform context.

◆ mbedtls_platform_zeroize()

void mbedtls_platform_zeroize ( void *  buf,
size_t  len 
)

Securely zeroize a buffer.

         The function is meant to wipe the data contained in a buffer so
         that it can no longer be recovered even if the program memory
         is later compromised. Call this function on sensitive data
         stored on the stack before returning from a function, and on
         sensitive data stored on the heap before freeing the heap
         object.

         It is extremely difficult to guarantee that calls to
         mbedtls_platform_zeroize() are not removed by aggressive
         compiler optimizations in a portable way. For this reason, Mbed
         TLS provides the configuration option
         MBEDTLS_PLATFORM_ZEROIZE_ALT, which allows users to configure
         mbedtls_platform_zeroize() to use a suitable implementation for
         their platform and needs
Parameters
bufBuffer to be zeroized
lenLength of the buffer in bytes