Move util_ files into utils directory, move main.cpp into src
[gssweb.git] / json_gssapi / src / commands / GSSInitSecContext.cpp
index c2c93c7..c0112ba 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#include "util_base64.h"
-
-typedef OM_uint32 (*init_sec_context)(
-    OM_uint32 *,        /* minor_status */
-    gss_cred_id_t,      /* claimant_cred_handle */
-    gss_ctx_id_t *,     /* context_handle */
-    gss_name_t,         /* target_name */
-    gss_OID,            /* mech_type (used to be const) */
-    OM_uint32,          /* req_flags */
-    OM_uint32,          /* time_req */
-    gss_channel_bindings_t,     /* input_chan_bindings */
-    gss_buffer_t,       /* input_token */
-    gss_OID *,          /* actual_mech_type */
-    gss_buffer_t,       /* output_token */
-    OM_uint32 *,        /* ret_flags */
-    OM_uint32 *         /* time_req */
-);
+#include "utils/util_base64.h"
 
 void
 GSSInitSecContext::execute()
 {
   /* Variables */
-  init_sec_context fn = (init_sec_context)function;
   gss_OID actual_mech_type;
   
   /* Error checking */
@@ -76,7 +59,7 @@ GSSInitSecContext::execute()
 
   /* Main */
   // MRW -- fix so that this uses all of the vars from the object 
-  retVal = fn(
+  retVal = function(
     &minor_status,
     GSS_C_NO_CREDENTIAL,
     &context_handle,
@@ -207,11 +190,11 @@ bool GSSInitSecContext::loadParameters(JSONObject *params)
   
   // req_flags
   if (!params->get("req_flags").isNull() )
-    this->req_flags = params->get("req_flags").integer();
+    this->req_flags = (OM_uint32 )params->get("req_flags").integer();
 
   // time_req
   if (!params->get("time_req").isNull() )
-    this->time_req = params->get("time_req").integer();
+    this->time_req = (OM_uint32 )params->get("time_req").integer();
 
   // input_token
   if (! (params->get("input_token").isNull() ||
@@ -308,14 +291,14 @@ JSONObject *GSSInitSecContext::toJSON()
 
 GSSInitSecContext::GSSInitSecContext(
   JSONObject *params, 
-  void *fn)
+  init_sec_context_type fn)
 {
   zeroOut(false);
   loadParameters(params);
   function = fn;
 }
 
-GSSInitSecContext::GSSInitSecContext(void *fn)
+GSSInitSecContext::GSSInitSecContext(init_sec_context_type fn)
 {
   zeroOut(false);
   function = fn;