| 1 |
pippijn |
1.1 |
/* |
| 2 |
|
|
* Copyright © 2006 Atheme Development Group |
| 3 |
pippijn |
1.2 |
* Rights to this code are as documented in doc/pod/license.pod. |
| 4 |
pippijn |
1.1 |
* |
| 5 |
|
|
* Data structures for SASL plugin use. |
| 6 |
|
|
* |
| 7 |
pippijn |
1.2 |
* $Id: sasl.h,v 1.1 2007-07-19 08:24:50 pippijn Exp $ |
| 8 |
pippijn |
1.1 |
*/ |
| 9 |
|
|
|
| 10 |
|
|
#ifndef SASL_H |
| 11 |
|
|
#define SASL_H |
| 12 |
|
|
|
| 13 |
|
|
struct sasl_mechanism_t; |
| 14 |
|
|
|
| 15 |
|
|
struct sasl_session_t |
| 16 |
|
|
{ |
| 17 |
|
|
char uid[IDLEN]; |
| 18 |
|
|
char *buf, *p; |
| 19 |
|
|
int len, flags; |
| 20 |
|
|
|
| 21 |
|
|
sasl_mechanism_t *mechptr; |
| 22 |
|
|
void *mechdata; |
| 23 |
|
|
|
| 24 |
|
|
char *username; |
| 25 |
|
|
}; |
| 26 |
|
|
|
| 27 |
|
|
struct sasl_message_t |
| 28 |
|
|
{ |
| 29 |
|
|
char *uid; |
| 30 |
|
|
char mode; |
| 31 |
|
|
char *buf; |
| 32 |
|
|
}; |
| 33 |
|
|
|
| 34 |
|
|
struct sasl_mechanism_t |
| 35 |
|
|
{ |
| 36 |
|
|
char name[21]; |
| 37 |
|
|
int (*mech_start) (sasl_session_t *sptr, char **buffer, int *buflen); |
| 38 |
|
|
int (*mech_step) (sasl_session_t *sptr, char *message, int length, char **buffer, int *buflen); |
| 39 |
|
|
void (*mech_finish) (sasl_session_t *sptr); |
| 40 |
|
|
}; |
| 41 |
|
|
|
| 42 |
|
|
#define ASASL_FAIL 0 /* client supplied invalid credentials / screwed up their formatting */ |
| 43 |
|
|
#define ASASL_MORE 1 /* everything looks good so far, but we're not done yet */ |
| 44 |
|
|
#define ASASL_DONE 2 /* client successfully authenticated */ |
| 45 |
|
|
|
| 46 |
|
|
#define ASASL_MARKED_FOR_DELETION 1 /* see delete_stale() in saslserv/main.c */ |
| 47 |
|
|
#define ASASL_NEED_LOG 2 /* user auth success needs to be logged still */ |
| 48 |
|
|
|
| 49 |
|
|
#endif |