Fix publickey authentication regression
Commit 70b199f47659a74b8778c528beccf893843e5ecb introduced a parsing bug in file_read_publickey() which made the algorithm name contain an extra trailing space character, breaking all publickey authentication.
This commit is contained in:
parent
bd0505d6b9
commit
87e32272f9
@ -545,7 +545,7 @@ file_read_publickey(LIBSSH2_SESSION * session, unsigned char **method,
|
|||||||
|
|
||||||
sp1++;
|
sp1++;
|
||||||
|
|
||||||
if ((sp2 = memchr(sp1, ' ', pubkey_len - *method_len)) == NULL) {
|
if ((sp2 = memchr(sp1, ' ', pubkey_len - (sp1 - pubkey - 1))) == NULL) {
|
||||||
/* Assume that the id string is missing, but that it's okay */
|
/* Assume that the id string is missing, but that it's okay */
|
||||||
sp2 = pubkey + pubkey_len;
|
sp2 = pubkey + pubkey_len;
|
||||||
}
|
}
|
||||||
@ -562,7 +562,7 @@ file_read_publickey(LIBSSH2_SESSION * session, unsigned char **method,
|
|||||||
* to be freed soon anyway, we'll just avoid the extra free/alloc and call
|
* to be freed soon anyway, we'll just avoid the extra free/alloc and call
|
||||||
* it a wash */
|
* it a wash */
|
||||||
*method = pubkey;
|
*method = pubkey;
|
||||||
*method_len = sp1 - pubkey;
|
*method_len = sp1 - pubkey - 1;
|
||||||
|
|
||||||
*pubkeydata = tmp;
|
*pubkeydata = tmp;
|
||||||
*pubkeydata_len = tmp_len;
|
*pubkeydata_len = tmp_len;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user