Replace hardcoded parameters
This commit is contained in:
@@ -172,6 +172,11 @@ RsaPublicKey::RsaPublicKey(const RsaPublicKey& rsa_key)
|
||||
CHECK(key_ != nullptr);
|
||||
}
|
||||
|
||||
RsaPublicKey::RsaPublicKey(const RsaPrivateKey& rsa_key)
|
||||
: key_(RSAPublicKey_dup(rsa_key.key_)) {
|
||||
CHECK(key_ != nullptr);
|
||||
}
|
||||
|
||||
RsaPublicKey::~RsaPublicKey() { RSA_free(key_); }
|
||||
|
||||
RsaPublicKey* RsaPublicKey::Create(const std::string& serialized_key) {
|
||||
@@ -248,8 +253,8 @@ bool RsaPublicKey::VerifySignature(const std::string& message,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RsaPublicKey::VerifySignatureSha256Pkcs7(const std::string& message,
|
||||
const std::string& signature) const {
|
||||
bool RsaPublicKey::VerifySignatureSha256Pkcs7(
|
||||
const std::string& message, const std::string& signature) const {
|
||||
if (message.empty()) {
|
||||
LOG(ERROR) << "Empty signature verification message";
|
||||
return false;
|
||||
@@ -291,7 +296,8 @@ std::unique_ptr<RsaPrivateKey> RsaKeyFactory::CreateFromPkcs1PrivateKey(
|
||||
}
|
||||
|
||||
std::unique_ptr<RsaPrivateKey> RsaKeyFactory::CreateFromPkcs8PrivateKey(
|
||||
const std::string& private_key, const std::string& private_key_passphrase) const {
|
||||
const std::string& private_key,
|
||||
const std::string& private_key_passphrase) const {
|
||||
std::string pkcs1_key;
|
||||
const bool result =
|
||||
private_key_passphrase.empty()
|
||||
|
||||
Reference in New Issue
Block a user