aboutsummaryrefslogtreecommitdiffstats
path: root/include/sasl.h
blob: 82b492fe7a68e9dabdea9f3dc4b755bc9580910d (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 * Copyright (c) 2006 Atheme Development Group
 * Rights to this code are as documented in doc/LICENSE.
 *
 * Data structures for SASL plugin use.
 *
 */

#ifndef SASL_H
#define SASL_H

typedef struct sasl_session_ sasl_session_t;
typedef struct sasl_message_ sasl_message_t;
typedef struct sasl_mechanism_ sasl_mechanism_t;

struct sasl_session_ {
  char uid[IDLEN];
  char *buf, *p;
  int len, flags;

  struct sasl_mechanism_ *mechptr;
  void *mechdata;

  char *username;
};

struct sasl_message_ {
  char *uid;
  char mode;
  char *buf;
};

struct sasl_mechanism_ {
  char name[21];
  int (*mech_start) (struct sasl_session_ *sptr, char **buffer, int *buflen);
  int (*mech_step) (struct sasl_session_ *sptr, char *message, int length, char **buffer, int *buflen);
  void (*mech_finish) (struct sasl_session_ *sptr);
};

#define ASASL_FAIL 0 /* client supplied invalid credentials / screwed up their formatting */
#define ASASL_MORE 1 /* everything looks good so far, but we're not done yet */
#define ASASL_DONE 2 /* client successfully authenticated */

#define ASASL_MARKED_FOR_DELETION   1 /* see delete_stale() in saslserv/main.c */
#define ASASL_NEED_LOG              2 /* user auth success needs to be logged still */

#endif

/* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
 * vim:ts=8
 * vim:sw=8
 * vim:noexpandtab
 */