shithub: drawterm

Download patch

ref: 58bf8cb855d51859f11f4e1bc1f84feff1fd5b29
parent: 0594c6d178d64ccc70c3d781e869d126c32fb267
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Aug 6 13:47:38 EDT 2016

libauthsrv: ANAMELEN -> PASSWDLEN

--- a/include/authsrv.h
+++ b/include/authsrv.h
@@ -105,7 +105,7 @@
 	char	changesecret;
 	char	secret[SECRETLEN];	/* new secret */
 };
-#define	MAXPASSREQLEN	(12+2*ANAMELEN+1+SECRETLEN+16)
+#define	MAXPASSREQLEN	(12+2*PASSWDLEN+1+SECRETLEN+16)
 
 struct	OChapreply
 {
--- a/libauthsrv/convM2PR.c
+++ b/libauthsrv/convM2PR.c
@@ -12,13 +12,13 @@
 
 	memset(f, 0, sizeof(Passwordreq));
 	if(t->form == 0){
-		m = 1+2*ANAMELEN+1+SECRETLEN;
+		m = 1+2*PASSWDLEN+1+SECRETLEN;
 		if(n < m)
 			return -m;
 		memmove(buf, ap, m);
 		decrypt(t->key, buf, m);
 	} else {
-		m = 12+2*ANAMELEN+1+SECRETLEN+16;
+		m = 12+2*PASSWDLEN+1+SECRETLEN+16;
 		if(n < m)
 			return -m;
 		memmove(buf, ap, m);
@@ -27,12 +27,12 @@
 	}
 	p = buf;
 	f->num = *p++;
-	memmove(f->old, p, ANAMELEN), p += ANAMELEN;
-	memmove(f->new, p, ANAMELEN), p += ANAMELEN;
+	memmove(f->old, p, PASSWDLEN), p += PASSWDLEN;
+	memmove(f->new, p, PASSWDLEN), p += PASSWDLEN;
 	f->changesecret = *p++;
 	memmove(f->secret, p, SECRETLEN);
-	f->old[ANAMELEN-1] = 0;
-	f->new[ANAMELEN-1] = 0;
+	f->old[PASSWDLEN-1] = 0;
+	f->new[PASSWDLEN-1] = 0;
 	f->secret[SECRETLEN-1] = 0;
 
 	return m;
--- a/libauthsrv/convPR2M.c
+++ b/libauthsrv/convPR2M.c
@@ -9,13 +9,13 @@
 {
 	uchar *p;
 
-	if(n < 1+2*ANAMELEN+1+SECRETLEN)
+	if(n < 1+2*PASSWDLEN+1+SECRETLEN)
 		return 0;
 
 	p = (uchar*)ap;
 	*p++ = f->num;
-	memmove(p, f->old, ANAMELEN), p += ANAMELEN;
-	memmove(p, f->new, ANAMELEN), p += ANAMELEN;
+	memmove(p, f->old, PASSWDLEN), p += PASSWDLEN;
+	memmove(p, f->new, PASSWDLEN), p += PASSWDLEN;
 	*p++ = f->changesecret;
 	memmove(p, f->secret, SECRETLEN), p += SECRETLEN;
 	switch(t->form){
@@ -24,7 +24,7 @@
 		encrypt(t->key, ap, n);
 		return n;
 	case 1:
-		if(n < 12+2*ANAMELEN+1+SECRETLEN+16)
+		if(n < 12+2*PASSWDLEN+1+SECRETLEN+16)
 			return 0;
 		return form1B2M(ap, p - (uchar*)ap, t->key);
 	}