Whamcloud - gitweb
- replace CWARN with CDEBUG
[fs/lustre-release.git] / lustre / ptlrpc / gss / gss_mech_switch.c
index 53e11e6..8a4e627 100644 (file)
@@ -2,8 +2,9 @@
  * vim:expandtab:shiftwidth=8:tabstop=8:
  *
  * Modifications for Lustre
- * Copyright 2004 - 2006, Cluster File Systems, Inc.
- * All rights reserved
+ *
+ * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ *
  * Author: Eric Mei <ericm@clusterfs.com>
  */
 
@@ -67,7 +68,7 @@
 #include "gss_internal.h"
 #include "gss_api.h"
 
-static LIST_HEAD(registered_mechs);
+static CFS_LIST_HEAD(registered_mechs);
 static spinlock_t registered_mechs_lock = SPIN_LOCK_UNLOCKED;
 
 int lgss_mech_register(struct gss_api_mech *gm)
@@ -245,23 +246,8 @@ __u32 lgss_verify_mic(struct gss_ctx *context_handle,
                                  mic_token);
 }
 
-#if 0
-__u32 lgss_wrap(struct gss_ctx *context_handle,
-                __u32 qop,
-                rawobj_buf_t *inbuf,
-                rawobj_t *outbuf)
-{
-        LASSERT(context_handle);
-        LASSERT(context_handle->mech_type);
-        LASSERT(context_handle->mech_type->gm_ops);
-        LASSERT(context_handle->mech_type->gm_ops->gss_wrap);
-
-        return context_handle->mech_type->gm_ops
-                ->gss_wrap(context_handle, qop, inbuf, outbuf);
-}
-#endif
-
 __u32 lgss_wrap(struct gss_ctx *context_handle,
+                rawobj_t *gsshdr,
                 rawobj_t *msg,
                 int msg_buflen,
                 rawobj_t *out_token)
@@ -272,10 +258,11 @@ __u32 lgss_wrap(struct gss_ctx *context_handle,
         LASSERT(context_handle->mech_type->gm_ops->gss_wrap);
 
         return context_handle->mech_type->gm_ops
-                ->gss_wrap(context_handle, msg, msg_buflen, out_token);
+                ->gss_wrap(context_handle, gsshdr, msg, msg_buflen, out_token);
 }
 
 __u32 lgss_unwrap(struct gss_ctx *context_handle,
+                  rawobj_t *gsshdr,
                   rawobj_t *token,
                   rawobj_t *out_msg)
 {
@@ -285,11 +272,12 @@ __u32 lgss_unwrap(struct gss_ctx *context_handle,
         LASSERT(context_handle->mech_type->gm_ops->gss_unwrap);
 
         return context_handle->mech_type->gm_ops
-                ->gss_unwrap(context_handle, token, out_msg);
+                ->gss_unwrap(context_handle, gsshdr, token, out_msg);
 }
 
 
 __u32 lgss_plain_encrypt(struct gss_ctx *ctx,
+                         int decrypt,
                          int length,
                          void *in_buf,
                          void *out_buf)
@@ -300,7 +288,7 @@ __u32 lgss_plain_encrypt(struct gss_ctx *ctx,
         LASSERT(ctx->mech_type->gm_ops->gss_plain_encrypt);
 
         return ctx->mech_type->gm_ops
-                ->gss_plain_encrypt(ctx, length, in_buf, out_buf);
+                ->gss_plain_encrypt(ctx, decrypt, length, in_buf, out_buf);
 }
 
 /* gss_delete_sec_context: free all resources associated with context_handle.