Skip to content

Commit aac3853

Browse files
Fix long-standing bug in error code description
MBEDTLS_ERR_ASN1_INVALID_DATA is documented as "not used", but it has been used since the PolarSSL days.
1 parent 2cd8ecc commit aac3853

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/mbedtls/asn1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
#define MBEDTLS_ERR_ASN1_UNEXPECTED_TAG -0x0062 /**< ASN1 tag was of an unexpected value. */
5353
#define MBEDTLS_ERR_ASN1_INVALID_LENGTH -0x0064 /**< Error when trying to determine the length or invalid length. */
5454
#define MBEDTLS_ERR_ASN1_LENGTH_MISMATCH -0x0066 /**< Actual length differs from expected length. */
55-
#define MBEDTLS_ERR_ASN1_INVALID_DATA -0x0068 /**< Data is invalid. (not used) */
55+
#define MBEDTLS_ERR_ASN1_INVALID_DATA -0x0068 /**< Data is invalid. */
5656
#define MBEDTLS_ERR_ASN1_ALLOC_FAILED -0x006A /**< Memory allocation failed */
5757
#define MBEDTLS_ERR_ASN1_BUF_TOO_SMALL -0x006C /**< Buffer too small when writing ASN.1 data structure. */
5858

library/error.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen )
467467
if( use_ret == -(MBEDTLS_ERR_ASN1_LENGTH_MISMATCH) )
468468
mbedtls_snprintf( buf, buflen, "ASN1 - Actual length differs from expected length" );
469469
if( use_ret == -(MBEDTLS_ERR_ASN1_INVALID_DATA) )
470-
mbedtls_snprintf( buf, buflen, "ASN1 - Data is invalid. (not used)" );
470+
mbedtls_snprintf( buf, buflen, "ASN1 - Data is invalid" );
471471
if( use_ret == -(MBEDTLS_ERR_ASN1_ALLOC_FAILED) )
472472
mbedtls_snprintf( buf, buflen, "ASN1 - Memory allocation failed" );
473473
if( use_ret == -(MBEDTLS_ERR_ASN1_BUF_TOO_SMALL) )

0 commit comments

Comments
 (0)