Skip to content

Commit acf7802

Browse files
sam-githubtargos
authored andcommitted
tls: remove unused ocsp extension parsing
The OCSP info from parsing the TLS ClientHello has not been used since 550c263, remove it. See: #1464 PR-URL: #25153 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]>
1 parent 56e7e4f commit acf7802

4 files changed

+0
-22
lines changed

src/node_crypto.cc

-3
Original file line numberDiff line numberDiff line change
@@ -1532,9 +1532,6 @@ void SSLWrap<Base>::OnClientHello(void* arg,
15321532
hello_obj->Set(context,
15331533
env->tls_ticket_string(),
15341534
Boolean::New(env->isolate(), hello.has_ticket())).FromJust();
1535-
hello_obj->Set(context,
1536-
env->ocsp_request_string(),
1537-
Boolean::New(env->isolate(), hello.ocsp_request())).FromJust();
15381535

15391536
Local<Value> argv[] = { hello_obj };
15401537
w->MakeCallback(env->onclienthello_string(), arraysize(argv), argv);

src/node_crypto_clienthello-inl.h

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ inline void ClientHelloParser::Reset() {
4848
tls_ticket_ = nullptr;
4949
servername_size_ = 0;
5050
servername_ = nullptr;
51-
ocsp_request_ = 0;
5251
}
5352

5453
inline void ClientHelloParser::Start(ClientHelloParser::OnHelloCb onhello_cb,

src/node_crypto_clienthello.cc

-13
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) {
112112
hello.session_id_ = session_id_;
113113
hello.session_size_ = session_size_;
114114
hello.has_ticket_ = tls_ticket_ != nullptr && tls_ticket_size_ != 0;
115-
hello.ocsp_request_ = ocsp_request_;
116115
hello.servername_ = servername_;
117116
hello.servername_size_ = static_cast<uint8_t>(servername_size_);
118117
onhello_cb_(cb_arg_, hello);
@@ -149,18 +148,6 @@ void ClientHelloParser::ParseExtension(const uint16_t type,
149148
}
150149
}
151150
break;
152-
case kStatusRequest:
153-
// We are ignoring any data, just indicating the presence of extension
154-
if (len < kMinStatusRequestSize)
155-
return;
156-
157-
// Unknown type, ignore it
158-
if (data[0] != kStatusRequestOCSP)
159-
break;
160-
161-
// Ignore extensions, they won't work with caching on backend anyway
162-
ocsp_request_ = 1;
163-
break;
164151
case kTLSSessionTicket:
165152
tls_ticket_size_ = len;
166153
tls_ticket_ = data + len;

src/node_crypto_clienthello.h

-5
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,13 @@ class ClientHelloParser {
4141
inline bool has_ticket() const { return has_ticket_; }
4242
inline uint8_t servername_size() const { return servername_size_; }
4343
inline const uint8_t* servername() const { return servername_; }
44-
inline int ocsp_request() const { return ocsp_request_; }
4544

4645
private:
4746
uint8_t session_size_;
4847
const uint8_t* session_id_;
4948
bool has_ticket_;
5049
uint8_t servername_size_;
5150
const uint8_t* servername_;
52-
int ocsp_request_;
5351

5452
friend class ClientHelloParser;
5553
};
@@ -69,7 +67,6 @@ class ClientHelloParser {
6967
static const size_t kMaxTLSFrameLen = 16 * 1024 + 5;
7068
static const size_t kMaxSSLExFrameLen = 32 * 1024;
7169
static const uint8_t kServernameHostname = 0;
72-
static const uint8_t kStatusRequestOCSP = 1;
7370
static const size_t kMinStatusRequestSize = 5;
7471

7572
enum ParseState {
@@ -93,7 +90,6 @@ class ClientHelloParser {
9390

9491
enum ExtensionType {
9592
kServerName = 0,
96-
kStatusRequest = 5,
9793
kTLSSessionTicket = 35
9894
};
9995

@@ -115,7 +111,6 @@ class ClientHelloParser {
115111
const uint8_t* session_id_ = nullptr;
116112
uint16_t servername_size_ = 0;
117113
const uint8_t* servername_ = nullptr;
118-
uint8_t ocsp_request_ = 0;
119114
uint16_t tls_ticket_size_ = -1;
120115
const uint8_t* tls_ticket_ = nullptr;
121116
};

0 commit comments

Comments
 (0)