ssh: add "none" method to find out list of acceptable methods
This commit is contained in:
parent
1f6a604c23
commit
f8eb5a1d13
1 changed files with 27 additions and 1 deletions
|
@ -672,6 +672,32 @@ if(debug)
|
||||||
return partial != 0 || !authok(meth);
|
return partial != 0 || !authok(meth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
noneauth(void)
|
||||||
|
{
|
||||||
|
static char authmeth[] = "none";
|
||||||
|
|
||||||
|
if(!authok(authmeth))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
sendpkt("bsss", MSG_USERAUTH_REQUEST,
|
||||||
|
user, strlen(user),
|
||||||
|
service, strlen(service),
|
||||||
|
authmeth, sizeof(authmeth)-1);
|
||||||
|
|
||||||
|
Next0: switch(recvpkt()){
|
||||||
|
default:
|
||||||
|
dispatch();
|
||||||
|
goto Next0;
|
||||||
|
case MSG_USERAUTH_FAILURE:
|
||||||
|
werrstr("authentication needed");
|
||||||
|
authfailure(authmeth);
|
||||||
|
return -1;
|
||||||
|
case MSG_USERAUTH_SUCCESS:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
pubkeyauth(void)
|
pubkeyauth(void)
|
||||||
{
|
{
|
||||||
|
@ -1171,7 +1197,7 @@ Next0: switch(recvpkt()){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pubkeyauth() < 0 && passauth() < 0 && kbintauth() < 0)
|
if(noneauth() < 0 && pubkeyauth() < 0 && passauth() < 0 && kbintauth() < 0)
|
||||||
sysfatal("auth: %r");
|
sysfatal("auth: %r");
|
||||||
|
|
||||||
recv.pkt = MaxPacket;
|
recv.pkt = MaxPacket;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue