more work on CB
[cyrus-sasl.git] / include / saslplug.h
index fecb7de..c114cb6 100755 (executable)
@@ -198,7 +198,7 @@ typedef struct sasl_out_params {
     void *spare_ptr4;
     int (*spare_fptr1)();
     int (*spare_fptr2)();
-    int spare_int1;
+    int chanbindingflag;
     int spare_int2;
     int spare_int3;
     int spare_int4;
@@ -255,8 +255,8 @@ typedef struct sasl_client_params {
 
     /* for additions which don't require a version upgrade; set to 0 */
     void *gss_creds;
-    void *spare_ptr2;
-    void *spare_ptr3;
+    void *chanbindingtype;
+    void *chanbindingdata;
     void *spare_ptr4;
 
     /* Canonicalize a user name from on-wire to internal format
@@ -289,8 +289,13 @@ typedef struct sasl_client_params {
 
     int (*spare_fptr1)();
 
-    int spare_int1;
-    int spare_int2;
+#define SASL_CB_FLAG_NONE   0x00    /* client did not support CB */
+#define SASL_CB_FLAG_USED   0x01    /* client supports CB, thinks server does not */
+#define SASL_CB_FLAG_WANT   0x02    /* client supports and used CB */
+#define SASL_CB_FLAG_CRIT   0x10    /* client requires CB */
+    int chanbindingflags;
+#define SASL_CB_PRESENT(params) ((params)->chanbindingtype != NULL && (params)->chanbindinglen)
+    int chanbindinglen;
     int spare_int3;
 
     /* flags field as passed to sasl_client_new */
@@ -329,6 +334,12 @@ typedef struct sasl_client_params {
 /* This plugin allows proxying */
 #define SASL_FEAT_ALLOWS_PROXY 0x0020
 
+/* 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
 
@@ -551,13 +562,13 @@ typedef struct sasl_server_params {
 
     /* for additions which don't require a version upgrade; set to 0 */
     void *gss_creds;
-    void *spare_ptr2;
-    void *spare_ptr3;
+    void *chanbindingtype;
+    void *chanbindingdata;
     void *spare_ptr4;
     int (*spare_fptr1)();
     int (*spare_fptr2)();
-    int spare_int1;
-    int spare_int2;
+    int chanbindinglen;
+    int chanbindingcrit;
     int spare_int3;
 
     /* flags field as passed to sasl_server_new */