isc_throw(UnsupportedAlgorithm,
"Unknown hash algorithm: " << static_cast<int>(hash_));
}
- std::string emsa = "EMSA3(" + hash + ")";
+ emsa_ = "EMSA3(" + hash + ")";
if (key_len == 0) {
isc_throw(BadKey, "Bad RSA " <<
(kind_ != CERT ? "key" : "cert") << " length: 0");
isc_throw(BadKey, "priv to pub: " << exc.what());
}
try {
- signer_.reset(new Botan::PK_Signer(*priv_, emsa));
+ signer_.reset(new Botan::PK_Signer(*priv_, emsa_));
} catch (const std::exception& exc) {
isc_throw(BadKey, "PK_Signer: " << exc.what());
}
} else {
try {
- verifier_.reset(new Botan::PK_Verifier(*pub_, emsa));
+ verifier_.reset(new Botan::PK_Verifier(*pub_, emsa_));
} catch (const std::exception& exc) {
isc_throw(BadKey, "PK_Verifier: " << exc.what());
}
isc_throw(UnsupportedAlgorithm,
"Unknown hash algorithm: " << static_cast<int>(hash_));
}
- std::string emsa = "EMSA3(" + hash + ")";
+ emsa_ = "EMSA3(" + hash + ")";
if ((kind_ == PRIVATE) && (key_format == ASN1)) {
// PKCS#8 Private Key PEM file
isc_throw(BadKey, "priv to pub: " << exc.what());
}
try {
- signer_.reset(new Botan::PK_Signer(*priv_, emsa));
+ signer_.reset(new Botan::PK_Signer(*priv_, emsa_));
} catch (const std::exception& exc) {
isc_throw(BadKey, "PK_Signer: " << exc.what());
}
} else {
try {
- verifier_.reset(new Botan::PK_Verifier(*pub_, emsa));
+ verifier_.reset(new Botan::PK_Verifier(*pub_, emsa_));
} catch (const std::exception& exc) {
isc_throw(BadKey, "PK_Verifier: " << exc.what());
}
/// \brief Clear the crypto state and go back to the initial state
void RsaAsymImpl::clear() {
- std::string hash = btn::getHashAlgorithmName(hash_);
- if (hash.compare("Unknown") == 0) {
- isc_throw(UnsupportedAlgorithm,
- "Unknown hash algorithm: " << static_cast<int>(hash_));
- }
- std::string emsa = "EMSA3(" + hash + ")";
if (kind_ == PRIVATE) {
try {
- signer_.reset(new Botan::PK_Signer(*priv_, emsa));
+ signer_.reset(new Botan::PK_Signer(*priv_, emsa_));
} catch (const std::exception& exc) {
isc_throw(BadKey, "PK_Signer: " << exc.what());
}
} else {
try {
- verifier_.reset(new Botan::PK_Verifier(*pub_, emsa));
+ verifier_.reset(new Botan::PK_Verifier(*pub_, emsa_));
} catch (const std::exception& exc) {
isc_throw(BadKey, "PK_Verifier: " << exc.what());
}