Add an accessor for session->certs.
Chromium has some code which reaches into this field for memory
accounting.
This fixes a bug in doc.go where this line-wrapping confuses it. doc.go
needs a bit of a rewrite, but this is a bit better.
Change-Id: Ic9cc2c2fe9329d7bc366ccf91e0c9a92eae08ed2
Reviewed-on: https://boringssl-review.googlesource.com/27764
Commit-Queue: Steven Valdez <svaldez@google.com>
Reviewed-by: Steven Valdez <svaldez@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/util/doc.go b/util/doc.go
index 2d5a297..040ac79 100644
--- a/util/doc.go
+++ b/util/doc.go
@@ -17,6 +17,7 @@
"io/ioutil"
"os"
"path/filepath"
+ "regexp"
"strings"
)
@@ -216,6 +217,9 @@
return ""
}
+var stackOfRegexp = regexp.MustCompile(`STACK_OF\(([^)]*)\)`)
+var lhashOfRegexp = regexp.MustCompile(`LHASH_OF\(([^)]*)\)`)
+
func getNameFromDecl(decl string) (string, bool) {
for strings.HasPrefix(decl, "#if") || strings.HasPrefix(decl, "#elif") {
decl = skipLine(decl)
@@ -249,8 +253,9 @@
return decl[:i], true
}
decl = strings.TrimPrefix(decl, "OPENSSL_EXPORT ")
- decl = strings.TrimPrefix(decl, "STACK_OF(")
- decl = strings.TrimPrefix(decl, "LHASH_OF(")
+ decl = strings.TrimPrefix(decl, "const ")
+ decl = stackOfRegexp.ReplaceAllString(decl, "STACK_OF_$1")
+ decl = lhashOfRegexp.ReplaceAllString(decl, "LHASH_OF_$1")
i := strings.Index(decl, "(")
if i < 0 {
return "", false