]> git.ipfire.org Git - thirdparty/squid.git/blame - src/security/NegotiationHistory.h
Improve TLS/SSL parsing code in Handshale.cc and use it inside bio.cc for client
[thirdparty/squid.git] / src / security / NegotiationHistory.h
CommitLineData
0461fde7
AJ
1/*
2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef SQUID_SRC_SECURITY_NEGOTIATIONHISTORY_H
10#define SQUID_SRC_SECURITY_NEGOTIATIONHISTORY_H
2bcab852 11
33cc0629 12#include "security/Session.h"
2bcab852
CT
13
14namespace Security {
0461fde7 15
2bcab852
CT
16class NegotiationHistory
17{
18public:
10f0e358 19 NegotiationHistory();
33cc0629 20 void fillWith(Security::SessionPtr); ///< Extract negotiation information from TLS object
2bcab852
CT
21 const char *cipherName() const; ///< The name of negotiated cipher
22 /// String representation of TLS negotiated version
23 const char *negotiatedVersion() const {return printTlsVersion(version_);}
24 /// String representation of the received TLS hello message version.
25 const char *helloVersion() const {return printTlsVersion(helloVersion_);}
26 /// String representation of the maximum supported TLS version
27 /// by remote peer
28 const char *supportedVersion() const {return printTlsVersion(supportedVersion_);}
29private:
30 /// String representation of the TLS version 'v'
31 const char *printTlsVersion(int v) const;
32 int helloVersion_; ///< The TLL version of the hello message
33 int supportedVersion_; ///< The maximum supported TLS version
34 int version_; ///< The negotiated TLL version
35#if USE_OPENSSL
36 const SSL_CIPHER *cipher; ///< The negotiated cipher
37#endif
38};
39
40} // namespace Security
41
0461fde7 42#endif /* SQUID_SRC_SECURITY_NEGOTIATIONHISTORY_H */
2bcab852 43