x509asn1: fixed and adapted for ASN1tostr unit testing

- 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

Closes #21013
This commit is contained in:
Daniel Stenberg 2026-03-19 16:51:07 +01:00
parent 756725a32b
commit 14782b36fe
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 438 additions and 61 deletions

View file

@ -222,7 +222,7 @@ test1640 test1641 test1642 test1643 \
\
test1650 test1651 test1652 test1653 test1654 test1655 test1656 test1657 \
test1658 test1659 test1660 test1661 test1662 test1663 test1664 test1665 \
test1666 \
test1666 test1667 \
\
test1670 test1671 \
\

20
tests/data/test1667 Normal file
View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
unittest
ASN1tostr
x509asn1
</keywords>
</info>
# Client-side
<client>
<features>
unittest
</features>
<name>
ASN1tostr unit tests
</name>
</client>
</testcase>