diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-04-03 23:22:37 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-04-03 23:22:37 +0000 |
commit | a314d9d3e545e9faee60deaaec88db95be36ab3e (patch) | |
tree | c0492d6203fba48027e27ade55f835be71ba0cbc /sys/crypto | |
parent | 3dfd77cb496240efb69b8feb998e64f7a3955dea (diff) |
fix possible alignment problem; with markus@, angelos@ deraadt@ ok.
Diffstat (limited to 'sys/crypto')
-rw-r--r-- | sys/crypto/cryptosoft.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/crypto/cryptosoft.c b/sys/crypto/cryptosoft.c index 42774e19524..bb0bc55ce35 100644 --- a/sys/crypto/cryptosoft.c +++ b/sys/crypto/cryptosoft.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptosoft.c,v 1.32 2002/03/19 23:24:53 angelos Exp $ */ +/* $OpenBSD: cryptosoft.c,v 1.33 2002/04/03 23:22:36 fgsch Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) @@ -108,8 +108,11 @@ swcr_encdec(struct cryptodesc *crd, struct swcr_data *sw, caddr_t buf, /* Get random IV */ for (i = 0; i + sizeof (u_int32_t) < EALG_MAX_BLOCK_LEN; - i += sizeof (u_int32_t)) - *((u_int32_t *) (iv + i)) = arc4random(); + i += sizeof (u_int32_t)) { + u_int32_t temp = arc4random(); + + bcopy(&temp, iv + i, sizeof(u_int32_t)); + } /* * What if the block size is not a multiple * of sizeof (u_int32_t), which is the size of |