aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1998-04-06 09:30:42 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1998-04-06 09:30:42 +0000
commit2eeb0e2ea0fae54fb22dae17433a2c36de0e271a (patch)
tree45292f71df7d6fe55f46ec87a6491769dcae81d6
parent4cf41af3d424a8ec0670f03b36e8b685127f5851 (diff)
downloadsrc-2eeb0e2ea0fae54fb22dae17433a2c36de0e271a.tar.gz
src-2eeb0e2ea0fae54fb22dae17433a2c36de0e271a.zip
Make read_random() take a (void *) argument instead of (char *)
Notes
Notes: svn path=/head/; revision=35060
-rw-r--r--sys/i386/include/random.h6
-rw-r--r--sys/i386/isa/random_machdep.c10
-rw-r--r--sys/kern/kern_random.c10
-rw-r--r--sys/net/if_spppsubr.c8
-rw-r--r--sys/netipx/ipx_input.c4
-rw-r--r--sys/sys/random.h6
6 files changed, 22 insertions, 22 deletions
diff --git a/sys/i386/include/random.h b/sys/i386/include/random.h
index b2b7d12b6375..088d81b38698 100644
--- a/sys/i386/include/random.h
+++ b/sys/i386/include/random.h
@@ -1,7 +1,7 @@
/*
* random.h -- A strong random number generator
*
- * $Id: random.h,v 1.12 1997/06/07 00:57:26 bde Exp $
+ * $Id: random.h,v 1.13 1997/09/14 03:19:03 peter Exp $
*
* Version 0.95, last modified 18-Oct-95
*
@@ -75,8 +75,8 @@ void add_blkdev_randomness(int major);
#ifdef notused
void get_random_bytes(void *buf, u_int nbytes);
#endif
-u_int read_random(char *buf, u_int size);
-u_int read_random_unlimited(char *buf, u_int size);
+u_int read_random(void *buf, u_int size);
+u_int read_random_unlimited(void *buf, u_int size);
#ifdef notused
u_int write_random(const char *buf, u_int nbytes);
#endif
diff --git a/sys/i386/isa/random_machdep.c b/sys/i386/isa/random_machdep.c
index 2022c7125150..e1f1f613080e 100644
--- a/sys/i386/isa/random_machdep.c
+++ b/sys/i386/isa/random_machdep.c
@@ -1,7 +1,7 @@
/*
* random_machdep.c -- A strong random number generator
*
- * $Id: random_machdep.c,v 1.22 1998/03/28 13:24:35 bde Exp $
+ * $Id: random_machdep.c,v 1.23 1998/03/29 11:55:06 phk Exp $
*
* Version 0.95, last modified 18-Oct-95
*
@@ -321,18 +321,18 @@ get_random_bytes(void *buf, u_int nbytes)
#endif /* notused */
u_int
-read_random(char *buf, u_int nbytes)
+read_random(void *buf, u_int nbytes)
{
if ((nbytes * 8) > random_state.entropy_count)
nbytes = random_state.entropy_count / 8;
- return extract_entropy(&random_state, buf, nbytes);
+ return extract_entropy(&random_state, (char *)buf, nbytes);
}
u_int
-read_random_unlimited(char *buf, u_int nbytes)
+read_random_unlimited(void *buf, u_int nbytes)
{
- return extract_entropy(&random_state, buf, nbytes);
+ return extract_entropy(&random_state, (char *)buf, nbytes);
}
#ifdef notused
diff --git a/sys/kern/kern_random.c b/sys/kern/kern_random.c
index 2022c7125150..e1f1f613080e 100644
--- a/sys/kern/kern_random.c
+++ b/sys/kern/kern_random.c
@@ -1,7 +1,7 @@
/*
* random_machdep.c -- A strong random number generator
*
- * $Id: random_machdep.c,v 1.22 1998/03/28 13:24:35 bde Exp $
+ * $Id: random_machdep.c,v 1.23 1998/03/29 11:55:06 phk Exp $
*
* Version 0.95, last modified 18-Oct-95
*
@@ -321,18 +321,18 @@ get_random_bytes(void *buf, u_int nbytes)
#endif /* notused */
u_int
-read_random(char *buf, u_int nbytes)
+read_random(void *buf, u_int nbytes)
{
if ((nbytes * 8) > random_state.entropy_count)
nbytes = random_state.entropy_count / 8;
- return extract_entropy(&random_state, buf, nbytes);
+ return extract_entropy(&random_state, (char *)buf, nbytes);
}
u_int
-read_random_unlimited(char *buf, u_int nbytes)
+read_random_unlimited(void *buf, u_int nbytes)
{
- return extract_entropy(&random_state, buf, nbytes);
+ return extract_entropy(&random_state, (char *)buf, nbytes);
}
#ifdef notused
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 74310e31859f..cbc84ab3b4b6 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -17,7 +17,7 @@
*
* From: Version 2.4, Thu Apr 30 17:17:21 MSD 1997
*
- * $Id: if_spppsubr.c,v 1.35 1998/03/30 09:52:06 phk Exp $
+ * $Id: if_spppsubr.c,v 1.36 1998/04/04 13:26:03 phk Exp $
*/
#include "opt_inet.h"
@@ -990,7 +990,7 @@ sppp_cisco_input(struct sppp *sp, struct mbuf *m)
++sp->pp_loopcnt;
/* Generate new local sequence number */
- read_random((char*)&sp->pp_seq, sizeof sp->pp_seq);
+ read_random(&sp->pp_seq, sizeof sp->pp_seq);
break;
}
sp->pp_loopcnt = 0;
@@ -2117,7 +2117,7 @@ sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
if (magic == ~sp->lcp.magic) {
if (debug)
addlog("magic glitch ");
- read_random((char*)&sp->lcp.magic, sizeof sp->lcp.magic);
+ read_random(&sp->lcp.magic, sizeof sp->lcp.magic);
} else {
sp->lcp.magic = magic;
if (debug)
@@ -2277,7 +2277,7 @@ sppp_lcp_scr(struct sppp *sp)
if (sp->lcp.opts & (1 << LCP_OPT_MAGIC)) {
if (! sp->lcp.magic)
- read_random((char*)&sp->lcp.magic, sizeof sp->lcp.magic);
+ read_random(&sp->lcp.magic, sizeof sp->lcp.magic);
opt[i++] = LCP_OPT_MAGIC;
opt[i++] = 6;
opt[i++] = sp->lcp.magic >> 24;
diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c
index f3b9f34cc0f9..78911b8d9a67 100644
--- a/sys/netipx/ipx_input.c
+++ b/sys/netipx/ipx_input.c
@@ -33,7 +33,7 @@
*
* @(#)ipx_input.c
*
- * $Id: ipx_input.c,v 1.15 1998/02/09 06:10:19 eivind Exp $
+ * $Id: ipx_input.c,v 1.16 1998/03/30 09:53:09 phk Exp $
*/
#include <sys/param.h>
@@ -107,7 +107,7 @@ ipx_init()
ipx_broadnet = *(union ipx_net *)allones;
ipx_broadhost = *(union ipx_host *)allones;
- read_random((char *)&ipx_pexseq, sizeof ipx_pexseq);
+ read_random(&ipx_pexseq, sizeof ipx_pexseq);
ipxintrq.ifq_maxlen = ipxqmaxlen;
ipxpcb.ipxp_next = ipxpcb.ipxp_prev = &ipxpcb;
ipxrawpcb.ipxp_next = ipxrawpcb.ipxp_prev = &ipxrawpcb;
diff --git a/sys/sys/random.h b/sys/sys/random.h
index b2b7d12b6375..088d81b38698 100644
--- a/sys/sys/random.h
+++ b/sys/sys/random.h
@@ -1,7 +1,7 @@
/*
* random.h -- A strong random number generator
*
- * $Id: random.h,v 1.12 1997/06/07 00:57:26 bde Exp $
+ * $Id: random.h,v 1.13 1997/09/14 03:19:03 peter Exp $
*
* Version 0.95, last modified 18-Oct-95
*
@@ -75,8 +75,8 @@ void add_blkdev_randomness(int major);
#ifdef notused
void get_random_bytes(void *buf, u_int nbytes);
#endif
-u_int read_random(char *buf, u_int size);
-u_int read_random_unlimited(char *buf, u_int size);
+u_int read_random(void *buf, u_int size);
+u_int read_random_unlimited(void *buf, u_int size);
#ifdef notused
u_int write_random(const char *buf, u_int nbytes);
#endif