]> www.average.org Git - pam_pcsc_cr.git/blob - authobj.h
wip in new authobj interface
[pam_pcsc_cr.git] / authobj.h
1 #ifndef _AUTHOBJ_H
2 #define _AUTHOBJ_H
3
4 struct _auth_obj {
5         unsigned char *buffer;  /* to be free()'d if not NULL */
6         const char *err;        /* non-NULL if failed */
7         unsigned char *data;
8         int datasize;
9         unsigned char *payload;
10         int paylsize;
11 };
12
13 /* Construct new authobj from the given secret and other data */
14 struct _auth_obj new_authobj(const char *userid, const char *password,
15                                 const char *nonce,
16                         const unsigned char *secret, const int secsize,
17                         const unsigned char *payload, const int paysize);
18
19 /* Unwrap old authobj, extract payload, construct new one with newnonce */
20 struct _auth_obj verify_authobj(const char *userid, const char *password,
21                                 const char *oldnonce, const char *newnonce,
22                         const unsigned char *authobj, const int authsize);
23
24 /* Unwrap old authobj, replace the payload, construct new one with newnonce */
25 struct _auth_obj reload_authobj(const char *userid, const char *password,
26                                 const char *oldnonce, const char *newnonce,
27                         const unsigned char *authobj, const int authsize,
28                         const unsigned char *payload, const int paysize);
29
30 #endif