summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2018-12-19 13:57:27 -0800
committerSam Roberts <vieuxtech@gmail.com>2018-12-28 12:57:24 -0800
commit08387b245ecfe5fb736d2d6753b880e644a4f3e2 (patch)
treeea58e31bb3b20b18a07807fa8cb03a9e6e3b29dc
parentacb49dc04d3700398f58fec2011661383077b638 (diff)
downloadandroid-node-v8-08387b245ecfe5fb736d2d6753b880e644a4f3e2.tar.gz
android-node-v8-08387b245ecfe5fb736d2d6753b880e644a4f3e2.tar.bz2
android-node-v8-08387b245ecfe5fb736d2d6753b880e644a4f3e2.zip
tls: remove unused ocsp extension parsing
The OCSP info from parsing the TLS ClientHello has not been used since 550c263, remove it. See: https://github.com/nodejs/node/pull/1464 PR-URL: https://github.com/nodejs/node/pull/25153 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
-rw-r--r--src/node_crypto.cc3
-rw-r--r--src/node_crypto_clienthello-inl.h1
-rw-r--r--src/node_crypto_clienthello.cc13
-rw-r--r--src/node_crypto_clienthello.h5
4 files changed, 0 insertions, 22 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index c2faad0a59..8d5ac86919 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -1559,9 +1559,6 @@ void SSLWrap<Base>::OnClientHello(void* arg,
hello_obj->Set(context,
env->tls_ticket_string(),
Boolean::New(env->isolate(), hello.has_ticket())).FromJust();
- hello_obj->Set(context,
- env->ocsp_request_string(),
- Boolean::New(env->isolate(), hello.ocsp_request())).FromJust();
Local<Value> argv[] = { hello_obj };
w->MakeCallback(env->onclienthello_string(), arraysize(argv), argv);
diff --git a/src/node_crypto_clienthello-inl.h b/src/node_crypto_clienthello-inl.h
index 9de8f2e5fc..1262186a92 100644
--- a/src/node_crypto_clienthello-inl.h
+++ b/src/node_crypto_clienthello-inl.h
@@ -48,7 +48,6 @@ inline void ClientHelloParser::Reset() {
tls_ticket_ = nullptr;
servername_size_ = 0;
servername_ = nullptr;
- ocsp_request_ = 0;
}
inline void ClientHelloParser::Start(ClientHelloParser::OnHelloCb onhello_cb,
diff --git a/src/node_crypto_clienthello.cc b/src/node_crypto_clienthello.cc
index cbe1be3273..b037575577 100644
--- a/src/node_crypto_clienthello.cc
+++ b/src/node_crypto_clienthello.cc
@@ -112,7 +112,6 @@ void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) {
hello.session_id_ = session_id_;
hello.session_size_ = session_size_;
hello.has_ticket_ = tls_ticket_ != nullptr && tls_ticket_size_ != 0;
- hello.ocsp_request_ = ocsp_request_;
hello.servername_ = servername_;
hello.servername_size_ = static_cast<uint8_t>(servername_size_);
onhello_cb_(cb_arg_, hello);
@@ -149,18 +148,6 @@ void ClientHelloParser::ParseExtension(const uint16_t type,
}
}
break;
- case kStatusRequest:
- // We are ignoring any data, just indicating the presence of extension
- if (len < kMinStatusRequestSize)
- return;
-
- // Unknown type, ignore it
- if (data[0] != kStatusRequestOCSP)
- break;
-
- // Ignore extensions, they won't work with caching on backend anyway
- ocsp_request_ = 1;
- break;
case kTLSSessionTicket:
tls_ticket_size_ = len;
tls_ticket_ = data + len;
diff --git a/src/node_crypto_clienthello.h b/src/node_crypto_clienthello.h
index 687e9589b6..2ced72c4e8 100644
--- a/src/node_crypto_clienthello.h
+++ b/src/node_crypto_clienthello.h
@@ -41,7 +41,6 @@ class ClientHelloParser {
inline bool has_ticket() const { return has_ticket_; }
inline uint8_t servername_size() const { return servername_size_; }
inline const uint8_t* servername() const { return servername_; }
- inline int ocsp_request() const { return ocsp_request_; }
private:
uint8_t session_size_;
@@ -49,7 +48,6 @@ class ClientHelloParser {
bool has_ticket_;
uint8_t servername_size_;
const uint8_t* servername_;
- int ocsp_request_;
friend class ClientHelloParser;
};
@@ -69,7 +67,6 @@ class ClientHelloParser {
static const size_t kMaxTLSFrameLen = 16 * 1024 + 5;
static const size_t kMaxSSLExFrameLen = 32 * 1024;
static const uint8_t kServernameHostname = 0;
- static const uint8_t kStatusRequestOCSP = 1;
static const size_t kMinStatusRequestSize = 5;
enum ParseState {
@@ -93,7 +90,6 @@ class ClientHelloParser {
enum ExtensionType {
kServerName = 0,
- kStatusRequest = 5,
kTLSSessionTicket = 35
};
@@ -115,7 +111,6 @@ class ClientHelloParser {
const uint8_t* session_id_ = nullptr;
uint16_t servername_size_ = 0;
const uint8_t* servername_ = nullptr;
- uint8_t ocsp_request_ = 0;
uint16_t tls_ticket_size_ = -1;
const uint8_t* tls_ticket_ = nullptr;
};