Mercurial > dropbear
comparison svr-authpubkey.c @ 1421:814f22d4a58f
don't exit encountering short lines
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 25 May 2017 00:10:18 +0800 |
parents | 950c6973f27b |
children | 9e9c8d37fd56 |
comparison
equal
deleted
inserted
replaced
1420:950c6973f27b | 1421:814f22d4a58f |
---|---|
198 if (line->len < MIN_AUTHKEYS_LINE) { | 198 if (line->len < MIN_AUTHKEYS_LINE) { |
199 TRACE(("checkpubkey: line too short")) | 199 TRACE(("checkpubkey: line too short")) |
200 return DROPBEAR_FAILURE; /* line is too short for it to be a valid key */ | 200 return DROPBEAR_FAILURE; /* line is too short for it to be a valid key */ |
201 } | 201 } |
202 | 202 |
203 /* compare the algorithm. +3 so we have enough bytes to read a space and some base64 characters too. */ | |
204 if (line->pos + algolen+3 > line->len) { | |
205 goto out; | |
206 } | |
203 /* check the key type */ | 207 /* check the key type */ |
204 if (strncmp((const char *) buf_getptr(line, algolen), algo, algolen) != 0) { | 208 if (strncmp((const char *) buf_getptr(line, algolen), algo, algolen) != 0) { |
205 int is_comment = 0; | 209 int is_comment = 0; |
206 unsigned char *options_start = NULL; | 210 unsigned char *options_start = NULL; |
207 int options_len = 0; | 211 int options_len = 0; |