#include <cert_validate_message.h>

Inheritance diagram for Ssl::CertValidationMsg:
Collaboration diagram for Ssl::CertValidationMsg:

Classes

class  CertItem
 

Public Types

enum  ParseResult {
  OK,
  INCOMPLETE,
  ERROR
}
 Parse result codes. More...
 
enum  MessageKind {
  REPLY,
  REQUEST
}
 
typedef std::map< std::string, std::string > BodyParams
 

Public Member Functions

 CertValidationMsg (MessageKind kind)
 
void composeRequest (CertValidationRequest const &vcert)
 
bool parseResponse (CertValidationResponse &resp, std::string &error)
 Parse a response message and fill the resp object with parsed informations. More...
 
X509 * getCertByName (std::vector< CertItem > const &, std::string const &name)
 Search a CertItems list for the certificate with ID "name". More...
 
ParseResult parse (const char *buffer, size_t len)
 
std::string const & getBody () const
 Current body. If parsing is not finished the method returns incompleted body. More...
 
std::string const & getCode () const
 Current response/request code. If parsing is not finished the method may return incompleted code. More...
 
void setBody (std::string const &aBody)
 Set new body to encode. More...
 
void setCode (std::string const &aCode)
 Set new request/reply code to compose. More...
 
std::string compose () const
 
void clear ()
 Reset the class. More...
 
void parseBody (BodyParams &map, std::string &other_part) const
 
void composeBody (BodyParams const &map, std::string const &other_part)
 
bool parseRequest (Ssl::CertificateProperties &, std::string &error)
 orchestrates entire request parsing More...
 
void composeRequest (Ssl::CertificateProperties const &)
 

Static Public Attributes

static const std::string code_cert_validate
 String code for "cert_validate" messages. More...
 
static const std::string param_domain
 Parameter name for passing intended domain name. More...
 
static const std::string param_cert
 Parameter name for passing SSL certificates. More...
 
static const std::string param_error_name
 Parameter name for passing the major SSL error. More...
 
static const std::string param_error_reason
 Parameter name for passing the error reason. More...
 
static const std::string param_error_cert
 Parameter name for passing the error cert ID. More...
 
static const std::string param_error_depth
 Parameter name for passing the error depth. More...
 
static const std::string param_proto_version
 Parameter name for SSL version. More...
 
static const std::string param_cipher
 Parameter name for SSL cipher. More...
 
static const std::string code_new_certificate
 String code for "new_certificate" messages. More...
 
static const std::string param_host
 Parameter name for passing hostname. More...
 
static const std::string param_SetValidAfter
 Parameter name for passing SetValidAfter cert adaptation variable. More...
 
static const std::string param_SetValidBefore
 Parameter name for passing SetValidBefore cert adaptation variable. More...
 
static const std::string param_SetCommonName
 Parameter name for passing SetCommonName cert adaptation variable. More...
 
static const std::string param_Sign
 Parameter name for passing signing algorithm. More...
 
static const std::string param_SignHash
 The signing hash to use. More...
 

Protected Types

enum  ParseState {
  BEFORE_CODE,
  CODE,
  BEFORE_LENGTH,
  LENGTH,
  BEFORE_BODY,
  BODY,
  END
}
 

Protected Attributes

size_t body_size
 The body size if exist or 0. More...
 
ParseState state
 Parsing state. More...
 
std::string body
 Current body. More...
 
std::string code
 Current response/request code. More...
 
std::string current_block
 Current block buffer. More...
 

Detailed Description

This class is responsible for composing or parsing messages destined to or comming from a certificate validation helper. The messages format is:

   response/request-code SP body-length SP [key=value ...] EOL
Note
EOL for this interface is character 0x01

Definition at line 80 of file cert_validate_message.h.

Member Typedef Documentation

◆ BodyParams

typedef std::map<std::string, std::string> Ssl::CrtdMessage::BodyParams
inherited

Definition at line 27 of file crtd_message.h.

Member Enumeration Documentation

◆ MessageKind

Enumerator
REPLY 
REQUEST 

Definition at line 34 of file crtd_message.h.

◆ ParseResult

Enumerator
OK 
INCOMPLETE 
ERROR 

Definition at line 29 of file crtd_message.h.

◆ ParseState

enum Ssl::CrtdMessage::ParseState
protectedinherited
Enumerator
BEFORE_CODE 
CODE 
BEFORE_LENGTH 
LENGTH 
BEFORE_BODY 
BODY 
END 

Definition at line 90 of file crtd_message.h.

Constructor & Destructor Documentation

◆ CertValidationMsg()

Ssl::CertValidationMsg::CertValidationMsg ( MessageKind  kind)
inline

Definition at line 99 of file cert_validate_message.h.

References error().

Member Function Documentation

◆ clear()

◆ compose()

std::string Ssl::CrtdMessage::compose ( ) const
inherited

