]> www.average.org Git - pam_pcsc_cr.git/blob - authobj.h
PAM module works
[pam_pcsc_cr.git] / authobj.h
1 #ifndef _AUTHOBJ_H
2 #define _AUTHOBJ_H
3
4 #define AUTHCHUNKSIZE 20
5
6 struct _auth_chunk {
7         const char *err;
8         unsigned char data[AUTHCHUNKSIZE];
9 };
10
11 struct _auth_obj {
12         unsigned char *buffer;  /* to be free()'d if not NULL */
13         const char *err;        /* non-NULL if failed */
14         unsigned char *data;
15         int datasize;
16         unsigned char *payload;
17         int paylsize;
18 };
19
20 /* Construct new or repack old authobj, return payload */
21 struct _auth_obj authobj(const char *userid, const char *password,
22                 const char *oldnonce, const char *newnonce,
23                 const unsigned char *secret, const int secsize,
24                 const unsigned char *payload, const int paysize,
25                 const unsigned char *ablob, const int blobsize,
26                 struct _auth_chunk (*fetch_key)(const unsigned char *chal,
27                                                 const int csize));
28
29 #endif