From 77c3127fd840c608e204eb2c1da7673307d2794b Mon Sep 17 00:00:00 2001 From: Can Erkin Acar Date: Wed, 21 Nov 2007 19:52:05 +0000 Subject: simplify sppp_chap_scr() now that we are using arc4random_bytes() --- sys/net/if_spppsubr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sys') diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index 566ad37e902..a13bd70227f 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.62 2007/11/16 05:08:39 djm Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.63 2007/11/21 19:52:04 canacar Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. * Keepalive protocol implemented in both Cisco and PPP modes. @@ -4058,12 +4058,10 @@ sppp_chap_tld(struct sppp *sp) HIDE void sppp_chap_scr(struct sppp *sp) { - u_int32_t *ch; u_char clen; /* Compute random challenge. */ - ch = (u_int32_t *)sp->myauth.challenge; - arc4random_bytes(ch, sizeof(*ch) * 4); + arc4random_bytes(sp->myauth.challenge, sizeof(sp->myauth.challenge)); clen = AUTHKEYLEN; sp->confid[IDX_CHAP] = ++sp->pp_seq; -- cgit v1.2.3