gsasl-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CVS gsasl/lib/src


From: gsasl-commit
Subject: CVS gsasl/lib/src
Date: Fri, 24 Sep 2004 02:31:09 +0200

Update of /home/cvs/gsasl/lib/src
In directory dopio:/tmp/cvs-serv7764/lib/src

Modified Files:
        common.c internal.h xstep.c 
Log Message:
Remove non-allocating step interface.


--- /home/cvs/gsasl/lib/src/common.c    2004/09/24 00:24:56     1.25
+++ /home/cvs/gsasl/lib/src/common.c    2004/09/24 00:31:09     1.26
@@ -42,11 +42,10 @@
     NULL,
     NULL,
     _gsasl_anonymous_client_start,
+    _gsasl_anonymous_client_step,
     NULL,
     NULL,
-    NULL,
-    NULL,
-    _gsasl_anonymous_client_step
+    NULL
 #endif
     },
    {
@@ -54,11 +53,10 @@
     NULL,
     NULL,
     _gsasl_anonymous_server_start,
+    _gsasl_anonymous_server_step,
     NULL,
     NULL,
-    NULL,
-    NULL,
-    _gsasl_anonymous_server_step
+    NULL
 #endif
     }
    },
@@ -71,11 +69,10 @@
     NULL,
     NULL,
     _gsasl_external_client_start,
+    _gsasl_external_client_step,
     NULL,
     NULL,
-    NULL,
-    NULL,
-    _gsasl_external_client_step
+    NULL
 #endif
     },
    {
@@ -83,11 +80,10 @@
     NULL,
     NULL,
     _gsasl_external_server_start,
+    _gsasl_external_server_step,
     NULL,
     NULL,
-    NULL,
-    NULL,
-    _gsasl_external_server_step
+    NULL
 #endif
     }
    },
@@ -100,11 +96,10 @@
     NULL,
     NULL,
     _gsasl_plain_client_start,
+    _gsasl_plain_client_step,
     NULL,
     NULL,
-    NULL,
-    NULL,
-    _gsasl_plain_client_step
+    NULL
 #endif
     },
    {
@@ -112,11 +107,10 @@
     NULL,
     NULL,
     _gsasl_plain_server_start,
+    _gsasl_plain_server_step,
     NULL,
     NULL,
-    NULL,
-    NULL,
-    _gsasl_plain_server_step
+    NULL
 #endif
     }
    },
@@ -129,11 +123,10 @@
     NULL,
     NULL,
     _gsasl_login_client_start,
-    NULL,
+    _gsasl_login_client_step,
     _gsasl_login_client_finish,
     NULL,
-    NULL,
-    _gsasl_login_client_step
+    NULL
 #endif
     },
    {
@@ -141,11 +134,10 @@
     NULL,
     NULL,
     _gsasl_login_server_start,
-    NULL,
+    _gsasl_login_server_step,
     _gsasl_login_server_finish,
     NULL,
-    NULL,
-    _gsasl_login_server_step
+    NULL
 #endif
     }
    },
@@ -158,11 +150,10 @@
     NULL,
     NULL,
     _gsasl_securid_client_start,
-    NULL,
+    _gsasl_securid_client_step,
     _gsasl_securid_client_finish,
     NULL,
-    NULL,
-    _gsasl_securid_client_step
+    NULL
 #endif
     },
    {
@@ -170,11 +161,10 @@
     NULL,
     NULL,
     _gsasl_securid_server_start,
+    _gsasl_securid_server_step,
     NULL,
     NULL,
-    NULL,
-    NULL,
-    _gsasl_securid_server_step
+    NULL
 #endif
     }
    },
@@ -187,11 +177,10 @@
     NULL,
     NULL,
     _gsasl_ntlm_client_start,
-    NULL,
+    _gsasl_ntlm_client_step,
     _gsasl_ntlm_client_finish,
     NULL,
-    NULL,
-    _gsasl_ntlm_client_step
+    NULL
 #endif
     },
    {
@@ -201,7 +190,6 @@
     NULL,
     NULL,
     NULL,
-    NULL,
     NULL}
    },
 #endif /* USE_NTLM */
@@ -213,11 +201,10 @@
     NULL,
     NULL,
     _gsasl_cram_md5_client_start,
+    _gsasl_cram_md5_client_step,
     NULL,
     NULL,
-    NULL,
-    NULL,
-    _gsasl_cram_md5_client_step
+    NULL
 #endif
     },
    {
@@ -225,11 +212,10 @@
     NULL,
     NULL,
     _gsasl_cram_md5_server_start,
-    NULL,
+    _gsasl_cram_md5_server_step,
     _gsasl_cram_md5_server_finish,
     NULL,
-    NULL,
-    _gsasl_cram_md5_server_step
+    NULL
 #endif
     }
    },
