mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 18:27:22 +00:00
libtelnet: Replace bogus use of srandomdev + random to generate "public key pair"
I'm pretty skeptical that any crypto in telnet is worth using, but if we're ostensibly generating keys, arc4random is strictly better than the previous construct.
This commit is contained in:
parent
44d780e32b
commit
23c30549af
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355699
|
@ -142,12 +142,7 @@ common_key(char *xsecret, char *xpublic, IdeaData *ideakey, DesData *deskey)
|
|||
static void
|
||||
getseed(char *seed, int seedsize)
|
||||
{
|
||||
int i;
|
||||
|
||||
srandomdev();
|
||||
for (i = 0; i < seedsize; i++) {
|
||||
seed[i] = random() & 0xff;
|
||||
}
|
||||
arc4random_buf(seed, seedsize);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue