Hal Murray via devel <[email protected]>:
> Would somebody please eyeball these changes.  Thanks.
> 
> -       unsigned char rnd[sizeof(uint32_t)];
> -       RAND_bytes(rnd, sizeof(rnd));
> -       return (int32_t)ntp_be32dec(rnd);
> 
> +       int err;
> +       uint32_t rnd;
> +       err = RAND_bytes((unsigned char *)&rnd, sizeof(rnd));
> +       if (1 != err) {
> +               msyslog(LOG_ERR, "ERR: ntp_random - RAND_bytes failed");
> +         exit(1);
> +       }
> +       return rnd;

That looks reasonable.  However, I am not an expert on crypto and randomness.
-- 
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>

My work is funded by the Internet Civil Engineering Institute: https://icei.org
Please visit their site and donate: the civilization you save might be your own.


_______________________________________________
devel mailing list
[email protected]
http://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to