summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-11-12 23:58:51 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-11-12 23:58:51 +0800
commit7e72fb0466c945b44c8c17922a192df4f9f90f64 (patch)
tree161b3565ebd81ad4a12459f4fe8a3a57082f7c68
parent80f62f4db06e7110e199b18e62326f5ad462d415 (diff)
downloaddropbear-ecc.tar.gz
Don't exit fatally if authorized_keys has a line likeecc
command="something" ssh-rsa
-rw-r--r--svr-authpubkey.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/svr-authpubkey.c b/svr-authpubkey.c
index 4eca211..66fe5e5 100644
--- a/svr-authpubkey.c
+++ b/svr-authpubkey.c
@@ -294,8 +294,8 @@ static int checkpubkey(unsigned char* algo, unsigned int algolen,
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) {