]>
Commit | Line | Data |
---|---|---|
0461fde7 | 1 | /* |
4ac4a490 | 2 | * Copyright (C) 1996-2017 The Squid Software Foundation and contributors |
0461fde7 AJ |
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 | |
67c99fc6 | 12 | #include "anyp/ProtocolVersion.h" |
3cae14a6 | 13 | #include "security/Handshake.h" |
995365cd | 14 | #include "security/Session.h" |
2bcab852 CT |
15 | |
16 | namespace Security { | |
0461fde7 | 17 | |
2bcab852 CT |
18 | class NegotiationHistory |
19 | { | |
20 | public: | |
10f0e358 | 21 | NegotiationHistory(); |
8abcff99 CT |
22 | |
23 | /// Extract negotiation information from TLS object | |
ad23e748 | 24 | void retrieveNegotiatedInfo(const Security::SessionPointer &); |
8abcff99 CT |
25 | |
26 | /// Extract information from parser stored in TlsDetails object | |
27 | void retrieveParsedInfo(Security::TlsDetails::Pointer const &details); | |
28 | ||
2bcab852 CT |
29 | const char *cipherName() const; ///< The name of negotiated cipher |
30 | /// String representation of TLS negotiated version | |
31 | const char *negotiatedVersion() const {return printTlsVersion(version_);} | |
32 | /// String representation of the received TLS hello message version. | |
33 | const char *helloVersion() const {return printTlsVersion(helloVersion_);} | |
34 | /// String representation of the maximum supported TLS version | |
35 | /// by remote peer | |
36 | const char *supportedVersion() const {return printTlsVersion(supportedVersion_);} | |
37 | private: | |
38 | /// String representation of the TLS version 'v' | |
67c99fc6 CT |
39 | const char *printTlsVersion(AnyP::ProtocolVersion const &v) const; |
40 | AnyP::ProtocolVersion helloVersion_; ///< The TLS version of the hello message | |
41 | AnyP::ProtocolVersion supportedVersion_; ///< The maximum supported TLS version | |
42 | AnyP::ProtocolVersion version_; ///< The negotiated TLS version | |
2bcab852 CT |
43 | #if USE_OPENSSL |
44 | const SSL_CIPHER *cipher; ///< The negotiated cipher | |
45 | #endif | |
46 | }; | |
47 | ||
48 | } // namespace Security | |
49 | ||
0461fde7 | 50 | #endif /* SQUID_SRC_SECURITY_NEGOTIATIONHISTORY_H */ |
2bcab852 | 51 |