mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-17 21:04:31 -04:00
[libcalamares] Simplify filling the entropy buffer
This commit is contained in:
parent
a393ffe126
commit
ada13c19fd
1 changed files with 4 additions and 2 deletions
|
@ -18,15 +18,17 @@
|
|||
CalamaresUtils::EntropySource
|
||||
CalamaresUtils::getEntropy( int size, QByteArray& b )
|
||||
{
|
||||
constexpr const char filler = char( 0xcb );
|
||||
|
||||
b.fill( filler );
|
||||
b.clear();
|
||||
if ( size < 1 )
|
||||
{
|
||||
return EntropySource::None;
|
||||
}
|
||||
|
||||
b.resize( size );
|
||||
b.fill( filler, size );
|
||||
char* buffer = b.data();
|
||||
std::fill( buffer, buffer + size, 0xcb );
|
||||
|
||||
qint64 readSize = 0;
|
||||
QFile urandom( "/dev/urandom" );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue