[libcalamares] Also report empty buffer as no-entropy

main
Adriaan de Groot 5 years ago
parent 842a90e026
commit a574b43eb8

@ -26,6 +26,11 @@ CalamaresUtils::EntropySource
CalamaresUtils::getEntropy( int size, QByteArray& b )
{
b.clear();
if ( size < 1)
{
return EntropySource::None;
}
b.resize( size );
char* buffer = b.data();
std::fill( buffer, buffer + size, 0xcb );

@ -28,6 +28,7 @@ namespace CalamaresUtils
/// @brief Which entropy source was actually used for the entropy.
enum class EntropySource
{
None, ///< Buffer is empty, no random data
URandom, ///< Read from /dev/urandom
Twister ///< Generated by pseudo-random
};

Loading…
Cancel
Save