Commit 2af02878 authored by Julien Chaffraix's avatar Julien Chaffraix
Browse files

gssapi.c: Simplified the function.

Removed the parameters that were common to all our invocation.
parent 20485a48
Loading
Loading
Loading
Loading
+8 −13
Original line number Diff line number Diff line
@@ -24,30 +24,25 @@

OM_uint32 Curl_gss_init_sec_context(
    OM_uint32 * minor_status,
    gss_cred_id_t cred_handle,
    gss_ctx_id_t * context,
    gss_name_t target_name,
    gss_OID mech_type, /* needed? */
    OM_uint32 req_flags,          /* TBR. */
    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_rec)
    OM_uint32 * ret_flags)
{
  return gss_init_sec_context(minor_status,
                              cred_handle,
                              GSS_C_NO_CREDENTIAL, /* cred_handle */
                              context,
                              target_name,
                              mech_type,
                              req_flags,
                              time_req,
                              GSS_C_NO_OID, /* mech_type */
                              /* req_flags */
                              GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG,
                              0, /* time_req */
                              input_chan_bindings,
                              input_token,
                              actual_mech_type,
                              NULL, /* actual_mech_type */
                              output_token,
                              ret_flags,
                              time_rec);
                              NULL /* time_rec */);
}
+4 −10
Original line number Diff line number Diff line
@@ -39,15 +39,9 @@

OM_uint32 Curl_gss_init_sec_context(
    OM_uint32 * minor_status,
    gss_cred_id_t cred_handle,
    gss_ctx_id_t * context,
    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_rec */
    gss_channel_bindings_t input_chan_bindings,
    gss_buffer_t input_token,
    gss_buffer_t output_token,
    OM_uint32 * ret_flags);
+0 −7
Original line number Diff line number Diff line
@@ -240,18 +240,11 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy,
  }

  major_status = Curl_gss_init_sec_context(&minor_status,
                                           GSS_C_NO_CREDENTIAL,
                                           &neg_ctx->context,
                                           neg_ctx->server_name,
                                           GSS_C_NO_OID,
                                           GSS_C_MUTUAL_FLAG
                                           | GSS_C_REPLAY_FLAG,
                                           0,
                                           GSS_C_NO_CHANNEL_BINDINGS,
                                           &input_token,
                                           NULL,
                                           &output_token,
                                           NULL,
                                           NULL);
  if(input_token.length > 0)
    gss_release_buffer(&minor_status2, &input_token);
+0 −6
Original line number Diff line number Diff line
@@ -232,17 +232,11 @@ krb5_auth(void *app_data, struct connectdata *conn)
      gss_release_buffer(&min, &output_buffer);
      ret = AUTH_OK;
      maj = Curl_gss_init_sec_context(&min,
                                      GSS_C_NO_CREDENTIAL,
                                      context,
                                      gssname,
                                      GSS_C_NO_OID,
                                      GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG,
                                      0,
                                      &chan,
                                      gssresp,
                                      NULL,
                                      &output_buffer,
                                      NULL,
                                      NULL);

      if(gssresp) {
+3 −9
Original line number Diff line number Diff line
@@ -185,18 +185,12 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
  /* errors, keep sending it...                                            */
  for(;;) {
    gss_major_status = Curl_gss_init_sec_context(&gss_minor_status,
                                                 GSS_C_NO_CREDENTIAL,
                                                 &gss_context, server,
                                                 GSS_C_NULL_OID,
                                                 GSS_C_MUTUAL_FLAG |
                                                 GSS_C_REPLAY_FLAG,
                                                 0,
                                                 &gss_context,
                                                 server,
                                                 NULL,
                                                 gss_token,
                                                 NULL,
                                                 &gss_send_token,
                                                 &gss_ret_flags,
                                                 NULL);
                                                 &gss_ret_flags);

    if(gss_token != GSS_C_NO_BUFFER)
      gss_release_buffer(&gss_status, &gss_recv_token);