[libcalamares] Also report empty buffer as no-entropy
This commit is contained in:
parent
842a90e026
commit
a574b43eb8
@ -26,6 +26,11 @@ CalamaresUtils::EntropySource
|
|||||||
CalamaresUtils::getEntropy( int size, QByteArray& b )
|
CalamaresUtils::getEntropy( int size, QByteArray& b )
|
||||||
{
|
{
|
||||||
b.clear();
|
b.clear();
|
||||||
|
if ( size < 1)
|
||||||
|
{
|
||||||
|
return EntropySource::None;
|
||||||
|
}
|
||||||
|
|
||||||
b.resize( size );
|
b.resize( size );
|
||||||
char* buffer = b.data();
|
char* buffer = b.data();
|
||||||
std::fill( buffer, buffer + size, 0xcb );
|
std::fill( buffer, buffer + size, 0xcb );
|
||||||
|
@ -28,6 +28,7 @@ namespace CalamaresUtils
|
|||||||
/// @brief Which entropy source was actually used for the entropy.
|
/// @brief Which entropy source was actually used for the entropy.
|
||||||
enum class EntropySource
|
enum class EntropySource
|
||||||
{
|
{
|
||||||
|
None, ///< Buffer is empty, no random data
|
||||||
URandom, ///< Read from /dev/urandom
|
URandom, ///< Read from /dev/urandom
|
||||||
Twister ///< Generated by pseudo-random
|
Twister ///< Generated by pseudo-random
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user