mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
SSH_AUTH_PARTIAL is now correctly passed to the caller of ssh_userauth_publickey_auto().
Implicitly fixed unsafe return code handling that could result in use-after-free. Signed-off-by: Tilo Eckert <tilo.eckert@flam.de> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
cc25d747d4
commit
0423057424
9
src/auth.c
Normal file → Executable file
9
src/auth.c
Normal file → Executable file
@@ -1045,15 +1045,14 @@ int ssh_userauth_publickey_auto(ssh_session session,
|
|||||||
ssh_key_free(state->privkey);
|
ssh_key_free(state->privkey);
|
||||||
ssh_key_free(state->pubkey);
|
ssh_key_free(state->pubkey);
|
||||||
SAFE_FREE(session->auth_auto_state);
|
SAFE_FREE(session->auth_auto_state);
|
||||||
}
|
if (rc == SSH_AUTH_SUCCESS) {
|
||||||
if (rc == SSH_AUTH_ERROR) {
|
|
||||||
return rc;
|
|
||||||
} else if (rc == SSH_AUTH_SUCCESS) {
|
|
||||||
SSH_LOG(SSH_LOG_INFO,
|
SSH_LOG(SSH_LOG_INFO,
|
||||||
"Successfully authenticated using %s",
|
"Successfully authenticated using %s",
|
||||||
privkey_file);
|
privkey_file);
|
||||||
|
}
|
||||||
return rc;
|
return rc;
|
||||||
} else if (rc == SSH_AUTH_AGAIN){
|
}
|
||||||
|
if (rc == SSH_AUTH_AGAIN){
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user