1
0
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:
Paul Bakker
2011-05-09 16:17:09 +00:00
parent 91b4159834
commit 9d781407bc
33 changed files with 1031 additions and 285 deletions

View File

@ -121,7 +121,7 @@ cleanup:
if( ret != 0 )
{
rsa_free( ctx );
return( POLARSSL_ERR_RSA_KEY_GEN_FAILED | ret );
return( POLARSSL_ERR_RSA_KEY_GEN_FAILED + ret );
}
return( 0 );
@ -199,8 +199,11 @@ cleanup:
mpi_free( &H ); mpi_free( &I ); mpi_free( &G ); mpi_free( &G2 );
mpi_free( &L1 ); mpi_free( &L2 );
if( ret == POLARSSL_ERR_RSA_KEY_CHECK_FAILED )
return( ret );
if( ret != 0 )
return( POLARSSL_ERR_RSA_KEY_CHECK_FAILED | ret );
return( POLARSSL_ERR_RSA_KEY_CHECK_FAILED + ret );
return( 0 );
}
@ -235,7 +238,7 @@ cleanup:
mpi_free( &T );
if( ret != 0 )
return( POLARSSL_ERR_RSA_PUBLIC_FAILED | ret );
return( POLARSSL_ERR_RSA_PUBLIC_FAILED + ret );
return( 0 );
}
@ -295,7 +298,7 @@ cleanup:
mpi_free( &T ); mpi_free( &T1 ); mpi_free( &T2 );
if( ret != 0 )
return( POLARSSL_ERR_RSA_PRIVATE_FAILED | ret );
return( POLARSSL_ERR_RSA_PRIVATE_FAILED + ret );
return( 0 );
}