]> andersk Git - openssh.git/blobdiff - hostfile.c
- dtucker@cvs.openbsd.org 2009/05/05 07:51:36
[openssh.git] / hostfile.c
index 63550a29ddbd3f5ed87b3c4a2b00ab678e7bd6ec..2cceb352a1fe239792c10199f113cd472bcabbc0 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenBSD: hostfile.c,v 1.45 2006/08/03 03:34:42 deraadt Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: hostfile.c,v 1.35 2005/07/27 10:39:03 dtucker Exp $");
 
-#include <resolv.h>
+#include <sys/types.h>
+
+#include <netinet/in.h>
+
 #include <openssl/hmac.h>
 #include <openssl/sha.h>
 
-#include "packet.h"
+#include <resolv.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "xmalloc.h"
 #include "match.h"
 #include "key.h"
 #include "hostfile.h"
 #include "log.h"
-#include "xmalloc.h"
 
 static int
 extract_salt(const char *s, u_int l, char *salt, size_t salt_len)
@@ -88,8 +96,8 @@ extract_salt(const char *s, u_int l, char *salt, size_t salt_len)
                return (-1);
        }
        if (ret != SHA_DIGEST_LENGTH) {
-               debug2("extract_salt: expected salt len %u, got %u",
-                   salt_len, ret);
+               debug2("extract_salt: expected salt len %d, got %d",
+                   SHA_DIGEST_LENGTH, ret);
                return (-1);
        }
 
@@ -254,8 +262,10 @@ check_host_in_hostfile_by_key_or_type(const char *filename,
 
                if (key == NULL) {
                        /* we found a key of the requested type */
-                       if (found->type == keytype)
+                       if (found->type == keytype) {
+                               fclose(f);
                                return HOST_FOUND;
+                       }
                        continue;
                }
 
This page took 0.03829 seconds and 4 git commands to generate.