[ldns-users] Improper randomness in ldns_resolver_nameservers_randomize() function

Matthijs Mekking matthijs at NLnetLabs.nl
Wed May 19 13:56:16 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Zbynek,

I have changed (in trunk) the function
ldns_resolver_nameservers_randomize(...) to use a different random
generator. You can now initialize randomness yourself by calling
ldns_init_random(...).

Best regards,

Matthijs


Zbynek Michl wrote:
> Hi,
> 
> there is no seed initialization before random() function and it leads to
> select the first resolver everytime from the list if it contains exactly
> two resolvers.
> I guess that init with "srandom((unsigned int)time(NULL))" should be
> enough for this purpose.
> 
> Thanks,
> Zbynek
> _______________________________________________
> ldns-users mailing list
> ldns-users at open.nlnetlabs.nl
> http://open.nlnetlabs.nl/mailman/listinfo/ldns-users

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEcBAEBAgAGBQJL8+3+AAoJEA8yVCPsQCW51wkH/iOefTUrk50u1lZrsXEa7+AM
3nTliXoJtuhs8h1yb4uYUAiy6otKXYRkXT9MsvM4g8sOsXc5u013zz7hWry9U4EI
bn8ozcGXmcDudOBnOKrN19icQlSnzoWipthhCc7W2Yn+t3Ev452+Df/31dfVW7th
SOVDdF9nureHiFPGfxdRI7hWDQUvq8Y9Ke7LYxi1MCEBSQcMv8AEWpHG/UpoZwil
ripMA59Vw1hmqqqufbtWlBYIQ64402jl90UaWYKf7E/MVfZMctsvD6BB0ChV78ne
KOhF3bFG0BmjwD2mzGjvV/+umPLqIWtDUKcrlXoLr4+un6StjT4yaMUiiXFb/wc=
=aqD7
-----END PGP SIGNATURE-----



More information about the ldns-users mailing list