authsrv: work arround linux omiting final Z(4) after the AvrPairs
This commit is contained in:
parent
bf86c9b4e1
commit
e684b2a3fb
1 changed files with 17 additions and 3 deletions
|
@ -52,6 +52,7 @@ void desencrypt(uchar data[8], uchar key[7]);
|
||||||
void tickauthreply(Ticketreq*, Authkey*);
|
void tickauthreply(Ticketreq*, Authkey*);
|
||||||
void tickauthreply2(Ticketreq*, Authkey*, uchar *, int, uchar *, int);
|
void tickauthreply2(Ticketreq*, Authkey*, uchar *, int, uchar *, int);
|
||||||
void safecpy(char*, char*, int);
|
void safecpy(char*, char*, int);
|
||||||
|
void catch(void*, char*);
|
||||||
|
|
||||||
void
|
void
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
@ -691,6 +692,7 @@ mschap(Ticketreq *tr, int nchal)
|
||||||
int dupe, lmok, ntok, ntbloblen;
|
int dupe, lmok, ntok, ntbloblen;
|
||||||
uchar phash[SHA1dlen], chash[SHA1dlen], ahash[SHA1dlen];
|
uchar phash[SHA1dlen], chash[SHA1dlen], ahash[SHA1dlen];
|
||||||
DigestState *s;
|
DigestState *s;
|
||||||
|
long timeout;
|
||||||
int tries;
|
int tries;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -750,9 +752,14 @@ Retry:
|
||||||
/* Z[4] */
|
/* Z[4] */
|
||||||
if(ntbloblen > sizeof(ntblob)-4)
|
if(ntbloblen > sizeof(ntblob)-4)
|
||||||
exits(0);
|
exits(0);
|
||||||
if(readn(0, ntblob+ntbloblen, 4) < 0)
|
|
||||||
exits(0);
|
/* LINUX omits the final Z(4), so read with short timeout */
|
||||||
ntbloblen += 4;
|
notify(catch);
|
||||||
|
timeout = alarm(50);
|
||||||
|
if(readn(0, ntblob+ntbloblen, 4) == 4)
|
||||||
|
ntbloblen += 4;
|
||||||
|
alarm(timeout);
|
||||||
|
notify(nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
safecpy(tr->uid, reply.uid, sizeof(tr->uid));
|
safecpy(tr->uid, reply.uid, sizeof(tr->uid));
|
||||||
|
@ -1151,3 +1158,10 @@ safecpy(char *to, char *from, int len)
|
||||||
to[len-1] = 0;
|
to[len-1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
catch(void*, char *msg)
|
||||||
|
{
|
||||||
|
if(strstr(msg, "alarm") != nil)
|
||||||
|
noted(NCONT);
|
||||||
|
noted(NDFLT);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue