diff svr-authpubkey.c @ 854:ccc76acaf4c7

merge ecc again
author Matt Johnston <matt@ucc.asn.au>
date Thu, 14 Nov 2013 20:45:46 +0800
parents b11cb2518116
children 703c7cdd2577
line wrap: on
line diff
--- a/svr-authpubkey.c	Fri Nov 01 00:21:59 2013 +0800
+++ b/svr-authpubkey.c	Thu Nov 14 20:45:46 2013 +0800
@@ -89,7 +89,7 @@
 	buffer * signbuf = NULL;
 	sign_key * key = NULL;
 	char* fp = NULL;
-	int type = -1;
+	enum signkey_type type = -1;
 
 	TRACE(("enter pubkeyauth"))
 
@@ -294,8 +294,8 @@
 			options_buf = buf_new(options_len);
 			buf_putbytes(options_buf, options_start, options_len);
 
-			/* compare the algorithm */
-			if (line->pos + algolen > line->len) {
+			/* compare the algorithm. +3 so we have enough bytes to read a space and some base64 characters too. */
+			if (line->pos + algolen+3 > line->len) {
 				continue;
 			}
 			if (strncmp(buf_getptr(line, algolen), algo, algolen) != 0) {