CCM*: Remove nested if
@@ -152,13 +152,11 @@ static int ccm_auth_crypt( mbedtls_ccm_context *ctx, int mode, size_t length,
* Check length requirements: SP800-38C A.1
* Additional requirement: a < 2^16 - 2^8 to simplify the code.
* 'length' checked later (when writing it to the first block)
+ *
+ * Also, loosen the requirements to enable support for CCM* (IEEE 802.15.4).
*/
- if( tag_len < 4 || tag_len > 16 || tag_len % 2 != 0 )
+ if( tag_len == 2 || tag_len > 16 || tag_len % 2 != 0 )
{
- /*
- * Loosen the requirements to enable support for CCM* (IEEE 802.15.4)
- */
- if( tag_len != 0 )
return( MBEDTLS_ERR_CCM_BAD_INPUT );
}
