Mercurial > dropbear
comparison svr-authpubkey.c @ 1452:15d4b821bcc9
fix checkpubkey_line function name for TRACE
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 04 Oct 2017 22:30:18 +0800 |
parents | 7e95ab97d2b0 |
children | fb90a5ba84e0 |
comparison
equal
deleted
inserted
replaced
1451:7e95ab97d2b0 | 1452:15d4b821bcc9 |
---|---|
194 buffer *options_buf = NULL; | 194 buffer *options_buf = NULL; |
195 unsigned int pos, len; | 195 unsigned int pos, len; |
196 int ret = DROPBEAR_FAILURE; | 196 int ret = DROPBEAR_FAILURE; |
197 | 197 |
198 if (line->len < MIN_AUTHKEYS_LINE || line->len > MAX_AUTHKEYS_LINE) { | 198 if (line->len < MIN_AUTHKEYS_LINE || line->len > MAX_AUTHKEYS_LINE) { |
199 TRACE(("checkpubkey: bad line length %d", line->len)) | 199 TRACE(("checkpubkey_line: bad line length %d", line->len)) |
200 return DROPBEAR_FAILURE; | 200 return DROPBEAR_FAILURE; |
201 } | 201 } |
202 | 202 |
203 /* compare the algorithm. +3 so we have enough bytes to read a space and some base64 characters too. */ | 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) { | 204 if (line->pos + algolen+3 > line->len) { |
259 } | 259 } |
260 buf_incrpos(line, algolen); | 260 buf_incrpos(line, algolen); |
261 | 261 |
262 /* check for space (' ') character */ | 262 /* check for space (' ') character */ |
263 if (buf_getbyte(line) != ' ') { | 263 if (buf_getbyte(line) != ' ') { |
264 TRACE(("checkpubkey: space character expected, isn't there")) | 264 TRACE(("checkpubkey_line: space character expected, isn't there")) |
265 goto out; | 265 goto out; |
266 } | 266 } |
267 | 267 |
268 /* truncate the line at the space after the base64 data */ | 268 /* truncate the line at the space after the base64 data */ |
269 pos = line->pos; | 269 pos = line->pos; |
271 if (buf_getbyte(line) == ' ') break; | 271 if (buf_getbyte(line) == ' ') break; |
272 } | 272 } |
273 buf_setpos(line, pos); | 273 buf_setpos(line, pos); |
274 buf_setlen(line, line->pos + len); | 274 buf_setlen(line, line->pos + len); |
275 | 275 |
276 TRACE(("checkpubkey: line pos = %d len = %d", line->pos, line->len)) | 276 TRACE(("checkpubkey_line: line pos = %d len = %d", line->pos, line->len)) |
277 | 277 |
278 ret = cmp_base64_key(keyblob, keybloblen, (const unsigned char *) algo, algolen, line, NULL); | 278 ret = cmp_base64_key(keyblob, keybloblen, (const unsigned char *) algo, algolen, line, NULL); |
279 | 279 |
280 if (ret == DROPBEAR_SUCCESS && options_buf) { | 280 if (ret == DROPBEAR_SUCCESS && options_buf) { |
281 ret = svr_add_pubkey_options(options_buf, line_num, filename); | 281 ret = svr_add_pubkey_options(options_buf, line_num, filename); |