cert_validate_message.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2019 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_SSL_CERT_VALIDATE_MESSAGE_H
10 #define SQUID_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  RecvdError(): id(0), error_no(SSL_ERROR_NONE), cert(NULL), error_depth(-1) {}
51  RecvdError(const RecvdError &);
52  RecvdError & operator =(const RecvdError &);
53  void setCert(X509 *);
54  int id;
56  std::string error_reason;
59  };
60 
61  typedef std::vector<RecvdError> RecvdErrors;
62  explicit CertValidationResponse(const Security::SessionPointer &aSession) : ssl(aSession) {}
65  RecvdError &getError(int errorId);
66  RecvdErrors errors;
69 };
70 
81 {
82 private:
87  class CertItem
88  {
89  public:
90  std::string name;
92  CertItem(): cert(NULL) {}
93  CertItem(const CertItem &);
94  CertItem & operator =(const CertItem &);
95  void setCert(X509 *);
96  };
97 
98 public:
100 
103  void composeRequest(CertValidationRequest const &vcert);
104 
106  bool parseResponse(CertValidationResponse &resp, std::string &error);
107 
109  X509 *getCertByName(std::vector<CertItem> const &, std::string const & name);
110 
112  static const std::string code_cert_validate;
114  static const std::string param_domain;
116  static const std::string param_cert;
118  static const std::string param_error_name;
120  static const std::string param_error_reason;
122  static const std::string param_error_cert;
124  static const std::string param_error_depth;
126  static const std::string param_proto_version;
128  static const std::string param_cipher;
129 };
130 
131 }//namespace Ssl
132 
133 #endif // SQUID_SSL_CERT_VALIDATE_MESSAGE_H
134 
RecvdErrors errors
The list of parsed errors.
static const std::string param_error_reason
Parameter name for passing the error reason.
static const std::string code_cert_validate
String code for "cert_validate" messages.
Security::ErrorCode error_no
The OpenSSL error code.
ResultCode
enumeration value for the helper response &#39;result&#39; field.
Definition: ResultCode.h:16
void error(char *format,...)
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.
static const std::string param_proto_version
Parameter name for SSL version.
static const std::string param_error_name
Parameter name for passing the major SSL error.
Security::SessionPointer ssl
Security::CertPointer cert
A pointer to certificate.
CertValidationResponse(const Security::SessionPointer &aSession)
int ErrorCode
Squid defined error code (<0), an error code returned by X.509 API, or SSL_ERROR_NONE.
Definition: forward.h:91
std::string error_reason
A string describing the error.
Security::CertErrors * errors
The list of errors detected.
std::string domainName
The server name.
std::vector< RecvdError > RecvdErrors
Definition: Xaction.cc:47
Security::SessionPointer ssl
static const std::string param_cert
Parameter name for passing SSL certificates.
static const std::string param_domain
Parameter name for passing intended domain name.
CertValidationMsg(MessageKind kind)
std::string name
The certificate Id to use.
RefCount< CertValidationResponse > Pointer
static const std::string param_error_cert
Parameter name for passing the error cert ID.
Security::CertPointer cert
The broken certificate.
#define NULL
Definition: types.h:166
std::shared_ptr< SSL > SessionPointer
Definition: Session.h:44

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors