#if USE_OPENSSL
if (atTlsPeek) {
assert(!inBuf.isEmpty());
- if (!tlsParser.parseClientHello(inBuf)) {
+ if (!tlsParser.parseHello(inBuf)) {
if (!tlsParser.parseError) {
readSomeData();
return;
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
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
if (result <= 0)
return result;
- if (!parser_.parseServerHello(rbuf)) {
+ if (!parser_.parseHello(rbuf)) {
if (!parser_.parseError) {
BIO_set_retry_read(table);
return -1;