diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-06-04 13:22:56 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-06-04 13:22:56 +0200 |
commit | 85726b6a6d53f6c3a2c18ba3412ee5b14ee4d6f3 (patch) | |
tree | 4a76b6b0e85127135eaa30e6478cfdc18847702a /curvetun.c | |
parent | 26b173d328e36e423ff7765df5b3fc75abb6a1d9 (diff) |
rnd: add gen_key_bytes to generate key from good entropy source
Make this a function and do not have this in curvetun hard coded.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'curvetun.c')
-rw-r--r-- | curvetun.c | 12 |
1 files changed, 1 insertions, 11 deletions
@@ -257,17 +257,7 @@ static void create_keypair(char *home) printf("Reading from %s (this may take a while) ...\n", HIG_ENTROPY_SOURCE); - fd = open_or_die(HIG_ENTROPY_SOURCE, O_RDONLY); - - ret = read_exact(fd, secretkey, sizeof(secretkey), 0); - if (ret != sizeof(secretkey)) { - err = EIO; - errstr = "Cannot read from "HIG_ENTROPY_SOURCE"!\n"; - goto out; - } - - close(fd); - + gen_key_bytes(secretkey, sizeof(secretkey)); crypto_scalarmult_curve25519_base(publickey, secretkey); memset(path, 0, sizeof(path)); |