@@ -242,11 +228,10 @@
     NULL,
     NULL,
     _gsasl_digest_md5_client_start,
-    NULL,
+    _gsasl_digest_md5_client_step,
     _gsasl_digest_md5_client_finish,
     _gsasl_digest_md5_client_encode,
-    _gsasl_digest_md5_client_decode,
-    _gsasl_digest_md5_client_step
+    _gsasl_digest_md5_client_decode
 #endif
     },
    {
@@ -254,11 +239,10 @@
     NULL,
     NULL,
     _gsasl_digest_md5_server_start,
-    NULL,
+    _gsasl_digest_md5_server_step,
     _gsasl_digest_md5_server_finish,
     _gsasl_digest_md5_server_encode,
-    _gsasl_digest_md5_server_decode,
-    _gsasl_digest_md5_server_step
+    _gsasl_digest_md5_server_decode
 #endif
     }
    },
@@ -300,11 +284,10 @@
     NULL,
     NULL,
     _gsasl_gssapi_client_start,
-    NULL,
+    _gsasl_gssapi_client_step,
     _gsasl_gssapi_client_finish,
     _gsasl_gssapi_client_encode,
     _gsasl_gssapi_client_decode,
-    _gsasl_gssapi_client_step
 #endif
     },
    {
@@ -316,7 +299,6 @@
     _gsasl_gssapi_server_finish,
     NULL,
     NULL,
-    NULL
 #endif
     }
    },
@@ -329,7 +311,6 @@
     NULL,
     NULL,
     NULL,
-    NULL,
     NULL},
    {
     NULL,
@@ -338,7 +319,6 @@
     NULL,
     NULL,
     NULL,
-    NULL,
     NULL}
    }
 };
--- /home/cvs/gsasl/lib/src/internal.h  2004/09/23 00:49:14     1.14
+++ /home/cvs/gsasl/lib/src/internal.h  2004/09/24 00:31:09     1.15
@@ -42,17 +42,13 @@
 typedef int (*_Gsasl_step_function) (Gsasl_session * sctx,
                                     void *mech_data,
                                     const char *input, size_t input_len,
-                                    char *output, size_t * output_len);
+                                    char **output, size_t * output_len);
 typedef int (*_Gsasl_finish_function) (Gsasl_session * sctx, void *mech_data);
 typedef int (*_Gsasl_code_function) (Gsasl_session * sctx,
                                     void *mech_data,
                                     const char *input, size_t input_len,
                                     char **output, size_t * output_len);
 
-typedef int (*_Gsasl_step_function_a) (Gsasl_session * sctx, void *mech_data,
-                                      const char *input, size_t input_len,
-                                      char **output, size_t * output_len);
-
 /* Collection of mechanism functions for either client or server. */
 struct _Gsasl_mechanism_functions
 {
@@ -63,8 +59,6 @@
   _Gsasl_finish_function finish;
   _Gsasl_code_function encode;
   _Gsasl_code_function decode;
-  /* New allocating interface. */
-  _Gsasl_step_function_a astep;
 };
 
 /* Information about a mechanism. */
--- /home/cvs/gsasl/lib/src/xstep.c     2004/09/18 17:35:24     1.4
+++ /home/cvs/gsasl/lib/src/xstep.c     2004/09/24 00:31:09     1.5
@@ -51,45 +51,16 @@
            char **output, size_t * output_len)
 {
   _Gsasl_step_function step;
-  _Gsasl_step_function_a astep;
-  int res;
 
   if (sctx == NULL)
     return GSASL_INVALID_HANDLE;
 
   if (sctx->clientp)
-    {
-      step = sctx->mech->client.step;
-      astep = sctx->mech->client.astep;
-    }
+    step = sctx->mech->client.step;
   else
-    {
-      step = sctx->mech->server.step;
-      astep = sctx->mech->server.astep;
-    }
+    step = sctx->mech->server.step;
 
-  if (astep)
-    {
-      res = astep (sctx, sctx->mech_data,
-                  input, input_len, output, output_len);
-    }
-  else
-    {
-      /* XXX once all mechanisms uses the "astep" interface, this will
-         go away. */
-      *output_len = 1000;
-      *output = malloc (*output_len);
-      if (*output == NULL)
-       return GSASL_MALLOC_ERROR;
-
-      res = step (sctx, sctx->mech_data,
-                 input, input_len, *output, output_len);
-
-      if (res != GSASL_OK && res != GSASL_NEEDS_MORE)
-       free (*output);
-    }
-
-  return res;
+  return step (sctx, sctx->mech_data, input, input_len, output, output_len);
 }
 
 /**





reply via email to

[Prev in Thread] Current Thread [Next in Thread]