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.
This commit is contained in:
parent
f785d4da07
commit
02cfcfeab4
47 changed files with 471 additions and 482 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue