X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/a75f53605e3e5592c6c6a2c979a7a43db7db481d..HEAD:/ssh-keysign.c diff --git a/ssh-keysign.c b/ssh-keysign.c index f2ee214e..0fdcebbd 100644 --- a/ssh-keysign.c +++ b/ssh-keysign.c @@ -1,3 +1,4 @@ +/* $OpenBSD: ssh-keysign.c,v 1.30 2010/01/13 01:20:20 dtucker Exp $ */ /* * Copyright (c) 2002 Markus Friedl. All rights reserved. * @@ -21,23 +22,30 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #include "includes.h" -RCSID("$OpenBSD: ssh-keysign.c,v 1.20 2006/02/08 12:15:27 stevesk Exp $"); +#include +#ifdef HAVE_PATHS_H #include +#endif +#include +#include +#include +#include +#include #include #include #include +#include "xmalloc.h" #include "log.h" #include "key.h" #include "ssh.h" #include "ssh2.h" #include "misc.h" -#include "xmalloc.h" #include "buffer.h" -#include "bufaux.h" #include "authfile.h" #include "msg.h" #include "canohost.h" @@ -66,9 +74,9 @@ valid_request(struct passwd *pw, char *host, Key **ret, u_char *data, buffer_init(&b); buffer_append(&b, data, datalen); - /* session id, currently limited to SHA1 (20 bytes) */ + /* session id, currently limited to SHA1 (20 bytes) or SHA256 (32) */ p = buffer_get_string(&b, &len); - if (len != 20) + if (len != 20 && len != 32) fail++; xfree(p); @@ -142,7 +150,7 @@ main(int argc, char **argv) { Buffer b; Options options; - Key *keys[2], *key; + Key *keys[2], *key = NULL; struct passwd *pw; int key_fd[2], i, found, version = 2, fd; u_char *signature, *data; @@ -214,7 +222,7 @@ main(int argc, char **argv) if ((fd == STDIN_FILENO) || (fd == STDOUT_FILENO)) fatal("bad fd"); if ((host = get_local_name(fd)) == NULL) - fatal("cannot get sockname for fd"); + fatal("cannot get local name for fd"); data = buffer_get_string(&b, &dlen); if (valid_request(pw, host, &key, data, dlen) < 0)