summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/gssapi/spnego
diff options
context:
space:
mode:
Diffstat (limited to 'source4/heimdal/lib/gssapi/spnego')
-rw-r--r--source4/heimdal/lib/gssapi/spnego/accept_sec_context.c12
-rw-r--r--source4/heimdal/lib/gssapi/spnego/compat.c11
-rw-r--r--source4/heimdal/lib/gssapi/spnego/context_stubs.c54
-rw-r--r--source4/heimdal/lib/gssapi/spnego/cred_stubs.c16
-rw-r--r--source4/heimdal/lib/gssapi/spnego/external.c4
-rw-r--r--source4/heimdal/lib/gssapi/spnego/init_sec_context.c3
6 files changed, 52 insertions, 48 deletions
diff --git a/source4/heimdal/lib/gssapi/spnego/accept_sec_context.c b/source4/heimdal/lib/gssapi/spnego/accept_sec_context.c
index ab8a4d1aac..35bc56fbb7 100644
--- a/source4/heimdal/lib/gssapi/spnego/accept_sec_context.c
+++ b/source4/heimdal/lib/gssapi/spnego/accept_sec_context.c
@@ -372,7 +372,11 @@ select_mech(OM_uint32 *minor_status, MechType *mechType, int verify_p,
*minor_status = errno;
return GSS_S_FAILURE;
}
- asprintf(&str, "host@%s", hostname);
+ i = asprintf(&str, "host@%s", hostname);
+ if (i < 0 || str == NULL) {
+ *minor_status = ENOMEM;
+ return GSS_S_FAILURE;
+ }
host = str;
}
@@ -468,7 +472,7 @@ acceptor_complete(OM_uint32 * minor_status,
}
-static OM_uint32
+static OM_uint32 GSSAPI_CALLCONV
acceptor_start
(OM_uint32 * minor_status,
gss_ctx_id_t * context_handle,
@@ -685,7 +689,7 @@ out:
}
-static OM_uint32
+static OM_uint32 GSSAPI_CALLCONV
acceptor_continue
(OM_uint32 * minor_status,
gss_ctx_id_t * context_handle,
@@ -872,7 +876,7 @@ acceptor_continue
return ret;
}
-OM_uint32
+OM_uint32 GSSAPI_CALLCONV
_gss_spnego_accept_sec_context
(OM_uint32 * minor_status,
gss_ctx_id_t * context_handle,
diff --git a/source4/heimdal/lib/gssapi/spnego/compat.c b/source4/heimdal/lib/gssapi/spnego/compat.c
index 673a5df66b..b23658cfd1 100644
--- a/source4/heimdal/lib/gssapi/spnego/compat.c
+++ b/source4/heimdal/lib/gssapi/spnego/compat.c
@@ -49,8 +49,9 @@ gss_OID_desc _gss_spnego_krb5_mechanism_oid_desc =
/*
* Allocate a SPNEGO context handle
*/
-OM_uint32 _gss_spnego_alloc_sec_context (OM_uint32 * minor_status,
- gss_ctx_id_t *context_handle)
+OM_uint32 GSSAPI_CALLCONV
+_gss_spnego_alloc_sec_context (OM_uint32 * minor_status,
+ gss_ctx_id_t *context_handle)
{
gssspnego_ctx ctx;
@@ -91,7 +92,7 @@ OM_uint32 _gss_spnego_alloc_sec_context (OM_uint32 * minor_status,
* Free a SPNEGO context handle. The caller must have acquired
* the lock before this is called.
*/
-OM_uint32 _gss_spnego_internal_delete_sec_context
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_internal_delete_sec_context
(OM_uint32 *minor_status,
gss_ctx_id_t *context_handle,
gss_buffer_t output_token
@@ -150,7 +151,7 @@ OM_uint32 _gss_spnego_internal_delete_sec_context
* a non-preferred mechanism was negotiated
*/
-OM_uint32
+OM_uint32 GSSAPI_CALLCONV
_gss_spnego_require_mechlist_mic(OM_uint32 *minor_status,
gssspnego_ctx ctx,
int *require_mic)
@@ -228,7 +229,7 @@ add_mech_type(gss_OID mech_type,
}
-OM_uint32
+OM_uint32 GSSAPI_CALLCONV
_gss_spnego_indicate_mechtypelist (OM_uint32 *minor_status,
gss_name_t target_name,
OM_uint32 (*func)(gss_name_t, gss_OID),
diff --git a/source4/heimdal/lib/gssapi/spnego/context_stubs.c b/source4/heimdal/lib/gssapi/spnego/context_stubs.c
index 98ab919459..18c13fe299 100644
--- a/source4/heimdal/lib/gssapi/spnego/context_stubs.c
+++ b/source4/heimdal/lib/gssapi/spnego/context_stubs.c
@@ -66,7 +66,7 @@ spnego_supported_mechs(OM_uint32 *minor_status, gss_OID_set *mechs)
-OM_uint32 _gss_spnego_process_context_token
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_process_context_token
(OM_uint32 *minor_status,
const gss_ctx_id_t context_handle,
const gss_buffer_t token_buffer
@@ -99,7 +99,7 @@ OM_uint32 _gss_spnego_process_context_token
GSS_C_NO_BUFFER);
}
-OM_uint32 _gss_spnego_delete_sec_context
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_delete_sec_context
(OM_uint32 *minor_status,
gss_ctx_id_t *context_handle,
gss_buffer_t output_token
@@ -119,7 +119,7 @@ OM_uint32 _gss_spnego_delete_sec_context
output_token);
}
-OM_uint32 _gss_spnego_context_time
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_context_time
(OM_uint32 *minor_status,
const gss_ctx_id_t context_handle,
OM_uint32 *time_rec
@@ -143,7 +143,7 @@ OM_uint32 _gss_spnego_context_time
time_rec);
}
-OM_uint32 _gss_spnego_get_mic
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_get_mic
(OM_uint32 *minor_status,
const gss_ctx_id_t context_handle,
gss_qop_t qop_req,
@@ -169,7 +169,7 @@ OM_uint32 _gss_spnego_get_mic
qop_req, message_buffer, message_token);
}
-OM_uint32 _gss_spnego_verify_mic
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_verify_mic
(OM_uint32 * minor_status,
const gss_ctx_id_t context_handle,
const gss_buffer_t message_buffer,
@@ -198,7 +198,7 @@ OM_uint32 _gss_spnego_verify_mic
qop_state);
}
-OM_uint32 _gss_spnego_wrap
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_wrap
(OM_uint32 * minor_status,
const gss_ctx_id_t context_handle,
int conf_req_flag,
@@ -231,7 +231,7 @@ OM_uint32 _gss_spnego_wrap
output_message_buffer);
}
-OM_uint32 _gss_spnego_unwrap
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_unwrap
(OM_uint32 * minor_status,
const gss_ctx_id_t context_handle,
const gss_buffer_t input_message_buffer,
@@ -262,7 +262,7 @@ OM_uint32 _gss_spnego_unwrap
qop_state);
}
-OM_uint32 _gss_spnego_compare_name
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_compare_name
(OM_uint32 *minor_status,
const gss_name_t name1,
const gss_name_t name2,
@@ -286,7 +286,7 @@ OM_uint32 _gss_spnego_compare_name
return GSS_S_COMPLETE;
}
-OM_uint32 _gss_spnego_display_name
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_display_name
(OM_uint32 * minor_status,
const gss_name_t input_name,
gss_buffer_t output_name_buffer,
@@ -304,7 +304,7 @@ OM_uint32 _gss_spnego_display_name
output_name_buffer, output_name_type);
}
-OM_uint32 _gss_spnego_import_name
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_import_name
(OM_uint32 * minor_status,
const gss_buffer_t name_buffer,
const gss_OID name_type,
@@ -340,7 +340,7 @@ OM_uint32 _gss_spnego_import_name
return GSS_S_COMPLETE;
}
-OM_uint32 _gss_spnego_export_name
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_export_name
(OM_uint32 * minor_status,
const gss_name_t input_name,
gss_buffer_t exported_name
@@ -359,7 +359,7 @@ OM_uint32 _gss_spnego_export_name
return gss_export_name(minor_status, name->mech, exported_name);
}
-OM_uint32 _gss_spnego_release_name
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_release_name
(OM_uint32 * minor_status,
gss_name_t * input_name
)
@@ -380,7 +380,7 @@ OM_uint32 _gss_spnego_release_name
return GSS_S_COMPLETE;
}
-OM_uint32 _gss_spnego_inquire_context (
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_inquire_context (
OM_uint32 * minor_status,
const gss_ctx_id_t context_handle,
gss_name_t * src_name,
@@ -447,7 +447,7 @@ enomem:
return GSS_S_FAILURE;
}
-OM_uint32 _gss_spnego_wrap_size_limit (
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_wrap_size_limit (
OM_uint32 * minor_status,
const gss_ctx_id_t context_handle,
int conf_req_flag,
@@ -478,7 +478,7 @@ OM_uint32 _gss_spnego_wrap_size_limit (
max_input_size);
}
-OM_uint32 _gss_spnego_export_sec_context (
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_export_sec_context (
OM_uint32 * minor_status,
gss_ctx_id_t * context_handle,
gss_buffer_t interprocess_token
@@ -521,7 +521,7 @@ OM_uint32 _gss_spnego_export_sec_context (
return ret;
}
-OM_uint32 _gss_spnego_import_sec_context (
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_import_sec_context (
OM_uint32 * minor_status,
const gss_buffer_t interprocess_token,
gss_ctx_id_t *context_handle
@@ -557,7 +557,7 @@ OM_uint32 _gss_spnego_import_sec_context (
return GSS_S_COMPLETE;
}
-OM_uint32 _gss_spnego_inquire_names_for_mech (
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_inquire_names_for_mech (
OM_uint32 * minor_status,
const gss_OID mechanism,
gss_OID_set * name_types
@@ -600,7 +600,7 @@ out:
return ret;
}
-OM_uint32 _gss_spnego_inquire_mechs_for_name (
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_inquire_mechs_for_name (
OM_uint32 * minor_status,
const gss_name_t input_name,
gss_OID_set * mech_types
@@ -621,7 +621,7 @@ OM_uint32 _gss_spnego_inquire_mechs_for_name (
return ret;
}
-OM_uint32 _gss_spnego_canonicalize_name (
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_canonicalize_name (
OM_uint32 * minor_status,
const gss_name_t input_name,
const gss_OID mech_type,
@@ -632,7 +632,7 @@ OM_uint32 _gss_spnego_canonicalize_name (
return gss_duplicate_name(minor_status, input_name, output_name);
}
-OM_uint32 _gss_spnego_duplicate_name (
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_duplicate_name (
OM_uint32 * minor_status,
const gss_name_t src_name,
gss_name_t * dest_name
@@ -641,7 +641,7 @@ OM_uint32 _gss_spnego_duplicate_name (
return gss_duplicate_name(minor_status, src_name, dest_name);
}
-OM_uint32
+OM_uint32 GSSAPI_CALLCONV
_gss_spnego_wrap_iov(OM_uint32 * minor_status,
gss_ctx_id_t context_handle,
int conf_req_flag,
@@ -662,7 +662,7 @@ _gss_spnego_wrap_iov(OM_uint32 * minor_status,
iov, iov_count);
}
-OM_uint32
+OM_uint32 GSSAPI_CALLCONV
_gss_spnego_unwrap_iov(OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
int *conf_state,
@@ -683,7 +683,7 @@ _gss_spnego_unwrap_iov(OM_uint32 *minor_status,
iov, iov_count);
}
-OM_uint32
+OM_uint32 GSSAPI_CALLCONV
_gss_spnego_wrap_iov_length(OM_uint32 * minor_status,
gss_ctx_id_t context_handle,
int conf_req_flag,
@@ -705,7 +705,7 @@ _gss_spnego_wrap_iov_length(OM_uint32 * minor_status,
}
#if 0
-OM_uint32 _gss_spnego_complete_auth_token
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_complete_auth_token
(OM_uint32 * minor_status,
const gss_ctx_id_t context_handle,
gss_buffer_t input_message_buffer)
@@ -730,7 +730,7 @@ OM_uint32 _gss_spnego_complete_auth_token
}
#endif
-OM_uint32 _gss_spnego_inquire_sec_context_by_oid
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_inquire_sec_context_by_oid
(OM_uint32 * minor_status,
const gss_ctx_id_t context_handle,
const gss_OID desired_object,
@@ -756,7 +756,7 @@ OM_uint32 _gss_spnego_inquire_sec_context_by_oid
data_set);
}
-OM_uint32 _gss_spnego_set_sec_context_option
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_set_sec_context_option
(OM_uint32 * minor_status,
gss_ctx_id_t * context_handle,
const gss_OID desired_object,
@@ -783,7 +783,7 @@ OM_uint32 _gss_spnego_set_sec_context_option
}
-OM_uint32
+OM_uint32 GSSAPI_CALLCONV
_gss_spnego_pseudo_random(OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
int prf_key,
diff --git a/source4/heimdal/lib/gssapi/spnego/cred_stubs.c b/source4/heimdal/lib/gssapi/spnego/cred_stubs.c
index f15069362c..2920f3d9b5 100644
--- a/source4/heimdal/lib/gssapi/spnego/cred_stubs.c
+++ b/source4/heimdal/lib/gssapi/spnego/cred_stubs.c
@@ -32,7 +32,7 @@
#include "spnego_locl.h"
-OM_uint32
+OM_uint32 GSSAPI_CALLCONV
_gss_spnego_release_cred(OM_uint32 *minor_status, gss_cred_id_t *cred_handle)
{
OM_uint32 ret;
@@ -54,7 +54,7 @@ _gss_spnego_release_cred(OM_uint32 *minor_status, gss_cred_id_t *cred_handle)
* we support gss_{get,set}_neg_mechs() we will need to expose
* more functionality.
*/
-OM_uint32 _gss_spnego_acquire_cred
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_acquire_cred
(OM_uint32 *minor_status,
const gss_name_t desired_name,
OM_uint32 time_req,
@@ -127,7 +127,7 @@ out:
return ret;
}
-OM_uint32 _gss_spnego_inquire_cred
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_inquire_cred
(OM_uint32 * minor_status,
const gss_cred_id_t cred_handle,
gss_name_t * name,
@@ -169,7 +169,7 @@ OM_uint32 _gss_spnego_inquire_cred
return ret;
}
-OM_uint32 _gss_spnego_inquire_cred_by_mech (
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_inquire_cred_by_mech (
OM_uint32 * minor_status,
const gss_cred_id_t cred_handle,
const gss_OID mech_type,
@@ -214,7 +214,7 @@ OM_uint32 _gss_spnego_inquire_cred_by_mech (
return GSS_S_COMPLETE;
}
-OM_uint32 _gss_spnego_inquire_cred_by_oid
+OM_uint32 GSSAPI_CALLCONV _gss_spnego_inquire_cred_by_oid
(OM_uint32 * minor_status,
const gss_cred_id_t cred_handle,
const gss_OID desired_object,
@@ -235,7 +235,7 @@ OM_uint32 _gss_spnego_inquire_cred_by_oid
return ret;
}
-OM_uint32
+OM_uint32 GSSAPI_CALLCONV
_gss_spnego_set_cred_option (OM_uint32 *minor_status,
gss_cred_id_t *cred_handle,
const gss_OID object,
@@ -253,7 +253,7 @@ _gss_spnego_set_cred_option (OM_uint32 *minor_status,
}
-OM_uint32
+OM_uint32 GSSAPI_CALLCONV
_gss_spnego_export_cred (OM_uint32 *minor_status,
gss_cred_id_t cred_handle,
gss_buffer_t value)
@@ -261,7 +261,7 @@ _gss_spnego_export_cred (OM_uint32 *minor_status,
return gss_export_cred(minor_status, cred_handle, value);
}
-OM_uint32
+OM_uint32 GSSAPI_CALLCONV
_gss_spnego_import_cred (OM_uint32 *minor_status,
gss_buffer_t value,
gss_cred_id_t *cred_handle)
diff --git a/source4/heimdal/lib/gssapi/spnego/external.c b/source4/heimdal/lib/gssapi/spnego/external.c
index 2a6002b8ea..d21e4dc7fe 100644
--- a/source4/heimdal/lib/gssapi/spnego/external.c
+++ b/source4/heimdal/lib/gssapi/spnego/external.c
@@ -93,7 +93,5 @@ __gss_spnego_initialize(void)
return &spnego_mech;
}
-static gss_OID_desc _gss_spnego_mechanism_desc =
+gss_OID_desc GSSAPI_LIB_VARIABLE __gss_spnego_mechanism_oid_desc =
{6, (void *)"\x2b\x06\x01\x05\x05\x02"};
-
-gss_OID GSS_SPNEGO_MECHANISM = &_gss_spnego_mechanism_desc;
diff --git a/source4/heimdal/lib/gssapi/spnego/init_sec_context.c b/source4/heimdal/lib/gssapi/spnego/init_sec_context.c
index 75a925497e..c9e182129d 100644
--- a/source4/heimdal/lib/gssapi/spnego/init_sec_context.c
+++ b/source4/heimdal/lib/gssapi/spnego/init_sec_context.c
@@ -609,7 +609,8 @@ spnego_reply
return ret;
}
-OM_uint32 _gss_spnego_init_sec_context
+OM_uint32 GSSAPI_CALLCONV
+_gss_spnego_init_sec_context
(OM_uint32 * minor_status,
const gss_cred_id_t initiator_cred_handle,
gss_ctx_id_t * context_handle,