mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 18:04:25 +09:00
Replace ssh_say with ssh_log.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@256 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -117,10 +117,12 @@ static int wait_auth_status(SSH_SESSION *session,int kbdint){
|
|||||||
{
|
{
|
||||||
STRING *banner=buffer_get_ssh_string(session->in_buffer);
|
STRING *banner=buffer_get_ssh_string(session->in_buffer);
|
||||||
if(!banner){
|
if(!banner){
|
||||||
ssh_say(1,"The banner message was invalid. continuing though\n");
|
ssh_log(session, SSH_LOG_PACKET,
|
||||||
|
"The banner message was invalid. continuing though\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ssh_say(2,"Received a message banner\n");
|
ssh_log(session, SSH_LOG_PACKET,
|
||||||
|
"Received a message banner\n");
|
||||||
if(session->banner)
|
if(session->banner)
|
||||||
free(session->banner); /* erase the older one */
|
free(session->banner); /* erase the older one */
|
||||||
session->banner=banner;
|
session->banner=banner;
|
||||||
@@ -582,7 +584,8 @@ int ssh_userauth_autopubkey(SSH_SESSION *session, const char *passphrase) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(session->options->identity){
|
if(session->options->identity){
|
||||||
ssh_say(2,"Trying identity file %s\n",session->options->identity);
|
ssh_log(session, SSH_LOG_RARE,
|
||||||
|
"Trying identity file %s\n", session->options->identity);
|
||||||
keys_path[0]=session->options->identity;
|
keys_path[0]=session->options->identity;
|
||||||
/* let's hope alloca exists */
|
/* let's hope alloca exists */
|
||||||
id=malloc(strlen(session->options->identity)+1 + 4);
|
id=malloc(strlen(session->options->identity)+1 + 4);
|
||||||
@@ -604,7 +607,7 @@ int ssh_userauth_autopubkey(SSH_SESSION *session, const char *passphrase) {
|
|||||||
return err;
|
return err;
|
||||||
} else
|
} else
|
||||||
if(err != SSH_AUTH_SUCCESS){
|
if(err != SSH_AUTH_SUCCESS){
|
||||||
ssh_say(2,"Public key refused by server\n");
|
ssh_log(session, SSH_LOG_RARE, "Public key refused by server\n");
|
||||||
free(pubkey);
|
free(pubkey);
|
||||||
pubkey=NULL;
|
pubkey=NULL;
|
||||||
free(privkeyfile);
|
free(privkeyfile);
|
||||||
@@ -614,7 +617,9 @@ int ssh_userauth_autopubkey(SSH_SESSION *session, const char *passphrase) {
|
|||||||
/* pubkey accepted by server ! */
|
/* pubkey accepted by server ! */
|
||||||
privkey=privatekey_from_file(session,privkeyfile,type,passphrase);
|
privkey=privatekey_from_file(session,privkeyfile,type,passphrase);
|
||||||
if(!privkey){
|
if(!privkey){
|
||||||
ssh_say(0,"Reading private key %s failed (bad passphrase ?)\n",privkeyfile);
|
ssh_log(session, SSH_LOG_FUNCTIONS,
|
||||||
|
"Reading private key %s failed (bad passphrase ?)\n",
|
||||||
|
privkeyfile);
|
||||||
free(pubkey);
|
free(pubkey);
|
||||||
pubkey=NULL;
|
pubkey=NULL;
|
||||||
free(privkeyfile);
|
free(privkeyfile);
|
||||||
@@ -635,7 +640,9 @@ int ssh_userauth_autopubkey(SSH_SESSION *session, const char *passphrase) {
|
|||||||
return err;
|
return err;
|
||||||
} else
|
} else
|
||||||
if(err != SSH_AUTH_SUCCESS){
|
if(err != SSH_AUTH_SUCCESS){
|
||||||
ssh_say(0,"Weird : server accepted our public key but refused the signature\nit might be a bug of libssh\n");
|
ssh_log(session, SSH_LOG_FUNCTIONS,
|
||||||
|
"Weird : server accepted our public key but refused the signature\n"
|
||||||
|
"it might be a bug of libssh\n");
|
||||||
free(pubkey);
|
free(pubkey);
|
||||||
pubkey=NULL;
|
pubkey=NULL;
|
||||||
free(privkeyfile);
|
free(privkeyfile);
|
||||||
@@ -644,7 +651,8 @@ int ssh_userauth_autopubkey(SSH_SESSION *session, const char *passphrase) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* auth success */
|
/* auth success */
|
||||||
ssh_say(1,"Authentication using %s success\n",privkeyfile);
|
ssh_log(session, SSH_LOG_RARE,
|
||||||
|
"Authentication using %s success\n", privkeyfile);
|
||||||
free(pubkey);
|
free(pubkey);
|
||||||
private_key_free(privkey);
|
private_key_free(privkey);
|
||||||
free(privkeyfile);
|
free(privkeyfile);
|
||||||
@@ -657,7 +665,8 @@ int ssh_userauth_autopubkey(SSH_SESSION *session, const char *passphrase) {
|
|||||||
return SSH_AUTH_SUCCESS;
|
return SSH_AUTH_SUCCESS;
|
||||||
}
|
}
|
||||||
/* at this point, pubkey is NULL and so is privkeyfile */
|
/* at this point, pubkey is NULL and so is privkeyfile */
|
||||||
ssh_say(1,"Tried every public key, none matched\n");
|
ssh_log(session, SSH_LOG_FUNCTIONS,
|
||||||
|
"Tried every public key, none matched\n");
|
||||||
ssh_set_error(session,SSH_NO_ERROR,"no public key matched");
|
ssh_set_error(session,SSH_NO_ERROR,"no public key matched");
|
||||||
if(id){
|
if(id){
|
||||||
pub_keys_path[0]=NULL;
|
pub_keys_path[0]=NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user