~ubuntu-branches/ubuntu/oneiric/jabberd2/oneiric-security

« back to all changes in this revision

Viewing changes to sx/sasl.h

  • Committer: Bazaar Package Importer
  • Author(s): Nicolai Spohrer
  • Date: 2008-08-12 16:13:43 UTC
  • mfrom: (1.1.3 upstream) (0.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20080812161343-6trz3r97dtevxd17
Tags: 2.2.1-1ubuntu1
* Merge with Debian unstable (LP: #257130), remaining changes:
  - debian/control:
    + Modify Maintainer field as per spec
    + Depend on libdb4.6-dev instead of libdb4.4-dev
    + Added Conflicts and Replaces: ..., jabber for jabberd2
  - debian/rules: Added libtoolize call (jabberd2 ships with
     an older ltmain.sh version that conflicts with the
     current libtool version)
  - debian/init: create /var/run/jabber directory with correct
     permissions
* Dropped changes:
  - Debian already depends on libpq-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef INCL_SX_SASL_H
22
22
#define INCL_SX_SASL_H
23
23
 
24
 
#include "sx.h"
25
 
 
26
 
#include "scod/scod.h"
27
 
 
28
 
#ifdef __cplusplus
29
 
extern "C" {
30
 
#endif
31
 
 
32
 
/** init function */
33
 
int                         sx_sasl_init(sx_env_t env, sx_plugin_t p, va_list args);
34
 
 
35
 
/** server init flag, don't offer sasl without this */
36
 
#define SX_SASL_OFFER       (1<<3)
37
 
 
38
 
/* mechanisms to offer */
39
 
#define SX_SASL_MECH_ANONYMOUS  (1<<4)
40
 
#define SX_SASL_MECH_PLAIN      (1<<5)
41
 
#define SX_SASL_MECH_DIGESTMD5  (1<<6)
42
 
 
43
 
/** the callback function */
44
 
typedef int                 (*sx_sasl_callback_t)(int cb, void *arg, void **res, scod_t sd, void *cbarg);
45
 
 
46
 
/* callbacks */
47
 
#define sx_sasl_cb_GET_REALM        (0x00)
48
 
#define sx_sasl_cb_GET_PASS         (0x01)
49
 
#define sx_sasl_cb_CHECK_PASS       (0x02)
50
 
#define sx_sasl_cb_CHECK_AUTHZID    (0x03)
51
 
#define sx_sasl_cb_GEN_AUTHZID      (0x04)
52
 
 
53
 
/** trigger for client auth */
54
 
int                         sx_sasl_auth(sx_plugin_t p, sx_t s, char *mech, char *user, char *pass, char *authzid);
55
 
 
56
 
/** our context */
57
 
typedef struct _sx_sasl_st {
58
 
    scod_ctx_t                  scod_ctx;
59
 
 
60
 
    sx_sasl_callback_t          cb;
61
 
    void                        *cbarg;
62
 
 
63
 
    int                         flags;
64
 
} *_sx_sasl_t;
65
 
 
66
 
/** magic number of the ssl plugin, must match SX_SSL_MAGIC in sx/ssl.h */
67
 
#define SX_SASL_SSL_MAGIC       (0x01)
68
 
 
69
 
#ifdef __cplusplus
70
 
}
71
 
#endif
 
24
/* RFC 3290 defines a number of failure messages */
 
25
#define _sasl_err_ABORTED               "aborted"
 
26
#define _sasl_err_INCORRECT_ENCODING    "incorrect-encoding"
 
27
#define _sasl_err_INVALID_AUTHZID       "invalid-authzid"
 
28
#define _sasl_err_INVALID_MECHANISM     "invalid-mechanism"
 
29
#define _sasl_err_MALFORMED_REQUEST     "malformed-request"
 
30
#define _sasl_err_MECH_TOO_WEAK         "mechanism-too-weak"
 
31
#define _sasl_err_NOT_AUTHORIZED        "not-authorized"
 
32
#define _sasl_err_TEMPORARY_FAILURE     "temporary-auth-failure"
72
33
 
73
34
#endif