CommunicationSecrets.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2022 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_COMMUNICATION_SECRETS_H
10 #define SQUID_SRC_SECURITY_COMMUNICATION_SECRETS_H
11 
12 #include "sbuf/SBuf.h"
13 #include "security/forward.h"
14 
15 #include <iosfwd>
16 
17 namespace Security {
18 
22 {
23 public:
24  CommunicationSecrets() = default;
25  explicit CommunicationSecrets(const Connection &sconn);
26 
28  bool gotAll() const;
29 
33  bool learnNew(const CommunicationSecrets &news);
34 
36  void record(std::ostream &) const;
37 
38 private:
39 #if USE_OPENSSL
40  void getClientRandom(const Connection &sconn);
41  void getSessionId(const Session &session);
42  void getMasterKey(const Session &session);
43 #else
44  // Secret extraction is not supported in builds using other TLS libraries.
45  // Secret extraction is impractical in builds without TLS libraries.
46 #endif
47 
48  SBuf id;
51 };
52 
53 } // namespace Security
54 
55 #endif /* SQUID_SRC_SECURITY_COMMUNICATION_SECRETS_H */
56 
bool gotAll() const
whether we know all the secrets that could be extracted
void getSessionId(const Session &session)
void record(std::ostream &) const
logs all known secrets using a (multiline) SSLKEYLOGFILE format
Definition: SBuf.h:87
void getClientRandom(const Connection &sconn)
bool learnNew(const CommunicationSecrets &news)
SBuf random
CLIENT_RANDOM from the TLS connection.
SBuf key
TLS session (pre-)master key.
SSL Connection
Definition: Session.h:45
void getMasterKey(const Session &session)
SSL_SESSION Session
Definition: Session.h:47
Network/connection security abstraction layer.
Definition: Connection.h:34

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors