Re: Is fork() hook ever possible?

看板FB_current作者時間14年前 (2011/11/15 11:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串11/13 (看更多)
On Tue, Nov 15, 2011 at 02:11:03AM +0100, Oliver Pinter wrote: > > P.S. Do I answer your doubts about &rdat key initialization in my prev. > > posting? > > I think it's a much correct solution, rather than the original patch, > while it initializes the whole structure, not only the key array... > (&rdat.key vs &rdat; and uninitialized pid and tv): > > fd = _open(RANDOMDEV, O_RDONLY, 0); > done = 0; > if (fd >= 0) { > - if (_read(fd, &rdat, KEYSIZE) == KEYSIZE) > + if (_read(fd, &rdat, sizeof(rdat)) == sizeof(rdat)) > done = 1; > (void)_close(fd); > - } > + } > Currently this change will have no any effect in the code because only first 128 bytes of the structure are passed later: arc4_addrandom((u_char *)&rdat, KEYSIZE); In case you mean passing later whole structure like: arc4_addrandom((u_char *)&rdat, sizeof(rdat)); it will be incorrect because it change known algorithm parameters, which defines exact 128 bytes and not anything else. -- http://ache.vniz.net/ _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1EmTNl2C (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1EmTNl2C (FB_current)