Compose current (request) code and body to string.

Definition at line 126 of file crtd_message.cc.

References Ssl::CrtdMessage::body, and Ssl::CrtdMessage::code.

Referenced by ConnStateData::getSslContextStart(), processNewRequest(), Ssl::Helper::Submit(), and Ssl::CertValidationHelper::Submit().

◆ composeBody()

void Ssl::CrtdMessage::composeBody ( CrtdMessage::BodyParams const &  map,
std::string const &  other_part 
)
inherited

Compose parameters given by map with their values and the other part given by other_part to body data. The constructed body will have the form:

   param1=value1
   param2=value2
   The other multistring part of body.  

Definition at line 166 of file crtd_message.cc.

References Ssl::CrtdMessage::body, and i.

◆ composeRequest() [1/2]

◆ composeRequest() [2/2]

void Ssl::CertValidationMsg::composeRequest ( CertValidationRequest const &  vcert)

◆ getBody()

std::string const & Ssl::CrtdMessage::getBody ( ) const
inherited

◆ getCertByName()

X509 * Ssl::CertValidationMsg::getCertByName ( std::vector< CertItem > const &  certs,
std::string const &  name 
)

Definition at line 190 of file cert_validate_message.cc.

References NULL.

Referenced by parseResponse().

◆ getCode()

std::string const & Ssl::CrtdMessage::getCode ( ) const
inherited

Definition at line 120 of file crtd_message.cc.

References Ssl::CrtdMessage::code.

Referenced by main().

◆ parse()

◆ parseBody()

void Ssl::CrtdMessage::parseBody ( CrtdMessage::BodyParams map,
std::string &  other_part 
) const
inherited

Parse body data which has the form:

   param1=value1
   param2=value2
   The other multistring part of body.  

The parameters of the body stored to map and the remaining part to other_part

Definition at line 143 of file crtd_message.cc.

References Ssl::CrtdMessage::body, and NULL.

Referenced by Ssl::CrtdMessage::parseRequest().

◆ parseRequest()

◆ parseResponse()

◆ setBody()

void Ssl::CrtdMessage::setBody ( std::string const &  aBody)
inherited

Definition at line 122 of file crtd_message.cc.

References Ssl::CrtdMessage::body.

Referenced by processNewRequest().

◆ setCode()

void Ssl::CrtdMessage::setCode ( std::string const &  aCode)
inherited

Member Data Documentation

◆ body

◆ body_size

size_t Ssl::CrtdMessage::body_size
protectedinherited

Definition at line 99 of file crtd_message.h.

Referenced by Ssl::CrtdMessage::clear(), and Ssl::CrtdMessage::parse().

◆ code

std::string Ssl::CrtdMessage::code
protectedinherited

◆ code_cert_validate

const std::string Ssl::CertValidationMsg::code_cert_validate
static

◆ code_new_certificate

const std::string Ssl::CrtdMessage::code_new_certificate
staticinherited

◆ current_block

std::string Ssl::CrtdMessage::current_block
protectedinherited

Definition at line 103 of file crtd_message.h.

Referenced by Ssl::CrtdMessage::clear(), and Ssl::CrtdMessage::parse().

◆ param_cert

const std::string Ssl::CertValidationMsg::param_cert
static

◆ param_cipher

const std::string Ssl::CertValidationMsg::param_cipher
static

◆ param_domain

const std::string Ssl::CertValidationMsg::param_domain
static

Definition at line 114 of file cert_validate_message.h.

Referenced by Ssl::CertValidationMsg::CertItem::setCert().

◆ param_error_cert

const std::string Ssl::CertValidationMsg::param_error_cert
static

◆ param_error_depth

const std::string Ssl::CertValidationMsg::param_error_depth
static

◆ param_error_name

const std::string Ssl::CertValidationMsg::param_error_name
static

◆ param_error_reason

const std::string Ssl::CertValidationMsg::param_error_reason
static

◆ param_host

const std::string Ssl::CrtdMessage::param_host
staticinherited

◆ param_proto_version

const std::string Ssl::CertValidationMsg::param_proto_version
static

◆ param_SetCommonName

const std::string Ssl::CrtdMessage::param_SetCommonName
staticinherited

◆ param_SetValidAfter

const std::string Ssl::CrtdMessage::param_SetValidAfter
staticinherited

◆ param_SetValidBefore

const std::string Ssl::CrtdMessage::param_SetValidBefore
staticinherited

◆ param_Sign

const std::string Ssl::CrtdMessage::param_Sign
staticinherited

◆ param_SignHash

const std::string Ssl::CrtdMessage::param_SignHash
staticinherited

◆ state

ParseState Ssl::CrtdMessage::state
protectedinherited

Definition at line 100 of file crtd_message.h.

Referenced by Ssl::CrtdMessage::clear(), and Ssl::CrtdMessage::parse().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors