mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-27 23:17:13 +03:00
[CSE] Generate a random password for the metadata.
This commit is contained in:
parent
cf56d58241
commit
a986532442
1 changed files with 9 additions and 1 deletions
|
@ -740,7 +740,15 @@ std::string FolderMetadata::encryptMetadataKeys(const nlohmann::json& metadataKe
|
|||
}
|
||||
|
||||
std::string FolderMetadata::genMetadataPass() const {
|
||||
return "4randomdiceroll";
|
||||
const char* charmap = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
const size_t charmapLength = strlen(charmap);
|
||||
const int bytes = 16;
|
||||
std::string result;
|
||||
result.reserve(bytes);
|
||||
generate_n(back_inserter(result), bytes, [&](){
|
||||
return charmap[rand() % charmapLength];
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
// AES/GCM/NoPadding (128 bit key size)
|
||||
|
|
Loading…
Reference in a new issue