ThePassionate opened a new pull request, #4114:
URL: https://github.com/apache/nuttx-apps/pull/4114

   ## Summary
   
   `mbedtls_cipher_cmac_starts()` in the cryptodev `cmac_alt` only accepted 
`MBEDTLS_CIPHER_AES_128_ECB`, so a CMAC over an AES-256 key failed with 
`MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA` even though the cryptodev backend has 
supported `CRYPTO_AES_256_CMAC` sessions since the kernel gained the algorithm.
   
   Accept `MBEDTLS_CIPHER_AES_256_ECB` too and pick `CRYPTO_AES_256_CMAC` for 
it; the key length of the session already selects the 256-bit key schedule.
   
   ## Impact
   
   `apps/crypto/mbedtls` alt layer only. The file does not build on master as 
it is - it reaches into private mbedtls members without 
`MBEDTLS_ALLOW_PRIVATE_ACCESS`, a pre-existing condition unchanged (and not 
worsened: with private access allowed it compiles clean with the new case) by 
this patch.
   
   ## Testing
   
   Build-tested with sim:sim/crypto with `CONFIG_CRYPTO_MBEDTLS` and 
`CONFIG_MBEDTLS_CMAC_ALT` (with `MBEDTLS_ALLOW_PRIVATE_ACCESS`, see the Impact 
note); the `aescmac` test passes for 128- and 256-bit keys through the kernel 
path. Not run on hardware.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to