diff options
| author | forsyth <forsyth@vitanuova.com> | 2011-01-17 11:10:35 +0000 |
|---|---|---|
| committer | forsyth <forsyth@vitanuova.com> | 2011-01-17 11:10:35 +0000 |
| commit | d6b4eae8eb0a5ca3119414005e483fedd63a62d6 (patch) | |
| tree | 4959b04b1ae02ce5ccb4b3c0a8c459ff46587eb7 /appl/cmd/ssh/authpassword.b | |
| parent | 9e6910dc0c747c8f30b87f6482f4eadb48ad6654 (diff) | |
20110117-1110
Diffstat (limited to 'appl/cmd/ssh/authpassword.b')
| -rw-r--r-- | appl/cmd/ssh/authpassword.b | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/appl/cmd/ssh/authpassword.b b/appl/cmd/ssh/authpassword.b deleted file mode 100644 index 1a149117..00000000 --- a/appl/cmd/ssh/authpassword.b +++ /dev/null @@ -1,68 +0,0 @@ -implement Auth; - -include "sys.m"; - sys: Sys; - -include "ipints.m"; - ipints: IPints; - IPint: import ipints; - -include "crypt.m"; - crypt: Crypt; # TO DO: needed to avoid compiler error - -include "factotum.m"; - factotum: Factotum; - -include "sshio.m"; - sshio: Sshio; - Conn, Msg: import sshio; - -id(): int -{ - return SSH_AUTH_PASSWORD; -} - -init(mod: Sshio) -{ - sys = load Sys Sys->PATH; - sshio = mod; -} - -firstmsg(): int -{ - return SSH_CMSG_AUTH_PASSWORD; -} - -authsrv(c: ref Conn, m: ref Msg): ref AuthInfo -{ - pass := m.getstring(); -# return auth_userpasswd(c.user, pass); - return ref AuthInfo(c.user, nil); # TO DO: -} - -auth(c: ref Conn): int -{ - if(factotum == nil) - factotum = load Factotum Factotum->PATH; - (user, pass) := factotum->getuserpasswd(sys->sprint("proto=pass service=ssh server=%q user=%q", c.host, c.user)); - if(user == nil){ - sshio->debug(DBG_AUTH, "getuserpasswd failed"); - return -1; - } - - sshio->debug(DBG_AUTH, "try using password from factotum\n"); - m := Msg.mk(SSH_CMSG_AUTH_PASSWORD, 4+Sys->UTFmax*len pass); - m.putstring(pass); - c.out <-= m; - - m = sshio->recvmsg(c, -1); - case m.mtype { - SSH_SMSG_SUCCESS => - return 0; - SSH_SMSG_FAILURE => - return -1; - * => - sshio->badmsg(m, 0, nil); - return -1; - } -} |
