- 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.
diff --git a/library/pem.c b/library/pem.c
index bcfcdd2..3e8f79e 100644
--- a/library/pem.c
+++ b/library/pem.c
@@ -281,7 +281,7 @@
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 @@
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 )