X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/2ceb8101cc5c68200b83966a4821c7bfe1f16123..d3221cca2d803f842bd8cef2fc3c542d17b1be39:/authfd.c diff --git a/authfd.c b/authfd.c index 8976616b..5cec7a97 100644 --- a/authfd.c +++ b/authfd.c @@ -1,3 +1,4 @@ +/* $OpenBSD: authfd.c,v 1.76 2006/07/09 15:15:10 stevesk Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -35,16 +36,20 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfd.c,v 1.66 2005/06/17 02:44:32 djm Exp $"); + +#include +#include +#include #include +#include + #include "ssh.h" #include "rsa.h" #include "buffer.h" #include "bufaux.h" #include "xmalloc.h" -#include "getput.h" #include "key.h" #include "authfd.h" #include "cipher.h" @@ -52,6 +57,7 @@ RCSID("$OpenBSD: authfd.c,v 1.66 2005/06/17 02:44:32 djm Exp $"); #include "compat.h" #include "log.h" #include "atomicio.h" +#include "misc.h" static int agent_present = 0; @@ -103,7 +109,7 @@ ssh_get_authentication_socket(void) close(sock); return -1; } - if (connect(sock, (struct sockaddr *) &sunaddr, sizeof sunaddr) < 0) { + if (connect(sock, (struct sockaddr *)&sunaddr, sizeof sunaddr) < 0) { close(sock); return -1; } @@ -119,7 +125,7 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply /* Get the length of the message, and format it in the buffer. */ len = buffer_len(request); - PUT_32BIT(buf, len); + put_u32(buf, len); /* Send the length and then the packet to the agent. */ if (atomicio(vwrite, auth->fd, buf, 4) != 4 || @@ -138,7 +144,7 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply } /* Extract the length, and check it for sanity. */ - len = GET_32BIT(buf); + len = get_u32(buf); if (len > 256 * 1024) fatal("Authentication response too long: %u", len); @@ -335,7 +341,6 @@ ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int versio break; default: return NULL; - break; } /* Decrement the number of remaining entries. */ auth->howmany--; @@ -394,7 +399,7 @@ ssh_decrypt_challenge(AuthenticationConnection *auth, * fatal error if the packet is corrupt. */ for (i = 0; i < 16; i++) - response[i] = buffer_get_char(&buffer); + response[i] = (u_char)buffer_get_char(&buffer); } buffer_free(&buffer); return success; @@ -517,7 +522,6 @@ ssh_add_identity_constrained(AuthenticationConnection *auth, Key *key, default: buffer_free(&msg); return 0; - break; } if (constrained) { if (life != 0) {