diff options
author | pfg <pfg@FreeBSD.org> | 2016-05-21 00:45:42 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-05-21 00:45:42 +0000 |
commit | c98ef29401c507a4982ed58d08eb6bb33a0f0898 (patch) | |
tree | 8f02a0473cffb9c029191c67685c32f00264b77f /bin | |
parent | ca492fdb2dc89b23ef0fefb029dea1b73243396e (diff) | |
download | FreeBSD-src-c98ef29401c507a4982ed58d08eb6bb33a0f0898.zip FreeBSD-src-c98ef29401c507a4982ed58d08eb6bb33a0f0898.tar.gz |
ed(1): simplify by using arc4random_buf().
Suggested by: ed
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ed/cbc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/bin/ed/cbc.c b/bin/ed/cbc.c index 7869e96..b59778b 100644 --- a/bin/ed/cbc.c +++ b/bin/ed/cbc.c @@ -90,16 +90,13 @@ void init_des_cipher(void) { #ifdef DES - int i; - des_ct = des_n = 0; /* initialize the initialization vector */ MEMZERO(ivec, 8); /* initialize the padding vector */ - for (i = 0; i < 8; i++) - pvec[i] = (char)arc4random_uniform(256); + arc4random_buf(pvec, sizeof(pvec)); #endif } |