Author: pfg
Date: Sat May 21 00:45:42 2016
New Revision: 300340
URL: https://svnweb.freebsd.org/changeset/base/300340
Log:
ed(1): simplify by using arc4random_buf().
Suggested by: ed
Modified:
head/bin/ed/cbc.c
Modified: head/bin/ed/cbc.c
==============================================================================
--- head/bin/ed/cbc.c Sat May 21 00:43:10 2016 (r300339)
+++ head/bin/ed/cbc.c Sat May 21 00:45:42 2016 (r300340)
@@ -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
}
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"