Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature-vt/sys/src/libauthsrv/convT2M.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <u.h>
2
#include <libc.h>
3
#include <authsrv.h>
4
 
5
#define	CHAR(x)		*p++ = f->x
6
#define	SHORT(x)	p[0] = f->x; p[1] = f->x>>8; p += 2
7
#define	VLONG(q)	p[0] = (q); p[1] = (q)>>8; p[2] = (q)>>16; p[3] = (q)>>24; p += 4
8
#define	LONG(x)		VLONG(f->x)
9
#define	STRING(x,n)	memmove(p, f->x, n); p += n
10
 
11
int
12
convT2M(Ticket *f, char *ap, char *key)
13
{
14
	int n;
15
	uchar *p;
16
 
17
	p = (uchar*)ap;
18
	CHAR(num);
19
	STRING(chal, CHALLEN);
20
	STRING(cuid, ANAMELEN);
21
	STRING(suid, ANAMELEN);
22
	STRING(key, DESKEYLEN);
23
	n = p - (uchar*)ap;
24
	if(key)
25
		encrypt(key, ap, n);
26
	return n;
27
}