2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
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.
9 #ifndef SQUID_SRC_SECURITY_NEGOTIATIONHISTORY_H
10 #define SQUID_SRC_SECURITY_NEGOTIATIONHISTORY_H
12 #include "anyp/ProtocolVersion.h"
13 #include "security/Handshake.h"
14 #include "security/Session.h"
18 class NegotiationHistory
23 /// Extract negotiation information from TLS object
24 void retrieveNegotiatedInfo(const Security::SessionPointer
&);
26 /// Extract information from parser stored in TlsDetails object
27 void retrieveParsedInfo(Security::TlsDetails::Pointer
const &details
);
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
36 const char *supportedVersion() const {return printTlsVersion(supportedVersion_
);}
38 /// String representation of the TLS version 'v'
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
44 const SSL_CIPHER
*cipher
; ///< The negotiated cipher
48 } // namespace Security
50 #endif /* SQUID_SRC_SECURITY_NEGOTIATIONHISTORY_H */