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

   ## Summary
   
   Syncs the OpenSSL-to-Mbed-TLS compatibility wrapper with the evolution it 
went through in the Xiaomi Vela tree - the part that is not upstream yet. Of 
the 28 wrapper commits on the Vela side, the earliest 15 are already upstream; 
this series carries the remaining work, folded into five commits:
   
   * **fix build and Mbed TLS 3.6 compatibility**: the wrapper does not build 
on current master - no defconfig enables it, so nothing catches it: cipher.c 
reaches into Mbed TLS 3.x private members, and bio_lib.c calls zalloc/free 
without declarations. This adapts the code to the public accessors and zeroes 
the warnings.
   * **raw key export and DER serialization**: EVP_PKEY raw key export and DER 
(re)serialization helpers.
   * **interfaces needed by libwebsockets**, and the ERR_error_string() 
definition (err.h declares it, nothing defines it).
   * **route allocations through mbedtls_calloc**: the wrapper's allocations go 
through the Mbed TLS allocator so its allocation configuration applies.
   * **PKCS12 parsing support** plus a cmocka test.
   
   ## Impact
   
   No defconfig enables the wrapper (`CONFIG_CRYPTO_OPENSSL_MBEDTLS_WRAPPER`), 
so nothing changes for existing builds.
   
   Note on the check job: it fails on this PR, but not because of anything 
fixable in this code - the wrapper implements the OpenSSL API, whose 
identifiers (`X509_*`, `PKCS12_*`, `EVP_*`, ...) are mixed case by definition. 
446 of the 544 reports are pre-existing lines in the touched files - master's 
own wrapper carries 562 such reports and the directory was last touched in 
August, before the nxstyle tightening - and the remaining 98 are the same 
OpenSSL API names in the added code. Renaming them would break the very 
interface this layer exists to provide. If the OpenSSL naming needs a waiver in 
tools/checkpatch.sh or nxstyle, I'm happy to prepare that separately.
   
   ## Testing
   
   Built with sim:nsh + `CONFIG_CRYPTO_MBEDTLS` + 
`CONFIG_CRYPTO_OPENSSL_MBEDTLS_WRAPPER` (plus module symbols and 
`CONFIG_DEV_URANDOM=y`), against the Mbed TLS 3.6.2 the build fetches: each 
commit of the series builds standalone, the final state has 0 warnings and 0 
errors. The PKCS12 test passes on sim (2/2: null arguments, parse/serialize 
round trip with key/cert/ca assertions and `EVP_PKEY_eq`/`X509_cmp` comparison).
   


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