mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-07 06:59:19 +01:00
Add platform error codes
Add error codes for the platform module, to be used by the setup \ terminate API.
This commit is contained in:
parent
d22c1b2445
commit
0ff4e0b824
4 changed files with 16 additions and 1 deletions
|
|
@ -165,6 +165,10 @@
|
|||
#include "mbedtls/pkcs5.h"
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_PLATFORM_C)
|
||||
#include "mbedtls/platform.h"
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_POLY1305_C)
|
||||
#include "mbedtls/poly1305.h"
|
||||
#endif
|
||||
|
|
@ -821,6 +825,13 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen )
|
|||
mbedtls_snprintf( buf, buflen, "PADLOCK - Input data should be aligned" );
|
||||
#endif /* MBEDTLS_PADLOCK_C */
|
||||
|
||||
#if defined(MBEDTLS_PLATFORM_C)
|
||||
if( use_ret == -(MBEDTLS_ERR_PLATFORM_INVALID_DATA) )
|
||||
mbedtls_snprintf( buf, buflen, "PLATFORM - Bad input parameters to the platform function" );
|
||||
if( use_ret == -(MBEDTLS_ERR_PLATFORM_HW_FAILED) )
|
||||
mbedtls_snprintf( buf, buflen, "PLATFORM - Hardware platform function failed" );
|
||||
#endif /* MBEDTLS_PLATFORM_C */
|
||||
|
||||
#if defined(MBEDTLS_POLY1305_C)
|
||||
if( use_ret == -(MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA) )
|
||||
mbedtls_snprintf( buf, buflen, "POLY1305 - Invalid input parameter(s)" );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue