summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_string.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Rework ASN1_STRING_set()jsing2022-03-171-14/+21
| | | | | | | | | | | Rework ASN1_STRING_set() so that we always clear and free an existing allocation, prior to storing the new data. This fixes a number of issues, including a failure to zero data if the existing allocation was too small. This also fixes other bugs such as leaving the allocation uninitialised if NULL is passed for data. Require -1 where strlen() is expected and improve length and overflow checks. ok inoguchi@ tb@
* Factor out ASN1_STRING clearing code.jsing2022-03-141-4/+15
| | | | | | | This fixes a bug in ASN1_STRING_set0() where it does not respect the ASN1_STRING_FLAG_NDEF flag and potentially frees memory that we do not own. ok inguchi@ tb@
* First pass clean up of ASN1_STRING code.jsing2022-03-141-74/+87
| | | | | | | Use consistent variable names (astr/src) rather than 'a', 'bs', 'str', 'v' or 'x', add some whitespace and remove some unneeded parentheses. ok inoguchi@ tb@
* Indent goto labels for diffability.jsing2021-12-251-4/+4
| | | | Whitespace change only.
* Move more ASN1_STRING_* functions to a_string.c.jsing2021-12-251-1/+60
| | | | No functional change.
* Reorder some functions.jsing2021-12-241-46/+46
| | | | No functional change.
* Consolidate various ASN.1 code.jsing2021-12-151-0/+333
Rather than having multiple files per type (with minimal code per file), use one file per type (a_<type>.c). No functional change. Discussed with tb@