cleanup, put backreference to SASL plug in library
authorLuke Howard <lukeh@padl.com>
Sat, 25 Sep 2010 22:40:27 +0000 (00:40 +0200)
committerLuke Howard <lukeh@padl.com>
Sat, 25 Sep 2010 22:40:27 +0000 (00:40 +0200)
include/sasl.h
include/saslplug.h
lib/client.c
lib/server.c

index 927888a..991f5d6 100755 (executable)
@@ -301,8 +301,7 @@ typedef unsigned sasl_ssf_t;
 #define SASL_SEC_PASS_CREDENTIALS 0x0020
 #define SASL_SEC_MUTUAL_AUTH      0x0040
 #define SASL_SEC_CHANNEL_BINDINGS 0x0080
-#define SASL_SEC_GSS_FRAMING      0x0100
-#define SASL_SEC_MAXIMUM          0x01FF
+#define SASL_SEC_MAXIMUM          0x00FF
 
 typedef struct sasl_security_properties 
 { 
index efadbc9..b2cae16 100755 (executable)
@@ -257,7 +257,7 @@ typedef struct sasl_client_params {
     void *gss_creds;
     void *chanbindingstype;
     void *chanbindingsdata;
-    void *spare_ptr4;
+    struct sasl_client_plug *plug;
 
     /* Canonicalize a user name from on-wire to internal format
      *  added rjs3 2001-05-23
@@ -329,6 +329,8 @@ 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
 /* client plug-in features */
 #define SASL_FEAT_NEEDSERVERFQDN 0x0001
 
@@ -458,6 +460,8 @@ 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
  *
@@ -553,7 +557,7 @@ typedef struct sasl_server_params {
     void *gss_creds;
     void *chanbindingstype;
     void *chanbindingsdata;
-    void *spare_ptr4;
+    struct sasl_server_plug *plug;
     int (*spare_fptr1)();
     int (*spare_fptr2)();
     int chanbindingslen;
index 9fdcf46..91c2e2d 100644 (file)
@@ -652,6 +652,7 @@ int sasl_client_step(sasl_conn_t *conn,
   if(clientoutlen) *clientoutlen = 0;
 
   /* do a step */
+  c_conn->cparams->plug = c_conn->mech->m.plug;
   result = c_conn->mech->m.plug->mech_step(conn->context,
                                         c_conn->cparams,
                                         serverin,
@@ -660,6 +661,7 @@ int sasl_client_step(sasl_conn_t *conn,
                                         clientout, clientoutlen,
                                         &conn->oparams);
 
+  c_conn->cparams->plug = NULL;
   if (result == SASL_OK) {
       /* So we're done on this end, but if both
        * 1. the mech does server-send-last
index 1533c10..59c61ff 100644 (file)
@@ -1427,6 +1427,7 @@ int sasl_server_step(sasl_conn_t *conn,
     if(serverout) *serverout = NULL;
     if(serveroutlen) *serveroutlen = 0;
 
+    s_conn->sparams->plug = s_conn->mech->m.plug;
     ret = s_conn->mech->m.plug->mech_step(conn->context,
                                        s_conn->sparams,
                                        clientin,
@@ -1435,10 +1436,12 @@ int sasl_server_step(sasl_conn_t *conn,
                                        serveroutlen,
                                        &conn->oparams);
 
+    s_conn->sparams->plug = NULL;
     if (ret == SASL_OK) {
        ret = do_authorization(s_conn);
     }
 
+
     if (ret == SASL_OK) {
        /* if we're done, we need to watch out for the following:
         * 1. the mech does server-send-last