don't decrypt empty values
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
This commit is contained in:
parent
b42dc4e942
commit
225a5cedc5
@ -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());
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user