Remove some old commented out OpenSSL debug code We should also rewrite this parser. There's no reason to mutate the buffer. Change-Id: I4a6b39477104f32e3137c9a6d8ed77b6c0dfbe99 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/97148 Auto-Submit: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: David Benjamin <davidben@google.com> Presubmit-BoringSSL-Verified: boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/crypto/x509/v3_utl.cc b/crypto/x509/v3_utl.cc index 5fbf0d5..765dfa6 100644 --- a/crypto/x509/v3_utl.cc +++ b/crypto/x509/v3_utl.cc
@@ -303,8 +303,6 @@ #define HDR_NAME 1 #define HDR_VALUE 2 -// #define DEBUG - STACK_OF(CONF_VALUE) *bssl::X509V3_parse_list(const char *line) { char *p, *q, c; char *ntmp, *vtmp; @@ -312,6 +310,8 @@ char *linebuf; int state; // We are going to modify the line so copy it first + // TODO(davidben): Rewrite this parser with `std::string_view`. It doesn't + // need to copy the string. linebuf = OPENSSL_strdup(line); if (linebuf == nullptr) { goto err; @@ -335,9 +335,6 @@ *p = 0; ntmp = strip_spaces(q); q = p + 1; -#if 0 - printf("%s\n", ntmp); -#endif if (!ntmp) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_NAME); goto err; @@ -351,9 +348,6 @@ state = HDR_NAME; *p = 0; vtmp = strip_spaces(q); -#if 0 - printf("%s\n", ntmp); -#endif if (!vtmp) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_VALUE); goto err; @@ -367,9 +361,6 @@ if (state == HDR_VALUE) { vtmp = strip_spaces(q); -#if 0 - printf("%s=%s\n", ntmp, vtmp); -#endif if (!vtmp) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_VALUE); goto err; @@ -377,9 +368,6 @@ X509V3_add_value(ntmp, vtmp, &values); } else { ntmp = strip_spaces(q); -#if 0 - printf("%s\n", ntmp); -#endif if (!ntmp) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_NAME); goto err;