Split original ASN.1 code from asn.c into asn_orig.c#9920
Split original ASN.1 code from asn.c into asn_orig.c#9920dgarske wants to merge 4 commits intowolfSSL:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Moves the non-template ASN.1 implementation into a separate asn_orig.c file and ensures it’s included in distributed source archives.
Changes:
- Adds the new
wolfcrypt/src/asn_orig.cfile to Automake’sEXTRA_DISTso it’s shipped in release tarballs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
Jenkins retest this please |
|
Jenkins retest this please |
2 similar comments
|
Jenkins retest this please |
|
Jenkins retest this please |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
Jenkins retest this please |
|
Jenkins retest this please - history lost |
|
Jenkins retest this please |
Move non-template (WOLFSSL_ASN_ORIGINAL) code into asn_orig.c and include from asn.c.
Add settings.h include before the compile guard in asn_orig.c so WOLFSSL_IGNORE_FILE_WARN is available when compiled separately. Add -Wno-pedantic for asn_orig.c in async examples Makefile to suppress empty translation unit warning.
Three fixes for guard-context correctness in the ASN.1 code split: 1. Strip WOLFSSL_ASN_ORIG_INCLUDED from forward declaration wrappers. The file-guard was being applied to fwd decls in asn.c, but at the fwd-decl site that macro is not yet defined, so #ifndef ... #else inverted the condition and hid all declarations. 2. Add outer feature guard tracking. Large feature sections (HAVE_OCSP, HAVE_CRL, WOLFSSL_CERT_GEN, etc.) that span many functions in asn.c are now tracked and re-emitted around the corresponding blocks in asn_orig.c, fixing 'unknown type name' errors in minimal builds. 3. Collect multi-line #if continuations in the outer guard map so that full guard conditions (e.g. #if !defined(NO_RSA) && \ continued across lines) are stored and compared as complete strings, preventing duplicate guard emission. Both modes build and pass tests (5 PASS, 0 FAIL each): ./configure --enable-asn=original && make check ./configure && make check
Forward declarations in asn.c and asn_orig.c now use guard transitions (same mechanism as the function bodies) so consecutive declarations with the same feature guard are grouped in a single #ifdef/#endif block rather than each having its own open/close pair. Also removed the now-redundant _find_func_outer_guards calls from _emit_split_body_orig; outer feature guard context is emitted at the generate_asn_orig loop level, not inside the per-block emitters. Both modes still build and pass tests (5 PASS, 0 FAIL each).
Move non-template (
WOLFSSL_ASN_ORIGINAL) code intoasn_orig.cand include fromasn.c.