Merge pull request #649 from diamante0018/main

maint(cryptography): reduce code generation
This commit is contained in:
Maurice Heumann 2023-05-05 10:58:11 +02:00 committed by GitHub
commit ebfd49d398

View File

@ -240,7 +240,7 @@ namespace utils::cryptography
return {cs(buffer), length};
}
return "";
return {};
}
std::string ecc::key::get_openssl() const
@ -253,7 +253,7 @@ namespace utils::cryptography
return {cs(buffer), length};
}
return "";
return {};
}
void ecc::key::set_openssl(const std::string& key)
@ -313,7 +313,7 @@ namespace utils::cryptography
std::string ecc::sign_message(const key& key, const std::string& message)
{
if (!key.is_valid()) return "";
if (!key.is_valid()) return {};
uint8_t buffer[512];
unsigned long length = sizeof(buffer);
@ -408,7 +408,6 @@ namespace utils::cryptography
rsa_free(&new_key);
});
std::string out_data{};
out_data.resize(std::max(ul(data.size() * 3), ul(0x100)));