Skip to content

Commit

Permalink
CTR_DRBG Error handling (Mbed-TLS#5)
Browse files Browse the repository at this point in the history
* CTR_DRBG Error handling

Check AES return values and return error when needed.
Add a new error code: MBEDTLS_ERR_CTR_DRBG_CRYPTO_FAILED

* Update and rename ctr_drbg.c to ctr_drbg.h

* Update ctr_drbg.h

* Rename ctr_drbg.h to ctr_drbg.c

* CTR_DRBG Error handling

Check AES return values and return error when needed.
Add a new error code: MBEDTLS_ERR_CTR_DRBG_CRYPTO_FAILED

* More changes after code review.

* CTR_DRBG more memory cleanup.
  • Loading branch information
dvir2000 authored and NirEkhauz committed Nov 30, 2017
1 parent 84e764c commit df8f987
Show file tree
Hide file tree
Showing 2 changed files with 656 additions and 594 deletions.
1 change: 1 addition & 0 deletions include/mbedtls/ctr_drbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#endif

#define MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED -0x0034 /**< The entropy source failed. */
#define MBEDTLS_ERR_CTR_DRBG_AES_CRYPTO_FAILED -0x0035 /**< Some of the crypto API (AES) has failed */
#define MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG -0x0036 /**< Too many random requested in single call. */
#define MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG -0x0038 /**< Input too large (Entropy + additional). */
#define MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR -0x003A /**< Read/write error in file. */
Expand Down
Loading

0 comments on commit df8f987

Please sign in to comment.