This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 4cf8ff4 Make code buildable with BoringSSL
4cf8ff4 is described below
commit 4cf8ff44df137b9e3ebf3b373be9051553907fdf
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Tue Sep 10 16:49:01 2019 +0900
Make code buildable with BoringSSL
Checked with the latest code f7b830d8df9f5578c748aa0283d44c59ea7eeb25
(cherry picked from commit 6c0eb634b5082532b52272a8d3d7e7905f74d00c)
---
example/plugins/c-api/client_context_dump/client_context_dump.cc | 2 +-
iocore/net/P_SSLNetVConnection.h | 8 ++++++++
plugins/experimental/cert_reporting_tool/cert_reporting_tool.cc | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/example/plugins/c-api/client_context_dump/client_context_dump.cc
b/example/plugins/c-api/client_context_dump/client_context_dump.cc
index 36b20dd..034b556 100644
--- a/example/plugins/c-api/client_context_dump/client_context_dump.cc
+++ b/example/plugins/c-api/client_context_dump/client_context_dump.cc
@@ -116,7 +116,7 @@ dump_context(const char *ca_path, const char *ck_path)
// Serial number
int64_t sn = 0;
-#if OPENSSL_VERSION_NUMBER >= 0x010100000
+#if !defined(OPENSSL_IS_BORINGSSL) && (OPENSSL_VERSION_NUMBER >= 0x010100000)
ASN1_INTEGER_get_int64(&sn, serial);
#else
sn = ASN1_INTEGER_get(serial);
diff --git a/iocore/net/P_SSLNetVConnection.h b/iocore/net/P_SSLNetVConnection.h
index 0240ee7..0dae517 100644
--- a/iocore/net/P_SSLNetVConnection.h
+++ b/iocore/net/P_SSLNetVConnection.h
@@ -309,12 +309,20 @@ public:
return nullptr;
}
+#ifndef OPENSSL_IS_BORINGSSL
int curve_nid = SSL_get_shared_curve(ssl, 0);
if (curve_nid == NID_undef) {
return nullptr;
}
return OBJ_nid2sn(curve_nid);
+#else
+ if (uint16_t curve_id = SSL_get_curve_id(ssl); curve_id != 0) {
+ return SSL_get_curve_name(curve_id);
+ } else {
+ return nullptr;
+ }
+#endif
}
bool
diff --git a/plugins/experimental/cert_reporting_tool/cert_reporting_tool.cc
b/plugins/experimental/cert_reporting_tool/cert_reporting_tool.cc
index 0103418..fd6ab40 100644
--- a/plugins/experimental/cert_reporting_tool/cert_reporting_tool.cc
+++ b/plugins/experimental/cert_reporting_tool/cert_reporting_tool.cc
@@ -115,7 +115,7 @@ dump_context(const char *ca_path, const char *ck_path)
// Serial number
int64_t sn = 0;
-#if OPENSSL_VERSION_NUMBER >= 0x010100000
+#if !defined(OPENSSL_IS_BORINGSSL) && (OPENSSL_VERSION_NUMBER >= 0x010100000)
ASN1_INTEGER_get_int64(&sn, serial);
#else
sn = ASN1_INTEGER_get(serial);