- stevesk@cvs.openbsd.org 2002/08/22 19:27:53
[ssh-agent.c] use common close function; ok markus@
This commit is contained in:
parent
4efdfff6ba
commit
58f3486c74
|
@ -13,6 +13,9 @@
|
||||||
- stevesk@cvs.openbsd.org 2002/08/21 20:10:28
|
- stevesk@cvs.openbsd.org 2002/08/21 20:10:28
|
||||||
[ssh-agent.c]
|
[ssh-agent.c]
|
||||||
raise listen backlog; ok markus@
|
raise listen backlog; ok markus@
|
||||||
|
- stevesk@cvs.openbsd.org 2002/08/22 19:27:53
|
||||||
|
[ssh-agent.c]
|
||||||
|
use common close function; ok markus@
|
||||||
|
|
||||||
20020820
|
20020820
|
||||||
- OpenBSD CVS Sync
|
- OpenBSD CVS Sync
|
||||||
|
@ -1554,4 +1557,4 @@
|
||||||
- (stevesk) entropy.c: typo in debug message
|
- (stevesk) entropy.c: typo in debug message
|
||||||
- (djm) ssh-keygen -i needs seeded RNG; report from markus@
|
- (djm) ssh-keygen -i needs seeded RNG; report from markus@
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.2430 2002/09/04 06:28:18 djm Exp $
|
$Id: ChangeLog,v 1.2431 2002/09/04 06:31:21 djm Exp $
|
||||||
|
|
38
ssh-agent.c
38
ssh-agent.c
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "openbsd-compat/fake-queue.h"
|
#include "openbsd-compat/fake-queue.h"
|
||||||
RCSID("$OpenBSD: ssh-agent.c,v 1.100 2002/08/21 20:10:28 stevesk Exp $");
|
RCSID("$OpenBSD: ssh-agent.c,v 1.101 2002/08/22 19:27:53 stevesk Exp $");
|
||||||
|
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/md5.h>
|
#include <openssl/md5.h>
|
||||||
|
@ -106,6 +106,18 @@ extern char *__progname;
|
||||||
char *__progname;
|
char *__progname;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
close_socket(SocketEntry *e)
|
||||||
|
{
|
||||||
|
shutdown(e->fd, SHUT_RDWR);
|
||||||
|
close(e->fd);
|
||||||
|
e->fd = -1;
|
||||||
|
e->type = AUTH_UNUSED;
|
||||||
|
buffer_free(&e->input);
|
||||||
|
buffer_free(&e->output);
|
||||||
|
buffer_free(&e->request);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
idtab_init(void)
|
idtab_init(void)
|
||||||
{
|
{
|
||||||
|
@ -617,13 +629,7 @@ process_message(SocketEntry *e)
|
||||||
cp = buffer_ptr(&e->input);
|
cp = buffer_ptr(&e->input);
|
||||||
msg_len = GET_32BIT(cp);
|
msg_len = GET_32BIT(cp);
|
||||||
if (msg_len > 256 * 1024) {
|
if (msg_len > 256 * 1024) {
|
||||||
shutdown(e->fd, SHUT_RDWR);
|
close_socket(e);
|
||||||
close(e->fd);
|
|
||||||
e->fd = -1;
|
|
||||||
e->type = AUTH_UNUSED;
|
|
||||||
buffer_free(&e->input);
|
|
||||||
buffer_free(&e->output);
|
|
||||||
buffer_free(&e->request);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (buffer_len(&e->input) < msg_len + 4)
|
if (buffer_len(&e->input) < msg_len + 4)
|
||||||
|
@ -836,13 +842,7 @@ after_select(fd_set *readset, fd_set *writeset)
|
||||||
break;
|
break;
|
||||||
} while (1);
|
} while (1);
|
||||||
if (len <= 0) {
|
if (len <= 0) {
|
||||||
shutdown(sockets[i].fd, SHUT_RDWR);
|
close_socket(&sockets[i]);
|
||||||
close(sockets[i].fd);
|
|
||||||
sockets[i].fd = -1;
|
|
||||||
sockets[i].type = AUTH_UNUSED;
|
|
||||||
buffer_free(&sockets[i].input);
|
|
||||||
buffer_free(&sockets[i].output);
|
|
||||||
buffer_free(&sockets[i].request);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
buffer_consume(&sockets[i].output, len);
|
buffer_consume(&sockets[i].output, len);
|
||||||
|
@ -856,13 +856,7 @@ after_select(fd_set *readset, fd_set *writeset)
|
||||||
break;
|
break;
|
||||||
} while (1);
|
} while (1);
|
||||||
if (len <= 0) {
|
if (len <= 0) {
|
||||||
shutdown(sockets[i].fd, SHUT_RDWR);
|
close_socket(&sockets[i]);
|
||||||
close(sockets[i].fd);
|
|
||||||
sockets[i].fd = -1;
|
|
||||||
sockets[i].type = AUTH_UNUSED;
|
|
||||||
buffer_free(&sockets[i].input);
|
|
||||||
buffer_free(&sockets[i].output);
|
|
||||||
buffer_free(&sockets[i].request);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
buffer_append(&sockets[i].input, buf, len);
|
buffer_append(&sockets[i].input, buf, len);
|
||||||
|
|
Loading…
Reference in New Issue