-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace CONF's internal representation with something more typesafe
Sections are stored in a CONF structure as having name == NULL and value being a STACK_OF(CONF_VALUE) with the wrong pointer type. This loses type safety and complicates all the cleanup functions. (E.g. crypto/x509 has its own X509V3_conf_free which is distinct from the copy in crypto/conf.c.) These objects are, happily, never exported outside the file. Replace them with a CONF_SECTION and store the two values in separate hash tables. This also means a CONF_VALUE's name is no longer nullable, so all the comparisons and hashes become simpler. Also fix up add_string slightly. It left the CONF in a slightly precarious state if a malloc failed in the middle. Also v->section would leak if add_string failed. Change-Id: Ib54e9dd5037766804c8ddcd80d357237d2d357ea Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/60106 Commit-Queue: David Benjamin <[email protected]> Reviewed-by: Adam Langley <[email protected]> (cherry picked from commit 313f9b0c6034e3337f50a91466bd8977442bdc21)
- Loading branch information
Showing
3 changed files
with
93 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters