x509asn1: improve ASN1tostr with unit tests and fixes#21013
x509asn1: improve ASN1tostr with unit tests and fixes#21013
Conversation
|
Maybe my tweak of the integer input is not entirely correct here as it now can't show negative at all... |
480f113 to
cbcb11d
Compare
There was a problem hiding this comment.
Pull request overview
This PR enhances the X.509 ASN.1-to-string conversion utilities (ASN1tostr and helpers) and adds a dedicated unit test (1667) to validate many input/output combinations across ASN.1 tags, improving confidence in certinfo extraction formatting.
Changes:
- Added unit test 1667 to exercise
ASN1tostr()across strings, times, OIDs, NULL, octet/bit strings, integers/enumerated, and booleans. - Moved ASN.1 tag/type
#defines fromx509asn1.cintox509asn1.hfor broader visibility. - Adjusted conversion behavior in
x509asn1.c(BOOLEAN validation, BIT STRING unused-bits validation, UTC time zone rendering, integer formatting changes) and updated call sites for theASN1tostr()signature change.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/unit1667.c | New unit test coverage for ASN1tostr() across many ASN.1 element types. |
| tests/unit/Makefile.inc | Adds unit1667.c to the unit test build list. |
| tests/data/test1667 | Registers the unit test as a runnable test case in the test harness. |
| tests/data/Makefile.am | Includes test1667 in the distributed test list. |
| lib/vtls/x509asn1.h | Exposes ASN.1 type constants via header for relevant TLS backends. |
| lib/vtls/x509asn1.c | Refactors ASN1tostr() signature and tweaks several ASN.1-to-string conversion helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7fedf04 to
e20b291
Compare
|
augment review |
🤖 Augment PR SummarySummary: Improves and adds unit coverage for the ASN.1-to-string conversion helpers used by X.509 certificate info extraction. Changes:
Notes: The intent appears to be more correct/consistent certinfo rendering, with regression protection via expanded unit tests. 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- move defines to header file - make bit2str require < 8 unused bits - make bool strings stricter - make UTime2str show + or - for custom time zones - removed unused 'type' argument to ASN1tostr() function - fix int2str for negative values. All values below 10000 are now shown in decimal properly, also possibly negative values. Add unit test 1667 to verify ASN1tostr
6cbb234 to
e70c9be
Compare
x509asn1
unit test 1667
Invoke ASN1tostr() with lots of variations of input and verify output.