GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — crypto: replace gotos · nodejs/node@398c0e0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_crypto_clienthello.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_crypto_clienthello.cc‎

Copy file name to clipboardExpand all lines: src/node_crypto_clienthello.cc
+4-12Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,6 @@ bool ClientHelloParser::ParseRecordHeader(const uint8_t* data, size_t avail) {
7474

7575
void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) {
7676
ClientHello hello;
77-
bool failed = true;
78-
79-
OnScopeLeave cleanup([&]() {
80-
if (failed)
81-
End();
82-
});
8377

8478
// >= 5 + frame size bytes for frame parsing
8579
if (body_offset_ + frame_len_ > avail)
@@ -94,23 +88,23 @@ void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) {
9488
if (data[body_offset_ + 4] != 0x03 ||
9589
data[body_offset_ + 5] < 0x01 ||
9690
data[body_offset_ + 5] > 0x03) {
97-
return;
91+
return End();
9892
}
9993

10094
if (data[body_offset_] == kClientHello) {
10195
if (state_ == kTLSHeader) {
10296
if (!ParseTLSClientHello(data, avail))
103-
return;
97+
return End();
10498
} else {
10599
// We couldn't get here, but whatever
106-
return;
100+
return End();
107101
}
108102

109103
// Check if we overflowed (do not reply with any private data)
110104
if (session_id_ == nullptr ||
111105
session_size_ > 32 ||
112106
session_id_ + session_size_ > data + avail) {
113-
return;
107+
return End();
114108
}
115109
}
116110

@@ -122,8 +116,6 @@ void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) {
122116
hello.servername_ = servername_;
123117
hello.servername_size_ = static_cast<uint8_t>(servername_size_);
124118
onhello_cb_(cb_arg_, hello);
125-
failed = false;
126-
return;
127119
}
128120

129121

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.