Re: svn commit: r300322 - head/bin/ed

2016-05-20 Thread Pedro Giffuni
On 05/20/16 14:31, Ed Schouten wrote: 2016-05-20 21:10 GMT+02:00 Pedro F. Giffuni : /* initialize the padding vector */ for (i = 0; i < 8; i++) - pvec[i] = (char) (arc4random() % 256); + pvec[i] = (char)arc4random_uniform(256); This could be simpli

Re: svn commit: r300322 - head/bin/ed

2016-05-20 Thread Ed Schouten
2016-05-20 21:10 GMT+02:00 Pedro F. Giffuni : > /* initialize the padding vector */ > for (i = 0; i < 8; i++) > - pvec[i] = (char) (arc4random() % 256); > + pvec[i] = (char)arc4random_uniform(256); This could be simplified to just calling arc4random_buf(

svn commit: r300322 - head/bin/ed

2016-05-20 Thread Pedro F. Giffuni
Author: pfg Date: Fri May 20 19:10:29 2016 New Revision: 300322 URL: https://svnweb.freebsd.org/changeset/base/300322 Log: ed(1): Cleanups for the DES mode. - Use arc4random_uniform(3). - Prevent a segmentation fault when ed receives a signal while being in getpass(). [1] Obtaine