According to the documentation, the return code should be -1 when
RAND_status does not return 1.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1886)
int RAND_egd_bytes(const char *path, int bytes)
{
- int num, ret = 0;
+ int num, ret = -1;
num = RAND_query_egd_bytes(path, NULL, bytes);
- if (num < 1 || RAND_status() == 1)
+ if (RAND_status() == 1)
ret = num;
err:
return (ret);