diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h index 1e5174511..0588e0cde 100644 --- a/include/mbedtls/ssl.h +++ b/include/mbedtls/ssl.h @@ -111,7 +111,7 @@ /* Error space gap */ /* Error space gap */ /** Cache entry not found */ -#define MBEDTLS_ERR_SSL_CACHE_NOT_FOUND -0x7E80 +#define MBEDTLS_ERR_SSL_CACHE_ENTRY_NOT_FOUND -0x7E80 /** Memory allocation failed */ #define MBEDTLS_ERR_SSL_ALLOC_FAILED -0x7F00 /** Hardware acceleration function returned with error */ diff --git a/include/mbedtls/ssl_cache.h b/include/mbedtls/ssl_cache.h index 9b7d8e6f4..7009827f8 100644 --- a/include/mbedtls/ssl_cache.h +++ b/include/mbedtls/ssl_cache.h @@ -104,7 +104,8 @@ void mbedtls_ssl_cache_init(mbedtls_ssl_cache_context *cache); * associated with \p session_id, if present. * * \return \c 0 on success. - * \return A negative error code on failure. + * \return #MBEDTLS_ERR_SSL_CACHE_ENTRY_NOT_FOUND if there is + * no cache entry with specified session ID found. */ int mbedtls_ssl_cache_get(void *data, unsigned char const *session_id, diff --git a/library/ssl_cache.c b/library/ssl_cache.c index 44dc11a56..e29b0bcd2 100644 --- a/library/ssl_cache.c +++ b/library/ssl_cache.c @@ -51,7 +51,7 @@ static int ssl_cache_find_entry(mbedtls_ssl_cache_context *cache, size_t session_id_len, mbedtls_ssl_cache_entry **dst) { - int ret = MBEDTLS_ERR_SSL_CACHE_NOT_FOUND; + int ret = MBEDTLS_ERR_SSL_CACHE_ENTRY_NOT_FOUND; #if defined(MBEDTLS_HAVE_TIME) mbedtls_time_t t = mbedtls_time(NULL); #endif