WOLFSSL_AES_CBC_LENGTH_CHECKS: add gated logic to aes.c wc_AesCbc{En,De}crypt() to return BAD_LENGTH_E when input length is not a multiple of AES_BLOCK_SIZE; add gated tests of new functionality in test_wc_AesCbcEncryptDecrypt(); fix first encrypt-decrypt-memcmp in test_wc_AesCbcEncryptDecrypt() to span all of test vector and extend test vector length to be block-multiple; add ungated logic in platform-specific wc_AesCbc{En,De}crypt() routines to return with early success when blocks == 0 (also mitigates buffer overrun on short (less-than-AES_BLOCK_SIZE) input); add BAD_LENGTH_E error code; update documentation.
This commit is contained in:
@@ -527,6 +527,9 @@ const char* wc_GetErrorString(int error)
|
||||
case MISSING_KEY:
|
||||
return "Required key not set";
|
||||
|
||||
case BAD_LENGTH_E:
|
||||
return "Value of length parameter is invalid.";
|
||||
|
||||
default:
|
||||
return "unknown error number";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user