Skip to content

Commit

Permalink
Add new error code for SSL cache entry not found
Browse files Browse the repository at this point in the history
There was no good error to return in this case.

Signed-off-by: Gilles Peskine <[email protected]>
  • Loading branch information
gilles-peskine-arm committed Sep 29, 2023
1 parent dce82cd commit 917dd8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/mbedtls/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@
#define MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS -0x7000
/** Invalid value in SSL config */
#define MBEDTLS_ERR_SSL_BAD_CONFIG -0x5E80
/** Cache entry not found */
#define MBEDTLS_ERR_SSL_CACHE_ENTRY_NOT_FOUND -0x5E00

/*
* Various constants
Expand Down
2 changes: 2 additions & 0 deletions library/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ const char *mbedtls_high_level_strerr(int error_code)
return( "SSL - A cryptographic operation is in progress. Try again later" );
case -(MBEDTLS_ERR_SSL_BAD_CONFIG):
return( "SSL - Invalid value in SSL config" );
case -(MBEDTLS_ERR_SSL_CACHE_ENTRY_NOT_FOUND):
return( "SSL - Cache entry not found" );
#endif /* MBEDTLS_SSL_TLS_C */

#if defined(MBEDTLS_X509_USE_C) || defined(MBEDTLS_X509_CREATE_C)
Expand Down

0 comments on commit 917dd8b

Please sign in to comment.