summaryrefslogtreecommitdiff
path: root/src/regress/lib/libssl/tlslegacy/tlslegacytest.c
diff options
context:
space:
mode:
authorschwarze <>2021-11-19 09:58:41 +0000
committerschwarze <>2021-11-19 09:58:41 +0000
commita6de8aaa10fec4627b88369c4c72b0667de753da (patch)
treead88b0fd54c80f12d6a499dedf95ad711028244f /src/regress/lib/libssl/tlslegacy/tlslegacytest.c
parentca49b82866e22619b5b7a9bdbef2328b7adeff11 (diff)
downloadopenbsd-a6de8aaa10fec4627b88369c4c72b0667de753da.tar.gz
openbsd-a6de8aaa10fec4627b88369c4c72b0667de753da.tar.bz2
openbsd-a6de8aaa10fec4627b88369c4c72b0667de753da.zip
Make the public API function a2i_ASN1_STRING(3) actually work.
It contained two bugs: 1. If an input line ended in a backslash requesting line continuation, there was duplicate code for removing that backslash, erroneously removing another byte from the input and often causing the function to return failure instead of correctly parsing valid input. 2. According to a comment in the source code, the former big "for" loop was intended to "clear all the crap off the end of the line", but actually, if there were multiple characters on the line that were not hexadecimal digits, only the last of those and everything following it was deleted, while all the earlier ones remained. Besides, code further down clearly intends to error out when there are invalid characters, which makes no sense if earlier code already deletes such characters. Hence the comment did not only contradict the code above it - but contradicted the code below it, too. Resolve these contradiction in favour of stricter parsing: No longer skip invalid characters but always error out when any are found. OK & "Unbelievable" tb@
Diffstat (limited to 'src/regress/lib/libssl/tlslegacy/tlslegacytest.c')
0 files changed, 0 insertions, 0 deletions