diff options
author | Conrad Meyer <cem@FreeBSD.org> | 2019-04-04 01:02:50 +0000 |
---|---|---|
committer | Conrad Meyer <cem@FreeBSD.org> | 2019-04-04 01:02:50 +0000 |
commit | a8a16c71287e615fff06f05c92addbe8ffc2b9e0 (patch) | |
tree | b445dafe48a56365c05c773b15233f8bab1bbeec /sys/net/if_spppsubr.c | |
parent | d9eb18ace9d6d8cf4b1a77f3d03237e05a194c25 (diff) |
Replace read_random(9) with more appropriate arc4rand(9) KPIs
Reviewed by: ae, delphij
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D19760
Notes
Notes:
svn path=/head/; revision=345865
Diffstat (limited to 'sys/net/if_spppsubr.c')
-rw-r--r-- | sys/net/if_spppsubr.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index 1ff05f29b985..6b2a9b15f6e8 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -4337,16 +4337,12 @@ sppp_chap_tld(struct sppp *sp) static void sppp_chap_scr(struct sppp *sp) { - u_long *ch, seed; + u_long *ch; u_char clen; /* Compute random challenge. */ ch = (u_long *)sp->myauth.challenge; - read_random(&seed, sizeof seed); - ch[0] = seed ^ random(); - ch[1] = seed ^ random(); - ch[2] = seed ^ random(); - ch[3] = seed ^ random(); + arc4random_buf(ch, 4 * sizeof(*ch)); clen = AUTHKEYLEN; sp->confid[IDX_CHAP] = ++sp->pp_seq[IDX_CHAP]; |