]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Merged two identical methods together. No functionality changes.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 22 Apr 2016 03:48:37 +0000 (21:48 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 22 Apr 2016 03:48:37 +0000 (21:48 -0600)
src/client_side.cc
src/security/Handshake.cc
src/security/Handshake.h
src/ssl/bio.cc

index 416f81e179ac263d8f56c8a83d12a12816cd8585..14d1795dac7003487b897f71fdd43d869ad2be84 100644 (file)
@@ -2189,7 +2189,7 @@ ConnStateData::afterClientRead()
 #if USE_OPENSSL
     if (atTlsPeek) {
         assert(!inBuf.isEmpty());
-        if (!tlsParser.parseClientHello(inBuf)) {
+        if (!tlsParser.parseHello(inBuf)) {
             if (!tlsParser.parseError) {
                 readSomeData();
                 return;
index b493078b323ea19b08be28f16190c95e0d2e58f0..c02d58817da0a7c98f0a56459f065c83b240f2d8 100644 (file)
@@ -432,32 +432,8 @@ Security::HandshakeParser::skipMessage(const char *description)
     tkMessages.commit();
 }
 
-/// parseServerHelloTry() wrapper that maintains parseDone/parseError state
 bool
-Security::HandshakeParser::parseServerHello(const SBuf &data)
-{
-    try {
-        // data contains everything read so far, but we may read more later
-        tkRecords.reinput(data, true);
-        tkRecords.rollback();
-        while (!tkRecords.atEnd() && !parseDone)
-            parseRecord();
-        debugs(83, 7, "success; done: " << parseDone);
-        return parseDone;
-    }
-    catch (const BinaryTokenizer::InsufficientInput &) {
-        debugs(83, 5, "need more data");
-        Must(!parseError);
-    }
-    catch (const std::exception &ex) {
-        debugs(83, 2, "parsing error: " << ex.what());
-        parseError = true;
-    }
-    return false;
-}
-
-bool
-Security::HandshakeParser::parseClientHello(const SBuf &data)
+Security::HandshakeParser::parseHello(const SBuf &data)
 {
     try {
         // data contains everything read so far, but we may read more later
index fbb9f5972c895af769fd7af2d5df7cd43714fb79..813f388a9decaaa25b66bb8c203110096b473f11 100644 (file)
@@ -181,15 +181,10 @@ public:
 
     HandshakeParser(): state(atHelloNone), ressumingSession(false), parseDone(false), parseError(false), currentContentType(0), expectingModernRecords(false) {}
 
-    /// Parses the initial sequence of raw bytes sent by the SSL server.
+    /// Parses the initial sequence of raw bytes sent by the SSL agent.
     /// Returns true upon successful completion (HelloDone or Finished received).
     /// Otherwise, returns false (and sets parseError to true on errors).
-    bool parseServerHello(const SBuf &data);
-
-    /// Parses the initial sequence of raw bytes sent by the SSL client.
-    /// Returns true upon successful completion (HelloDone or Finished received).
-    /// Otherwise, returns false (and sets parseError to true on errors).
-    bool parseClientHello(const SBuf &data);
+    bool parseHello(const SBuf &data);
 
     TlsDetails::Pointer details;
 #if USE_OPENSSL
index bf85a16b64fd051dff3360a62308a03f42e586d2..09bc5873dc0eba2d1d6d7ba3246dab9b37436c66 100644 (file)
@@ -248,7 +248,7 @@ Ssl::ServerBio::readAndParse(char *buf, const int size, BIO *table)
     if (result <= 0)
         return result;
 
-    if (!parser_.parseServerHello(rbuf)) {
+    if (!parser_.parseHello(rbuf)) {
         if (!parser_.parseError) {
             BIO_set_retry_read(table);
             return -1;