From: Stefan Sperling Subject: Re: fix path meta-data used for packing To: Omar Polo Cc: gameoftrees@openbsd.org Date: Fri, 20 May 2022 16:11:02 +0200 On Fri, May 20, 2022 at 02:30:32PM +0200, Omar Polo wrote: > written on the go and only lightly tested, but regress passes. It > creates a fresh seed in got_pack_create and in got_deltify. I can move > the arc4random call one level higher probably, but these functions seems > to be called only once. Are you sure got_deltify_init() and the various content deltification functions don't need to use the same seed? deltify_init() splits a file into blocks and assigns a hash to each block. The other functions need to locate the same block hashes in a different file. If different seeds are now used then this scheme won't work as intended because the hashes of equivalent blocks won't match. This level of detail isn't covered by regress, unfortunately. > I've also changed bloom.c to create a fresh seed upon bloom_init: the > change is very small but this "vendored" library so I'm not sure to > change it. This bloom.c change looks fine to me. > This will require some work in -portable thought. I've seen what > openssh (IIRC) does to have a bundled arc4random and it's not > straightforward (even if we may be able to just steal their arc4random > compat.) I'm happy to help with that however! We already use arc4random elsewhere. So no worries there.