#include "squid.h"
#include "base/TextException.h"
#include "debug/Stream.h"
#include "helper/protocol_defines.h"
#include "sbuf/Stream.h"
#include "security/cert_generators/file/certificate_db.h"
#include "ssl/crtd_message.h"
#include "time/gadgets.h"
#include <cstring>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <string>
Go to the source code of this file.
Functions | |
static size_t | parseBytesUnits (const char *unit) |
static size_t | parseBytesOptionValue (const char *const name, const char *const value) |
static void | usage () |
Print help using response code. More... | |
static bool | processNewRequest (Ssl::CrtdMessage &request_message, std::string const &db_path, size_t max_db_size, size_t fs_block_size) |
Process new request message. More... | |
int | main (int argc, char *argv[]) |
This is the external security_file_certgen process. More... | |
Variables | |
static const char *const | B_KBYTES_STR = "KB" |
static const char *const | B_MBYTES_STR = "MB" |
static const char *const | B_GBYTES_STR = "GB" |
static const char *const | B_BYTES_STR = "B" |
Function Documentation
◆ main()
Definition at line 238 of file security_file_certgen.cc.
References Ssl::CertificateDb::Check(), Ssl::CrtdMessage::code_new_certificate, Ssl::CertificateDb::Create(), CurrentException(), db_path, DBG_CRITICAL, debug_enabled, debugs, Ssl::CrtdMessage::ERROR, statvfs::f_frsize, Ssl::CrtdMessage::getCode(), getopt(), HELPER_INPUT_BUFFER, Here, Ssl::CrtdMessage::INCOMPLETE, Debug::NameThisHelper(), optarg, Ssl::CrtdMessage::parse(), parseBytesOptionValue(), processNewRequest(), Ssl::CrtdMessage::REQUEST, SQUID_OPENSSL_init_ssl(), ToSBuf(), usage(), VERSION, and xstatvfs().
◆ parseBytesOptionValue()
|
static |
Parse the number of bytes given as <integer><unit> value (e.g., 4MB).
- Parameters
-
name the name of the option being parsed
Definition at line 107 of file security_file_certgen.cc.
References Here, parseBytesUnits(), and ToSBuf().
Referenced by main().
◆ parseBytesUnits()
|
static |
Parse bytes unit. It would be one of the next value: MB, GB, KB or B. This function is caseinsensitive.
Definition at line 86 of file security_file_certgen.cc.
References B_BYTES_STR, B_GBYTES_STR, B_KBYTES_STR, B_MBYTES_STR, Here, and ToSBuf().
Referenced by parseBytesOptionValue().
◆ processNewRequest()
|
static |
Definition at line 172 of file security_file_certgen.cc.
References Ssl::CrtdMessage::compose(), CurrentException(), db, db_path, DBG_IMPORTANT, debugs, Debug::Extra(), Ssl::generateSslCertificate(), Here, Ssl::CertificateProperties::mimicCert, Ssl::OnDiskCertificateDbKey(), Ssl::CrtdMessage::parseRequest(), Ssl::CrtdMessage::REPLY, Ssl::CrtdMessage::setBody(), Ssl::CrtdMessage::setCode(), and Ssl::writeCertAndPrivateKeyToMemory().
Referenced by main().
◆ usage()
|
static |
Definition at line 136 of file security_file_certgen.cc.
References Ssl::CrtdMessage::code_new_certificate, and Ssl::CrtdMessage::param_host.
Referenced by main().
Variable Documentation
◆ B_BYTES_STR
|
static |
Definition at line 80 of file security_file_certgen.cc.
Referenced by parseBytesUnits().
◆ B_GBYTES_STR
|
static |
Definition at line 79 of file security_file_certgen.cc.
Referenced by parseBytesUnits().
◆ B_KBYTES_STR
|
static |
Definition at line 77 of file security_file_certgen.cc.
Referenced by parseBytesUnits().
◆ B_MBYTES_STR
|
static |
Definition at line 78 of file security_file_certgen.cc.
Referenced by parseBytesUnits().