mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
- A error_strerror function() has been added to translate between error codes and their description.
- The error codes have been remapped and combining error codes is now done with a PLUS instead of an OR as error codes used are negative. - Descriptions to all error codes have been added. - Generation script for error.c has been created to automatically generate error.c from the available error definitions in the headers.
This commit is contained in:
@ -281,7 +281,7 @@ int pem_read_buffer( pem_context *ctx, char *header, char *footer, const unsigne
|
||||
ret = base64_decode( NULL, &len, s1, s2 - s1 );
|
||||
|
||||
if( ret == POLARSSL_ERR_BASE64_INVALID_CHARACTER )
|
||||
return( ret | POLARSSL_ERR_PEM_INVALID_DATA );
|
||||
return( POLARSSL_ERR_PEM_INVALID_DATA + ret );
|
||||
|
||||
if( ( buf = (unsigned char *) malloc( len ) ) == NULL )
|
||||
return( POLARSSL_ERR_PEM_MALLOC_FAILED );
|
||||
@ -289,7 +289,7 @@ int pem_read_buffer( pem_context *ctx, char *header, char *footer, const unsigne
|
||||
if( ( ret = base64_decode( buf, &len, s1, s2 - s1 ) ) != 0 )
|
||||
{
|
||||
free( buf );
|
||||
return( ret | POLARSSL_ERR_PEM_INVALID_DATA );
|
||||
return( POLARSSL_ERR_PEM_INVALID_DATA + ret );
|
||||
}
|
||||
|
||||
if( enc != 0 )
|
||||
|
Reference in New Issue
Block a user