don't decrypt empty values
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
Scott E. Graves 2025-03-20 17:56:11 -05:00
parent b42dc4e942
commit 225a5cedc5
2 changed files with 7 additions and 0 deletions

View File

@ -38,6 +38,9 @@ namespace {
[[nodiscard]] auto decrypt(std::string_view data, std::string_view password)
-> std::string {
REPERTORY_USES_FUNCTION_NAME();
if (data.empty()) {
return std::string{data};
}
auto decoded = macaron::Base64::Decode(data);
repertory::data_buffer buffer(decoded.size());

View File

@ -259,6 +259,10 @@ Future<Map<String, dynamic>> convertAllToString(
}
String encryptValue(String value, String password) {
if (value.isEmpty) {
return value;
}
final sodium = constants.sodium;
if (sodium == null) {
return value;