version 1.73, 2006/03/25 18:29:35 |
version 1.74, 2006/03/30 09:58:15 |
|
|
#include "buffer.h" |
#include "buffer.h" |
#include "bufaux.h" |
#include "bufaux.h" |
#include "xmalloc.h" |
#include "xmalloc.h" |
#include "getput.h" |
|
#include "key.h" |
#include "key.h" |
#include "authfd.h" |
#include "authfd.h" |
#include "cipher.h" |
#include "cipher.h" |
|
|
#include "compat.h" |
#include "compat.h" |
#include "log.h" |
#include "log.h" |
#include "atomicio.h" |
#include "atomicio.h" |
|
#include "misc.h" |
|
|
static int agent_present = 0; |
static int agent_present = 0; |
|
|
|
|
|
|
/* Get the length of the message, and format it in the buffer. */ |
/* Get the length of the message, and format it in the buffer. */ |
len = buffer_len(request); |
len = buffer_len(request); |
PUT_32BIT(buf, len); |
put_u32(buf, len); |
|
|
/* Send the length and then the packet to the agent. */ |
/* Send the length and then the packet to the agent. */ |
if (atomicio(vwrite, auth->fd, buf, 4) != 4 || |
if (atomicio(vwrite, auth->fd, buf, 4) != 4 || |
|
|
} |
} |
|
|
/* Extract the length, and check it for sanity. */ |
/* Extract the length, and check it for sanity. */ |
len = GET_32BIT(buf); |
len = get_u32(buf); |
if (len > 256 * 1024) |
if (len > 256 * 1024) |
fatal("Authentication response too long: %u", len); |
fatal("Authentication response too long: %u", len); |
|
|