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>
This commit is contained in:
parent
2ecf923286
commit
e22e6bf0be
3 changed files with 12 additions and 2 deletions
4
CHANGES
4
CHANGES
|
@ -4,6 +4,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]
|
||||
|
||||
|
|
|
@ -595,6 +595,8 @@ re_start:
|
|||
if (starttls_proto == 1)
|
||||
{
|
||||
BIO_read(sbio,mbuf,BUFSIZZ);
|
||||
BIO_printf(sbio,"EHLO some.host.name\r\n");
|
||||
BIO_read(sbio,mbuf,BUFSIZZ);
|
||||
BIO_printf(sbio,"STARTTLS\r\n");
|
||||
BIO_read(sbio,sbuf,BUFSIZZ);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue