mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Prevent to initialise backends twice.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@414 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
@@ -144,6 +144,9 @@ static int _get_random(struct crypt_device *ctx, char *buf, size_t len)
|
||||
/* Initialisation of both RNG file descriptors is mandatory */
|
||||
int crypt_random_init(struct crypt_device *ctx)
|
||||
{
|
||||
if (random_initialised)
|
||||
return 0;
|
||||
|
||||
/* Used for CRYPT_RND_NORMAL */
|
||||
if(urandom_fd == -1)
|
||||
urandom_fd = open(URANDOM_DEVICE, O_RDONLY);
|
||||
|
||||
Reference in New Issue
Block a user