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

   ## Summary
   
   `cryptodev_clone()` in the cryptodev `dev_alt` relied on `dup2()`, which 
reopens the cryptodev descriptor through the driver's open method: the sessions 
are recreated from their parameters with fresh state, without the intermediate 
hash state. `mbedtls_md_clone()` built on it therefore produced a context that 
restarted the digest, and a digest split over several updates came out wrong.
   
   Ask the kernel for an independent descriptor with `CIOCCLONE` instead, which 
copies the running session state. If the driver behind the session cannot 
clone, the ioctl fails and its error is returned to the caller.
   
   ## Impact
   
   `apps/crypto/mbedtls` alt layer only.
   
   ## Testing
   
   Build-tested with sim:sim/crypto and `CONFIG_CRYPTO_MBEDTLS`; the `clone` 
test passes (sha256, hmac-sha256, aes-cmac, close-source, aes-cbc).
   


-- 
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