- djm@cvs.openbsd.org 2013/07/12 00:19:59
     [auth-options.c auth-rsa.c bufaux.c buffer.h channels.c hostfile.c]
     [hostfile.h mux.c packet.c packet.h roaming_common.c serverloop.c]
     fix pointer-signedness warnings from clang/llvm-3.3; "seems nice" deraadt@
diff --git a/hostfile.c b/hostfile.c
index 69d0d28..2ff4c48 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostfile.c,v 1.51 2013/05/17 00:13:13 djm Exp $ */
+/* $OpenBSD: hostfile.c,v 1.52 2013/07/12 00:19:58 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -64,7 +64,7 @@
 };
 
 static int
-extract_salt(const char *s, u_int l, char *salt, size_t salt_len)
+extract_salt(const char *s, u_int l, u_char *salt, size_t salt_len)
 {
 	char *p, *b64salt;
 	u_int b64len;
@@ -115,7 +115,8 @@
 {
 	const EVP_MD *md = EVP_sha1();
 	HMAC_CTX mac_ctx;
-	char salt[256], result[256], uu_salt[512], uu_result[512];
+	u_char salt[256], result[256];
+	char uu_salt[512], uu_result[512];
 	static char encoded[1024];
 	u_int i, len;
 
@@ -133,7 +134,7 @@
 	}
 
 	HMAC_Init(&mac_ctx, salt, len, md);
-	HMAC_Update(&mac_ctx, host, strlen(host));
+	HMAC_Update(&mac_ctx, (u_char *)host, strlen(host));
 	HMAC_Final(&mac_ctx, result, NULL);
 	HMAC_cleanup(&mac_ctx);
 
@@ -153,7 +154,7 @@
  */
 
 int
-hostfile_read_key(char **cpp, u_int *bitsp, Key *ret)
+hostfile_read_key(char **cpp, int *bitsp, Key *ret)
 {
 	char *cp;
 
@@ -170,8 +171,10 @@
 
 	/* Return results. */
 	*cpp = cp;
-	if (bitsp != NULL)
-		*bitsp = key_size(ret);
+	if (bitsp != NULL) {
+		if ((*bitsp = key_size(ret)) <= 0)
+			return 0;
+	}
 	return 1;
 }