Re:Arc4random – randomization for all occasions
by justincormack on Friday November 21, 2014 @10:38AM
(#8641709)
There is a proposal to make a Posix interface that is essentially similar.[1]
Re:Arc4random – randomization for all occasions
by tedunangst on Friday November 21, 2014 @01:41PM
(#8642602)
And now I have more work to do... :)
Re:Arc4random – randomization for all occasions
by joehillen on Saturday November 22, 2014 @03:06AM
(#8645110)
So is this going in? Are you using arc4random()?
Re:Arc4random – randomization for all occasions
by tedunangst on Saturday November 22, 2014 @02:01PM
(#8646320)
That's certainly possible. I don't control what goes where, I only made the proposal.
Re:Arc4random – randomization for all occasions
by throwaway2048 on Friday November 21, 2014 @10:18AM
(#8641618)
The chances of glibc importing openbsd derived functions are practically nil unfortunately, as we saw with the strlcat saga. With the departure of Drepper, things might have changed, but strlcat is still not imported.
Re:Arc4random – randomization for all occasions
by justincormack on Friday November 21, 2014 @10:32AM
(#8641687)
Things have changed enormously since Drepper left. It is a nice project to work with and many things that were vetoed are getting in.
Re:Arc4random – randomization for all occasions
by fafner on Saturday November 22, 2014 @09:01PM
(#8647528)
I don't think that's true. Drepper was against strlcat for specific reasons. And in the meanwhile the C11 standard had adopted an alternative (but imo worse) API for it, based on the Microsoft stuff.
Framing this as a general rejection of APIs because they are from OpenBSD is highly disingenuous.
Re:Arc4random – randomization for all occasions
by sarciszewski on Friday November 21, 2014 @10:19AM
(#8641627)
What is the reason for that? :(
Re:Arc4random – randomization for all occasions
by IvyMike on Friday November 21, 2014 @02:13PM
(#8642769)
Drepper's caustic style aside, his point ultimately was that truncation is still a problem. Whether or not you think glibc should include strlcat, this is an important point to understand.
More discussion here: http://stackoverflow.com/q/2114896/67591
Re:Arc4random – randomization for all occasions
by tedunangst on Friday November 21, 2014 @02:20PM
(#8642813)
Note that you can mechanically translate strcat(dst, src) to strlcat(dst, src, SIZE_MAX) with no loss of functionality or change in behavior. No worries about truncation, either. Exactly the same thing.
Now, if reading a piece of code that does strlcat(dst, src, SIZE_MAX) would make you feel uncomfortable, the question is how should you feel reading code that uses strcat?
Re:Arc4random – randomization for all occasions
by pdw on Friday November 21, 2014 @10:24AM
(#8641652)
Not specified in any standard, not much of an improvement according to the glibc maintainers, and already provided in libbsd.
Re:Arc4random – randomization for all occasions
by edwintorok on Friday November 21, 2014 @10:50AM
(#8641754)
Speaking of libbsd it should be updated to use ChaCha20 too:
https://bugs.freedesktop.org/show_bug.cgi?id=85827
[1] http://www.openbsd.org/papers/hackfest2014-arc4random/mgp000... [2] http://www.openbsd.org/papers/hackfest2014-arc4random/mgp000...