From 4180d05ba41196e0633252de26750bb19f3a6da8 Mon Sep 17 00:00:00 2001 From: rsc Date: Thu, 17 Jun 2004 03:28:08 +0000 Subject: these do work --- src/libauthsrv/convM2PR.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/libauthsrv/convM2PR.c (limited to 'src/libauthsrv/convM2PR.c') diff --git a/src/libauthsrv/convM2PR.c b/src/libauthsrv/convM2PR.c new file mode 100644 index 00000000..21df5b50 --- /dev/null +++ b/src/libauthsrv/convM2PR.c @@ -0,0 +1,28 @@ +#include +#include +#include + +#define CHAR(x) f->x = *p++ +#define SHORT(x) f->x = (p[0] | (p[1]<<8)); p += 2 +#define VLONG(q) q = (p[0] | (p[1]<<8) | (p[2]<<16) | (p[3]<<24)); p += 4 +#define LONG(x) VLONG(f->x) +#define STRING(x,n) memmove(f->x, p, n); p += n + +void +convM2PR(char *ap, Passwordreq *f, char *key) +{ + uchar *p; + + p = (uchar*)ap; + if(key) + decrypt(key, ap, PASSREQLEN); + CHAR(num); + STRING(old, ANAMELEN); + f->old[ANAMELEN-1] = 0; + STRING(new, ANAMELEN); + f->new[ANAMELEN-1] = 0; + CHAR(changesecret); + STRING(secret, SECRETLEN); + f->secret[SECRETLEN-1] = 0; + USED(p); +} -- cgit v1.2.3