提交 f69a8aeb 编写于 作者: L Lutz Jänicke

Fix hang in EGD/PRNGD query when communication socket is closed

prematurely by EGD/PRNGD.
PR: 1014
Submitted by: Darren Tucker <dtucker@zip.com.au>
上级 9d10b15e
......@@ -750,6 +750,10 @@
Changes between 0.9.7e and 0.9.7f [XX xxx XXXX]
*) Fix hang in EGD/PRNGD query when communication socket is closed
prematurely by EGD/PRNGD.
[Darren Tucker <dtucker@zip.com.au> via Lutz Jänicke, resolves #1014]
*) Prompt for pass phrases when appropriate for PKCS12 input format.
[Steve Henson]
......
......@@ -216,7 +216,9 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
while (numbytes != 1)
{
num = read(fd, egdbuf, 1);
if (num >= 0)
if (num == 0)
goto err; /* descriptor closed */
else if (num > 0)
numbytes += num;
else
{
......@@ -246,7 +248,9 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
while (numbytes != egdbuf[0])
{
num = read(fd, retrievebuf + numbytes, egdbuf[0] - numbytes);
if (num >= 0)
if (num == 0)
goto err; /* descriptor closed */
else if (num > 0)
numbytes += num;
else
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册