History

libauthsrv: ANAMELEN -> PASSWDLEN

cinap_lenrek committed 10 years ago

Commit 08bd11c1 parent 0a4c2983 files · +11 −11Browse files

Unified · Split

3 files
  1. include/authsrv.h +1 −1
  2. libauthsrv/convM2PR.c +6 −6
  3. libauthsrv/convPR2M.c +4 −4
include/authsrv.h+1−1
@@ -105,7 +105,7 @@ struct Passwordreq · 104 unmodified lines
105 char changesecret;105 char changesecret;
106 char secret[SECRETLEN]; /* new secret */106 char secret[SECRETLEN]; /* new secret */
107};107};
108#define MAXPASSREQLEN (12+2*ANAMELEN+1+SECRETLEN+16)108#define MAXPASSREQLEN (12+2*PASSWDLEN+1+SECRETLEN+16)
109 109
110struct OChapreply110struct OChapreply
111{111{
libauthsrv/convM2PR.c+6−6
@@ -12,13 +12,13 @@ convM2PR(char *ap, int n, Passwordreq *f, Ticket *t) · 11 unmodified lines
12 12
13 memset(f, 0, sizeof(Passwordreq));13 memset(f, 0, sizeof(Passwordreq));
14 if(t->form == 0){14 if(t->form == 0){
15 m = 1+2*ANAMELEN+1+SECRETLEN;15 m = 1+2*PASSWDLEN+1+SECRETLEN;
16 if(n < m)16 if(n < m)
17 return -m;17 return -m;
18 memmove(buf, ap, m);18 memmove(buf, ap, m);
19 decrypt(t->key, buf, m);19 decrypt(t->key, buf, m);
20 } else {20 } else {
21 m = 12+2*ANAMELEN+1+SECRETLEN+16;21 m = 12+2*PASSWDLEN+1+SECRETLEN+16;
22 if(n < m)22 if(n < m)
23 return -m;23 return -m;
24 memmove(buf, ap, m);24 memmove(buf, ap, m);
@@ -27,12 +27,12 @@ convM2PR(char *ap, int n, Passwordreq *f, Ticket *t) · 2 unmodified lines
27 }27 }
28 p = buf;28 p = buf;
29 f->num = *p++;29 f->num = *p++;
30 memmove(f->old, p, ANAMELEN), p += ANAMELEN;30 memmove(f->old, p, PASSWDLEN), p += PASSWDLEN;
31 memmove(f->new, p, ANAMELEN), p += ANAMELEN;31 memmove(f->new, p, PASSWDLEN), p += PASSWDLEN;
32 f->changesecret = *p++;32 f->changesecret = *p++;
33 memmove(f->secret, p, SECRETLEN);33 memmove(f->secret, p, SECRETLEN);
34 f->old[ANAMELEN-1] = 0;34 f->old[PASSWDLEN-1] = 0;
35 f->new[ANAMELEN-1] = 0;35 f->new[PASSWDLEN-1] = 0;
36 f->secret[SECRETLEN-1] = 0;36 f->secret[SECRETLEN-1] = 0;
37 37
38 return m;38 return m;
libauthsrv/convPR2M.c+4−4
@@ -9,13 +9,13 @@ convPR2M(Passwordreq *f, char *ap, int n, Ticket *t) · 8 unmodified lines
9{9{
10 uchar *p;10 uchar *p;
11 11
12 if(n < 1+2*ANAMELEN+1+SECRETLEN)12 if(n < 1+2*PASSWDLEN+1+SECRETLEN)
13 return 0;13 return 0;
14 14
15 p = (uchar*)ap;15 p = (uchar*)ap;
16 *p++ = f->num;16 *p++ = f->num;
17 memmove(p, f->old, ANAMELEN), p += ANAMELEN;17 memmove(p, f->old, PASSWDLEN), p += PASSWDLEN;
18 memmove(p, f->new, ANAMELEN), p += ANAMELEN;18 memmove(p, f->new, PASSWDLEN), p += PASSWDLEN;
19 *p++ = f->changesecret;19 *p++ = f->changesecret;
20 memmove(p, f->secret, SECRETLEN), p += SECRETLEN;20 memmove(p, f->secret, SECRETLEN), p += SECRETLEN;
21 switch(t->form){21 switch(t->form){
@@ -24,7 +24,7 @@ convPR2M(Passwordreq *f, char *ap, int n, Ticket *t) · 2 unmodified lines
24 encrypt(t->key, ap, n);24 encrypt(t->key, ap, n);
25 return n;25 return n;
26 case 1:26 case 1:
27 if(n < 12+2*ANAMELEN+1+SECRETLEN+16)27 if(n < 12+2*PASSWDLEN+1+SECRETLEN+16)
28 return 0;28 return 0;
29 return form1B2M(ap, p - (uchar*)ap, t->key);29 return form1B2M(ap, p - (uchar*)ap, t->key);
30 }30 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t