Date: Mon, 23 Feb 2004 20:23:01 GMT From: "Christian S.J. Peron" <maneo@bsdpro.com> To: FreeBSD-gnats-submit@FreeBSD.org Cc: green@FreeBSD.org Subject: bin/63283: [patch] libc arc4random style fix Message-ID: <200402232023.i1NKN1Ws018152@h24-77-20-99.wp.shawcable.net> Resent-Message-ID: <200402232020.i1NKKA2h054364@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 63283
>Category: bin
>Synopsis: [patch] libc arc4random style fix
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Feb 23 12:20:10 PST 2004
>Closed-Date:
>Last-Modified:
>Originator: Christian S.J. Peron
>Release: FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD movl 5.2-CURRENT FreeBSD 5.2-CURRENT #8: Mon Feb 2 22:04:49 GMT 2004 modulus@movl:/usr/src/sys/i386/compile/ROUTER i386
>Description:
style fix for arc4random.c (libc)
>How-To-Repeat:
N/A
>Fix:
--- lib/libc/gen/arc4random.c.bak Fri Feb 20 05:28:01 2004
+++ lib/libc/gen/arc4random.c Sat Feb 21 02:18:30 2004
@@ -124,6 +124,7 @@
sj = as->s[as->j];
as->s[as->i] = sj;
as->s[as->j] = si;
+
return (as->s[(si + sj) & 0xff]);
}
@@ -132,11 +133,13 @@
struct arc4_stream *as;
{
u_int32_t val;
+
val = arc4_getbyte(as) << 24;
val |= arc4_getbyte(as) << 16;
val |= arc4_getbyte(as) << 8;
val |= arc4_getbyte(as);
- return val;
+
+ return (val);
}
void
@@ -164,7 +167,8 @@
{
if (!rs_initialized)
arc4random_stir();
- return arc4_getword(&rs);
+
+ return (arc4_getword(&rs));
}
#if 0
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402232023.i1NKN1Ws018152>
