Merged
Conversation
VELAPLATFO-62586 Change-Id: I5d7675c05dc3a52c1cb15a6132b969a19f848248 Signed-off-by: makejian <makejian@xiaomi.com> (cherry picked from commit 409c86a062a816b56a3a48b1111102d12f24a48f)
…mqtt VELAPLATFO-62586 Change-Id: I3b56b028e76aee118ed90211c097ac3fe86bc129 Signed-off-by: makejian <makejian@xiaomi.com> (cherry picked from commit 7a567e98489f64b740044b9ce4066fa8d41af359)
VELAPLATFO-62586 Change-Id: I2ceac930c87196a16ea7ddf5e4130bb991b51025 Signed-off-by: makejian <makejian@xiaomi.com> (cherry picked from commit d0547662d5006ec0a348d89d3d7e251ef4bb183c)
…hen ssl error VELAPLATFO-66562 Change-Id: Ibb1446a7fcae1d2bc09d75052466a6ce084103b8 Signed-off-by: makejian <makejian@xiaomi.com>
Contributor
Author
|
@xiaoxiang781216 How can I ignore the case-sensitive style check for this commit? |
Contributor
let's ignore the warning directly, but fix the spell warning. The 3rd party case issue doen't need fix. |
Contributor
|
@ThePassionate please fix check error. |
Fix coding style issues in OpenSSL/MbedTLS wrapper implementation: - Align whitespace and indentation - Fix line formatting - Ensure consistent code style per NuttX standards Signed-off-by: makejian <makejian@xiaomi.com>
Contributor
Author
Thanks, i have fixed check error expect 'error: Mixed case identifier found' |
xiaoxiang781216
approved these changes
Jan 17, 2026
Donny9
approved these changes
Jan 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This commit introduces significant functional enhancements and code optimizations to the
crypto/openssl_mbedtls_wrappercomponent. The primary goal is to improve the functional completeness, debugging convenience, code robustness, and memory safety of this wrapper layer, providing upper-layer applications with a more stable MbedTLS backend that more closely aligns with the standard OpenSSL API.Key Changes and Rationale:
New Configuration Options (
Kconfig): Introduces four debug behavior configurations (DEBUG,EXIT,DEBUG_EXIT,DEBUG_BLOCK) for theSSL_ASSERTmacros. This allows developers to flexibly choose the handling strategy upon assertion failure (print only, return error code only, print then return, print then block) based on debugging or production environment needs, significantly enhancing issue diagnosis capabilities.Greatly Expanded API Compatibility:
bio.h,err.h,evp.h,ssl.h,ssl_local.h,tls1.h,types.h, andx509.h. For example, critical APIs forBIOchaining,SSLsession management,TLSprotocol version methods, andX509certificate file loading were added, substantially improving compatibility with existing OpenSSL code.bio_b64.c(Base64 BIO filter),bio_lib.c(BIO core library), andbss_mem.c(memory BIO), completing foundational functionality.Refactored and Optimized Core Implementation (
ssl_pm.c,ssl_lib.c, etc.):x509_pm.x509_crt) from a dynamically allocated pointer to a stack object. This simplifies lifecycle management and eliminates potential memory leaks and null pointer dereferences.x509_pm_load_fileandx509_pm_load_pathmethods to thex509_pmstructure, supporting direct certificate loading from files or paths for improved usability.SSL_ERROR_WANT_READ/WRITE) in functions likessl_pm_read/write, leading to more precise error handling.LOCAL_ATTRmacro for consistent coding style. Replacedprintfdebug outputs with the project-definedSSL_DEBUGmacro for more standardized and controllable logging.Impact
Impact on Users (Developers):
BIO_f_base64,SSL_CTX_use_certificate_chain_file,ERR_print_errors_cb), improving portability and development experience. The new debug options provide powerful tools for troubleshooting TLS/SSL issues.struct x509_pm(x509_crtchanged from a pointer to an embedded object), any third-party code or downstream patches directly manipulating this internal structure may require adjustments. This change is necessary for advancing towards a safer, simpler memory model.Impact on Security: Positive impact. The optimized memory management model reduces risks associated with improper memory handling. More complete error handling aids developers in writing more robust secure communication code.
Testing
Verification Methods:
OPENSSL_MBEDTLS_WRAPPERenabled, ensuring no compilation errors or warnings.SSL_CTX_use_certificate_chain_file.SSL_ASSERTconfiguration modes behave as expected under simulated error conditions (e.g., printing info, exiting, or blocking upon assertion failure).Test Environment (Example, please update based on actual situation):
sim:nsh(simulator)CRYPTO_MBEDTLSandOPENSSL_MBEDTLS_WRAPPER.please ignore openssl mix case warning: