Added CMAC as proper low-level module and changed error returns
This commit is contained in:
parent
c45554448c
commit
2fa11cd197
4 changed files with 15 additions and 3 deletions
|
@ -69,6 +69,10 @@
|
|||
#include "mbedtls/cipher.h"
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_CMAC_C)
|
||||
#include "mbedtls/cmac.h"
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_CTR_DRBG_C)
|
||||
#include "mbedtls/ctr_drbg.h"
|
||||
#endif
|
||||
|
@ -578,6 +582,13 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen )
|
|||
mbedtls_snprintf( buf, buflen, "CCM - Authenticated decryption failed" );
|
||||
#endif /* MBEDTLS_CCM_C */
|
||||
|
||||
#if defined(MBEDTLS_CMAC_C)
|
||||
if( use_ret == -(MBEDTLS_ERR_CMAC_BAD_INPUT) )
|
||||
mbedtls_snprintf( buf, buflen, "CMAC - Bad input parameters to function" );
|
||||
if( use_ret == -(MBEDTLS_ERR_CMAC_VERIFY_FAILED) )
|
||||
mbedtls_snprintf( buf, buflen, "CMAC - Verification failed" );
|
||||
#endif /* MBEDTLS_CMAC_C */
|
||||
|
||||
#if defined(MBEDTLS_CTR_DRBG_C)
|
||||
if( use_ret == -(MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED) )
|
||||
mbedtls_snprintf( buf, buflen, "CTR_DRBG - The entropy source failed" );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue