Encryption keys are drawn using OS randomness
This commit is contained in:
parent
01f4a5fc28
commit
fbb16915d3
@ -52,7 +52,11 @@ Key CryDevice::GetOrCreateRootKey(CryConfig *config) {
|
|||||||
CryDevice::Cipher::EncryptionKey CryDevice::GetOrCreateEncryptionKey(CryConfig *config) {
|
CryDevice::Cipher::EncryptionKey CryDevice::GetOrCreateEncryptionKey(CryConfig *config) {
|
||||||
string encryption_key = config->EncryptionKey();
|
string encryption_key = config->EncryptionKey();
|
||||||
if (encryption_key == "") {
|
if (encryption_key == "") {
|
||||||
auto new_key = Cipher::EncryptionKey::CreateRandom();
|
printf("Generating secure encryption key...");
|
||||||
|
fflush(stdout);
|
||||||
|
auto new_key = Cipher::EncryptionKey::CreateOSRandom();
|
||||||
|
printf("done\n");
|
||||||
|
fflush(stdout);
|
||||||
config->SetEncryptionKey(new_key.ToString());
|
config->SetEncryptionKey(new_key.ToString());
|
||||||
return new_key;
|
return new_key;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user