Fixes for Heimdal (macOS) builds from Stefan.
[mech_eap.git] / mech_eap / get_mic.c
index b9241a4..9a7bfc7 100644 (file)
 
 #include "gssapiP_eap.h"
 
-OM_uint32 GSSAPI_CALLCONV
-gss_get_mic_iov(OM_uint32 *minor,
-                gss_ctx_id_t ctx,
-                gss_qop_t qop_req,
-                gss_iov_buffer_desc *iov,
-                int iov_count)
+static OM_uint32
+gssEapGetMIC(OM_uint32 *minor,
+             gss_ctx_id_t ctx,
+             gss_qop_t qop_req,
+             gss_iov_buffer_desc *iov,
+             int iov_count)
 {
     OM_uint32 major;
 
@@ -78,9 +78,17 @@ cleanup:
 
 OM_uint32 GSSAPI_CALLCONV
 gss_get_mic(OM_uint32 *minor,
+#ifdef HAVE_HEIMDAL_VERSION
+            gss_const_ctx_id_t ctx,
+#else
             gss_ctx_id_t ctx,
+#endif
             gss_qop_t qop_req,
+#ifdef HAVE_HEIMDAL_VERSION
+            const gss_buffer_t message_buffer,
+#else
             gss_buffer_t message_buffer,
+#endif
             gss_buffer_t message_token)
 {
     OM_uint32 major;
@@ -93,9 +101,19 @@ gss_get_mic(OM_uint32 *minor,
     iov[1].buffer.value = NULL;
     iov[1].buffer.length = 0;
 
-    major = gss_get_mic_iov(minor, ctx, qop_req, iov, 2);
+    major = gssEapGetMIC(minor, (gss_ctx_id_t)ctx, qop_req, iov, 2);
     if (major == GSS_S_COMPLETE)
         *message_token = iov[1].buffer;
 
     return major;
 }
+
+OM_uint32 GSSAPI_CALLCONV
+gss_get_mic_iov(OM_uint32 *minor,
+                gss_ctx_id_t ctx,
+                gss_qop_t qop_req,
+                gss_iov_buffer_desc *iov,
+                int iov_count)
+{
+    return gssEapGetMIC(minor, ctx, qop_req, iov, iov_count);
+}