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:
Conrad Meyer 2019-12-13 05:42:57 +00:00
parent 44d780e32b
commit 23c30549af
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355699

View file

@ -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);
}
/*