Skip to content

Commit bcca58c

Browse files
Ron EldorPatater
authored andcommitted
Add common feature unavailable error
Add a common error for the feature unavailable, in the platform module.
1 parent 06f88e9 commit bcca58c

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

include/mbedtls/error.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
* CHACHA20 3 0x0051-0x0055
8181
* POLY1305 3 0x0057-0x005B
8282
* CHACHAPOLY 2 0x0054-0x0056
83-
* PLATFORM 1 0x0070-0x0070
83+
* PLATFORM 1 0x0070-0x0072
8484
*
8585
* High-level module nr (3 bits - 0x0...-0x7...)
8686
* Name ID Nr of Errors

include/mbedtls/platform.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
#include "platform_time.h"
4444
#endif
4545

46-
#define MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED -0x0070 /**< Hardware accelerator failed */
46+
#define MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED -0x0070 /**< Hardware accelerator failed */
47+
#define MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED -0x0072 /**< The requested feature is not supported by the platform */
4748

4849
#ifdef __cplusplus
4950
extern "C" {

library/error.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,8 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen )
834834
#if defined(MBEDTLS_PLATFORM_C)
835835
if( use_ret == -(MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED) )
836836
mbedtls_snprintf( buf, buflen, "PLATFORM - Hardware accelerator failed" );
837+
if( use_ret == -(MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED) )
838+
mbedtls_snprintf( buf, buflen, "PLATFORM - The requested feature is not supported by the platform" );
837839
#endif /* MBEDTLS_PLATFORM_C */
838840

839841
#if defined(MBEDTLS_POLY1305_C)

0 commit comments

Comments
 (0)