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:
cem 2019-12-13 05:42:57 +00:00
parent 34dbda6133
commit f136a5e916

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