9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] nfactotum: mschap fix
@ 2012-03-30 15:24 Yaroslav
  2012-03-30 16:37 ` Lucio De Re
  0 siblings, 1 reply; 4+ messages in thread
From: Yaroslav @ 2012-03-30 15:24 UTC (permalink / raw)
  To: 9fans

Forwarding it to the list so people don't bother to debug themselves.
It's tested with cifs and a local change which enables upas/fs to do
IMAP with NTLM auth.

---------- Forwarded message ----------
From: Yaroslav <yarikos@gmail.com>
Date: 2012/3/30
Subject: Re: [9fans] SSHv2
To: erik quanstrom <quanstro@quanstro.net>


2012/3/30 erik quanstrom <quanstro@quanstro.net>:
> On Fri Mar 30 09:48:50 EDT 2012, yarikos@gmail.com wrote:
>> 2012/3/30 erik quanstrom <quanstro@quanstro.net>:
>> > what's the basis for this claim?  it might be broken, since we don't use it
>> > much, but it's not missing.
>>
>> Yes, sorry, I've meant it's broken; details follow.
>
> try pulling a new copy.
>
> - erik

There are phases mismatch between factotum's chapconv() and libauth's
auth_respond(). I've checked plan9port - it has identical problem.
Patch which fixes it follows:

term% diff -c /n/sources/contrib/quanstro/root/sys/src/cmd/auth/factotum/chap.c
/sys/src/cmd/auth/factotum/chap.c
/n/sources/contrib/quanstro/root/sys/src/cmd/auth/factotum/chap.c:120,125
- /sys/src/cmd/auth/factotum/chap.c:120,126

       ret = -1;
       chal = nil;
+       res = nil;
       k = nil;
       attr = c->attr;

/n/sources/contrib/quanstro/root/sys/src/cmd/auth/factotum/chap.c:153,166
- /sys/src/cmd/auth/factotum/chap.c:154,163
       c->state = "read challenge";
       if((nchal = convreadm(c, (char**)(void*)&chal)) < 0)
               goto out;
-       if(astype == AuthMSchap && nchal != MSchallen)
-       c->state = "write user";
       if((user = strfindattr(k->attr, "user")) == nil){
               werrstr("key has no user (cannot happen?)");
               goto out;
       }
-       if(convprint(c, "%s", user) < 0)
-               goto out;

       c->state = "write response";
       if((pw = strfindattr(k->privattr, "!password")) == nil){


-- 
- Yaroslav



^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <CAG3N4d_mEkM2CeEQ-WhqKmK2_WbJz6X_N2JQkaR6QMRtThkw_w@mail.gmail.c>]

end of thread, other threads:[~2012-03-30 16:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-30 15:24 [9fans] nfactotum: mschap fix Yaroslav
2012-03-30 16:37 ` Lucio De Re
     [not found] <CAG3N4d_mEkM2CeEQ-WhqKmK2_WbJz6X_N2JQkaR6QMRtThkw_w@mail.gmail.c>
2012-03-30 15:53 ` erik quanstrom
2012-03-30 16:11   ` yaroslav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).