M pc/archgeneric.c => pc/archgeneric.c +1 -0
@@ 60,6 60,7 @@ static X86type x86type[] =
{ 5, 7, 23, "P54C VRT", },
{ 6, 1, 16, "PentiumPro", },/* determined by trial and error */
{ 6, 3, 16, "PentiumII", }, /* determined by trial and error */
+ { 6, 5, 16, "PentiumII", }, /* determined by trial and error */
{ 3, -1, 32, "386", }, /* family defaults */
{ 4, -1, 22, "486", },
M port/auth.c => port/auth.c +23 -1
@@ 478,6 478,24 @@ authcheck(Chan *c, char *a, int n)
}
/*
+ * reading authcheck after writing into it yields the
+ * nonce key
+ */
+long
+authcheckread(Chan *c, char *a, int n)
+{
+ Crypt *cp;
+
+ cp = c->aux;
+ if(cp == nil)
+ error(Ebadarg);
+ if(n < TICKETLEN))
+ error(Ebadarg);
+ convT2M(&cp->t, a, nil);
+ return sizeof(cp->t);
+}
+
+/*
* called by devcons() for #c/authenticator
*
* a read after a write of a ticket (or ticket+id) returns an authenticator
@@ 522,7 540,11 @@ authentread(Chan *c, char *a, int n)
cp->a.num = AuthAc;
memmove(cp->a.chal, cp->t.chal, CHALLEN);
convA2M(&cp->a, cp->tbuf, cp->t.key);
- memmove(a, cp->tbuf, AUTHENTLEN);
+
+ if(n >= AUTHENTLEN)
+ memmove(a, cp->tbuf, AUTHENTLEN);
+ if(n >= AUTHENTLEN + TICKETLEN)
+ convT2M(&cp->t, a+AUTHENTLEN, nil);
return n;
}
M port/portfns.h => port/portfns.h +1 -0
@@ 9,6 9,7 @@ int anyhigher(void);
int anyready(void);
Image* attachimage(int, Chan*, ulong, ulong);
long authcheck(Chan*, char*, int);
+long authcheckread(Chan*, char*, int n);
void authclose(Chan*);
long authentread(Chan*, char*, int);
long authentwrite(Chan*, char*, int);