]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/gssd/context.c
nfs-utils: Fix source code character encoding
[nfs-utils.git] / utils / gssd / context.c
index 02d162f2aa620a3c5fde2f9cf9fde7f9ce4c1544..1e50bbfd85d6073c8bea39e2ae84d36c0ee5fec9 100644 (file)
   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* HAVE_CONFIG_H */
+
 #include <stdio.h>
 #include <syslog.h>
 #include <string.h>
 #include "context.h"
 
 int
-serialize_context_for_kernel(gss_ctx_id_t ctx, gss_buffer_desc *buf)
+serialize_context_for_kernel(gss_ctx_id_t ctx,
+                            gss_buffer_desc *buf,
+                            gss_OID mech,
+                            int32_t *endtime)
 {
-       gss_union_ctx_id_t      uctx = (gss_union_ctx_id_t)ctx;
-
-       if (g_OID_equal(&krb5oid, uctx->mech_type))
-               return serialize_krb5_ctx(uctx->internal_ctx_id, buf);
+       if (g_OID_equal(&krb5oid, mech))
+               return serialize_krb5_ctx(ctx, buf, endtime);
 #ifdef HAVE_SPKM3_H
-       else if (g_OID_equal(&spkm3oid, uctx->mech_type))
-               return serialize_spkm3_ctx(uctx, buf);
+       else if (g_OID_equal(&spkm3oid, mech))
+               return serialize_spkm3_ctx(ctx, buf, endtime);
 #endif
        else {
                printerr(0, "ERROR: attempting to serialize context with "
-                               "unknown mechanism oid\n");
+                               "unknown/unsupported mechanism oid\n");
                return -1;
        }
 }