Add GS2 mech code
[cyrus-sasl.git] / include / saslplug.h
index b2cae16..ea5368e 100755 (executable)
@@ -255,9 +255,9 @@ typedef struct sasl_client_params {
 
     /* for additions which don't require a version upgrade; set to 0 */
     void *gss_creds;
-    void *chanbindingstype;
-    void *chanbindingsdata;
-    struct sasl_client_plug *plug;
+    void *chanbindingtype;
+    void *chanbindingdata;
+    void *spare_ptr4;
 
     /* Canonicalize a user name from on-wire to internal format
      *  added rjs3 2001-05-23
@@ -289,8 +289,12 @@ typedef struct sasl_client_params {
 
     int (*spare_fptr1)();
 
-    int chanbindingslen;
-    int spare_int2;
+#define SASL_CB_FLAG_NONE   0       /* client did not support CB */
+#define SASL_CB_FLAG_USED   1       /* client supports and used CB */
+#define SASL_CB_FLAG_WANT   2       /* client supports CB, thinks server does not */
+    int chanbindingflag;
+#define SASL_CB_PRESENT(params) ((params)->chanbindingtype != NULL && (params)->chanbindinglen)
+    int chanbindinglen;
     int spare_int3;
 
     /* flags field as passed to sasl_client_new */
@@ -331,6 +335,10 @@ typedef struct sasl_client_params {
 
 /* Underlying mechanism uses GSS framing */
 #define SASL_FEAT_GSS_FRAMING       0x0040
+
+/* Underlying mechanism supports channel binding */
+#define SASL_FEAT_CHANNEL_BINDING  0x0080
+
 /* client plug-in features */
 #define SASL_FEAT_NEEDSERVERFQDN 0x0001
 
@@ -460,8 +468,6 @@ LIBSASL_API int sasl_client_plugin_info (const char *mech_list,
 /* log message formatting routine */
 typedef void sasl_logmsg_p(sasl_conn_t *conn, const char *fmt, ...);
 
-struct sasl_server_plug;
-
 /*
  * input parameters to server SASL plugin
  *
@@ -555,13 +561,13 @@ typedef struct sasl_server_params {
 
     /* for additions which don't require a version upgrade; set to 0 */
     void *gss_creds;
-    void *chanbindingstype;
-    void *chanbindingsdata;
-    struct sasl_server_plug *plug;
+    void *chanbindingtype;
+    void *chanbindingdata;
+    void *spare_ptr4;
     int (*spare_fptr1)();
     int (*spare_fptr2)();
-    int chanbindingslen;
-    int spare_int2;
+    int chanbindingcrit;
+    int chanbindinglen;
     int spare_int3;
 
     /* flags field as passed to sasl_server_new */