body += '\n' + other_part;
}
-bool Ssl::CrtdMessage::parseRequest(Ssl::CertificateProperties &certProperties, std::string error)
+
+bool Ssl::CrtdMessage::parseRequest(Ssl::CertificateProperties &certProperties, std::string &error)
{
Ssl::CrtdMessage::BodyParams map;
std::string certs_part;
parseBody(map, certs_part);
Ssl::CrtdMessage::BodyParams::iterator i = map.find(Ssl::CrtdMessage::param_host);
if (i == map.end()) {
- error = "Parse request: Cannot find \"host\" parameter in request message";
+ error = "Cannot find \"host\" parameter in request message";
return false;
}
certProperties.commonName = i->second;
i = map.find(Ssl::CrtdMessage::param_Sign);
if (i != map.end()) {
if ((certProperties.signAlgorithm = Ssl::certSignAlgorithmId(i->second.c_str())) == Ssl::algSignEnd) {
- error = "Parse request: Wrong signing algoritm: " + i->second;
+ error = "Wrong signing algoritm: " + i->second;
return false;
}
}
if (certProperties.signAlgorithm != Ssl::algSignSelf &&
!Ssl::readCertAndPrivateKeyFromMemory(certProperties.signWithX509, certProperties.signWithPkey, certs_part.c_str())) {
- error = "Parse request: Broken signing certificate!";
+ error = "Broken signing certificate!";
return false;
}
*/
void composeBody(BodyParams const & map, std::string const & other_part);
- bool parseRequest(Ssl::CertificateProperties &, std::string error);
+ bool parseRequest(Ssl::CertificateProperties &, std::string &error);
void composeRequest(Ssl::CertificateProperties const &);
/// String code for "new_certificate" messages
Ssl::CertificateProperties certProperties;
std::string error;
if (!request_message.parseRequest(certProperties, error))
- throw std::runtime_error("Error while parsing the crtd request" + error);
+ throw std::runtime_error("Error while parsing the crtd request: " + error);
Ssl::CertificateDb db(db_path, max_db_size, fs_block_size);
Ssl::X509_Pointer cert;