cert_validate_message.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 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_SSL_CERT_VALIDATE_MESSAGE_H
10 #define SQUID_SRC_SSL_CERT_VALIDATE_MESSAGE_H
11 
12 #include "base/RefCount.h"
13 #include "helper/ResultCode.h"
14 #include "ssl/crtd_message.h"
15 #include "ssl/support.h"
16 
17 #include <vector>
18 
19 namespace Ssl
20 {
21 
27 {
28 public:
31  std::string domainName;
32 };
33 
39 {
40 public:
42 
47  class RecvdError
48  {
49  public:
50  void setCert(X509 *);
51  int id = 0;
53  std::string error_reason;
55  int error_depth = -1;
56  };
57 
58  typedef std::vector<RecvdError> RecvdErrors;
59  explicit CertValidationResponse(const Security::SessionPointer &aSession) : ssl(aSession) {}
60 
62 
65  RecvdError &getError(int errorId);
69 };
70 
81 {
82 private:
87  class CertItem
88  {
89  public:
90  std::string name;
92  void setCert(X509 *);
93  };
94 
95 public:
97 
100  void composeRequest(CertValidationRequest const &vcert);
101 
104 
106  X509 *getCertByName(std::vector<CertItem> const &, std::string const & name);
107 
109  static const std::string code_cert_validate;
111  static const std::string param_domain;
113  static const std::string param_cert;
115  static const std::string param_error_name;
117  static const std::string param_error_reason;
119  static const std::string param_error_cert;
121  static const std::string param_error_depth;
123  static const std::string param_proto_version;
125  static const std::string param_cipher;
126 
127 private:
129 };
130 
131 }//namespace Ssl
132 
133 #endif /* SQUID_SRC_SSL_CERT_VALIDATE_MESSAGE_H */
134 
Security::ErrorCode error_no
The OpenSSL error code.
int ErrorCode
Squid-defined error code (<0), an error code returned by X.509 API, or zero.
Definition: forward.h:131
Security::SessionPointer ssl
void setCert(X509 *)
Sets cert to the given certificate.
static const std::string param_error_reason
Parameter name for passing the error reason.
@ Unknown
Definition: ResultCode.h:17
static const std::string code_cert_validate
String code for "cert_validate" messages.
void composeRequest(CertValidationRequest const &vcert)
RecvdError & getError(int errorId)
RecvdErrors errors
The list of parsed errors.
static const std::string param_error_depth
Parameter name for passing the error depth.
static const std::string param_cipher
Parameter name for SSL cipher.
Helper::ResultCode resultCode
The helper result code.
static const std::string param_proto_version
Parameter name for SSL version.
std::string domainName
The server name.
static const std::string param_error_name
Parameter name for passing the major SSL error.
Security::CertPointer cert
A pointer to certificate.
CertValidationResponse(const Security::SessionPointer &aSession)
RefCount< CertValidationResponse > Pointer
X509 * getCertByName(std::vector< CertItem > const &, std::string const &name)
Search a CertItems list for the certificate with ID "name".
Definition: Xaction.cc:39
ResultCode
enumeration value for the helper response 'result' field.
Definition: ResultCode.h:16
bool parseResponse(CertValidationResponse &resp)
Parse a response message and fill the resp object with parsed information.
std::string error_reason
A string describing the error.
std::shared_ptr< SSL > SessionPointer
Definition: Session.h:53
static const std::string param_cert
Parameter name for passing SSL certificates.
Security::SessionPointer ssl
static const std::string param_domain
Parameter name for passing intended domain name.
CertValidationMsg(MessageKind kind)
std::vector< RecvdError > RecvdErrors
std::string name
The certificate Id to use.
void setCert(X509 *)
Sets cert to the given certificate.
Security::CertPointer cert
The broken certificate.
static const std::string param_error_cert
Parameter name for passing the error cert ID.
Security::CertErrors * errors
The list of errors detected.
void tryParsingResponse(CertValidationResponse &)
static uint64_t MemoryUsedByResponse(const CertValidationResponse::Pointer &)

 

Introduction

Documentation

Support

Miscellaneous