summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-08-19 21:06:17 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-08-19 21:06:17 +0200
commit02cfcfeab46f36aad95263ed40d19df7bd5eddef (patch)
tree30f67204be8d474b2c761e8944c20d042df1a08b /sys/include
parentf785d4da07349c7bb250eb00a3f2bed3eb170828 (diff)
libauthsrv: generalize ticket service, not hardcoding ticket format and DES encryption
this is in preparation for replacing DES ticket encryption with something better. but first need to make the code stop making assumptions. the wire encoding of the Ticket might be variable length with TICKETLEN just giving an upper bound. the details will be handled by libauthsrv _asgetticket() and _asgetresp() funciotns. the Authenticator and Passwordreq structures are encrypted with the random ticket key. The encryption schmeme will depend on the Ticket format used, so we pass the Ticket* structure instead of the DES key. introduce Authkey structure that will hold all the required cryptographic keys instead of passing DES key.
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/authsrv.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/sys/include/authsrv.h b/sys/include/authsrv.h
index 9de941f3f..d8fbf36bc 100644
--- a/sys/include/authsrv.h
+++ b/sys/include/authsrv.h
@@ -12,6 +12,8 @@ typedef struct Passwordreq Passwordreq;
typedef struct OChapreply OChapreply;
typedef struct OMSchapreply OMSchapreply;
+typedef struct Authkey Authkey;
+
enum
{
ANAMELEN= 28, /* name max size in previous proto */
@@ -110,22 +112,27 @@ struct OMSchapreply
};
#define OMSCHAPREPLYLEN (ANAMELEN+24+24)
+struct Authkey
+{
+ char des[DESKEYLEN];
+};
+
/*
* convert to/from wire format
*/
-extern int convT2M(Ticket*, char*, char*);
-extern void convM2T(char*, Ticket*, char*);
-extern int convA2M(Authenticator*, char*, char*);
-extern void convM2A(char*, Authenticator*, char*);
-extern int convTR2M(Ticketreq*, char*);
-extern void convM2TR(char*, Ticketreq*);
-extern int convPR2M(Passwordreq*, char*, char*);
-extern void convM2PR(char*, Passwordreq*, char*);
+extern int convT2M(Ticket*, char*, int, Authkey*);
+extern int convM2T(char*, int, Ticket*, Authkey*);
+extern int convA2M(Authenticator*, char*, int, Ticket*);
+extern int convM2A(char*, int, Authenticator*, Ticket*);
+extern int convTR2M(Ticketreq*, char*, int);
+extern int convM2TR(char*, int, Ticketreq*);
+extern int convPR2M(Passwordreq*, char*, int, Ticket*);
+extern int convM2PR(char*, int, Passwordreq*, Ticket*);
/*
* convert ascii password to DES key
*/
-extern int passtokey(char*, char*);
+extern int passtokey(Authkey*, char*);
/*
* Nvram interface
@@ -167,5 +174,7 @@ extern int authdial(char *netroot, char *authdom);
/*
* exchange messages with auth server
*/
-extern int _asgetticket(int, char*, char*);
+extern int _asgetticket(int, Ticketreq*, char*, int);
+extern int _asrequest(int, Ticketreq*);
+extern int _asgetresp(int, Ticket*, Authenticator*, Authkey *);
extern int _asrdresp(int, char*, int);