class_uuid_t uuid;
struct obd_uuid lmv_uuid;
struct llog_ctxt *ctxt;
- int rc, err = 0;
+ int rc = 0, err = 0;
ENTRY;
if (lmd_bad_magic(lmd))
#include <linux/pagemap.h>
#include <asm/div64.h>
#include <linux/seq_file.h>
+#include <linux/namei.h>
#else
#include <liblustre.h>
#endif
#include <linux/lprocfs_status.h>
#include <linux/lustre_fsfilt.h>
#include <linux/obd_lmv.h>
-#include <linux/namei.h>
#include <linux/lustre_lite.h>
#include "lmv_internal.h"
-
static inline void lmv_drop_intent_lock(struct lookup_intent *it)
{
if (LUSTRE_IT(it)->it_lock_mode != 0)
#ifndef __SEC_GSS_GSS_INTERNAL_H_
#define __SEC_GSS_GSS_INTERNAL_H_
+/* remove this mess when libkcrypt is ready --umka */
+#ifndef __KERNEL__
+/*
+ * Algorithm masks and types.
+ */
+#define CRYPTO_ALG_TYPE_MASK 0x000000ff
+#define CRYPTO_ALG_TYPE_CIPHER 0x00000001
+#define CRYPTO_ALG_TYPE_DIGEST 0x00000002
+#define CRYPTO_ALG_TYPE_COMPRESS 0x00000004
+
+/*
+ * Transform masks and values (for crt_flags).
+ */
+#define CRYPTO_TFM_MODE_MASK 0x000000ff
+#define CRYPTO_TFM_REQ_MASK 0x000fff00
+#define CRYPTO_TFM_RES_MASK 0xfff00000
+
+#define CRYPTO_TFM_MODE_ECB 0x00000001
+#define CRYPTO_TFM_MODE_CBC 0x00000002
+#define CRYPTO_TFM_MODE_CFB 0x00000004
+#define CRYPTO_TFM_MODE_CTR 0x00000008
+
+#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100
+#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000
+#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000
+#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000
+#define CRYPTO_TFM_RES_BAD_BLOCK_LEN 0x00800000
+#define CRYPTO_TFM_RES_BAD_FLAGS 0x01000000
+
+/*
+ * Miscellaneous stuff.
+ */
+#define CRYPTO_UNSPEC 0
+#define CRYPTO_MAX_ALG_NAME 64
+
+struct scatterlist {
+ struct page *page;
+ unsigned int offset;
+ __u32 dma_address;
+ unsigned int length;
+};
+
+static inline struct crypto_tfm *
+crypto_alloc_tfm(const char *name, __u32 flags)
+{
+ return NULL;
+}
+
+static inline void
+crypto_free_tfm(struct crypto_tfm *tfm)
+{
+ return;
+}
+
+static inline int
+crypto_digest_setkey(struct crypto_tfm *tfm,
+ const __u8 *key, unsigned int keylen)
+{
+ return -ENOSYS;
+}
+
+static inline unsigned int
+crypto_tfm_alg_blocksize(struct crypto_tfm *tfm)
+{
+ return 0;
+}
+
+static inline unsigned int
+crypto_tfm_alg_ivsize(struct crypto_tfm *tfm)
+{
+ return 0;
+}
+
+#endif /* __KERNEL__ */
+
struct ptlrpc_sec;
struct ptlrpc_cred;
#include <linux/crypto.h>
#else
#include <liblustre.h>
-#include "../kcrypto/libcrypto.h"
+//#include "../kcrypto/libcrypto.h"
#endif
#include <libcfs/kp30.h>
int length)
{
__u32 ret = -EINVAL;
+#ifdef __KERNEL__
struct scatterlist sg[1];
__u8 local_iv[16] = {0};
ret = crypto_cipher_encrypt_iv(tfm, sg, sg, length, local_iv);
out:
+#endif
return(ret);
}
int length)
{
__u32 ret = -EINVAL;
+#ifdef __KERNEL__
struct scatterlist sg[1];
__u8 local_iv[16] = {0};
ret = crypto_cipher_decrypt_iv(tfm, sg, sg, length, local_iv);
out:
+#endif
return(ret);
}
//EXPORT_SYMBOL(krb5_decrypt);
+#ifdef __KERNEL__
void
buf_to_sg(struct scatterlist *sg, char *ptr, int len)
{
list++;
}
}
+#endif
int gss_encrypt_rawobj(struct crypto_tfm *tfm,
rawobj_t *inobj, rawobj_t *outobj,
int enc)
{
+ int rc = -EINVAL;
+#ifdef __KERNEL__
struct scatterlist *src_list, *dst_list;
__u8 local_iv[16] = {0};
int list_len;
- __u32 rc;
ENTRY;
LASSERT(outobj->len >= inobj->len);
}
outobj->len = inobj->len;
-
+ EXIT;
out_free:
OBD_FREE(src_list, sizeof(*src_list) * list_len * 2);
- RETURN(rc);
+#endif
+ return rc;
}
#include <linux/crypto.h>
#else
#include <liblustre.h>
-#include "../kcrypto/libcrypto.h"
+//#include "../kcrypto/libcrypto.h"
#include <netinet/in.h>
#endif
#include <linux/crypto.h>
#else
#include <liblustre.h>
-#include "../kcrypto/libcrypto.h"
+//#include "../kcrypto/libcrypto.h"
#endif
#include <libcfs/kp30.h>
#include <linux/crypto.h>
#else
#include <liblustre.h>
-#include "../kcrypto/libcrypto.h"
+//#include "../kcrypto/libcrypto.h"
#endif
#include <libcfs/kp30.h>
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: sec_gss.c,v 1.3 2005/04/04 13:12:39 yury Exp $
+ * $Id: sec_gss.c,v 1.4 2005/04/13 09:49:50 yury Exp $
*/
#ifndef EXPORT_SYMTAB
#endif
};
-static rwlock_t gss_ctx_lock = RW_LOCK_UNLOCKED;
-
#ifdef __KERNEL__
+static rwlock_t gss_ctx_lock = RW_LOCK_UNLOCKED;
+
struct gss_upcall_msg {
struct rpc_pipe_msg gum_base;
atomic_t gum_refcount;
GOTO(err_free_ctx, err);
GOTO(err_free_ctx, err = 0);
}
- if (rawobj_extract_local(&tmp_buf, (__u32 **) &p, &len))
+ if (rawobj_extract_local(&tmp_buf, (__u32 **) ((void *)&p), &len))
GOTO(err_free_ctx, err);
if (rawobj_dup(&ctx->gc_wire_ctx, &tmp_buf)) {
GOTO(err_free_ctx, err = -ENOMEM);
}
- if (rawobj_extract_local(&tmp_buf, (__u32 **) &p, &len))
+ if (rawobj_extract_local(&tmp_buf, (__u32 **) ((void *)&p), &len))
GOTO(err_free_wire_ctx, err);
if (len) {
CERROR("unexpected trailing %u bytes\n", len);
{
struct gss_sec *gsec;
struct ptlrpc_sec *sec;
+#ifdef __KERNEL__
char *pos;
+#endif
ENTRY;
LASSERT(flavor->flavor == PTLRPC_SEC_GSS);
void gss_destroy_sec(struct ptlrpc_sec *sec)
{
struct gss_sec *gsec;
+#ifdef __KERNEL__
char *pos;
+#endif
ENTRY;
gsec = container_of(sec, struct gss_sec, gs_base);
return rc;
}
+#ifdef __KERNEL__
static void __exit ptlrpcs_gss_exit(void)
{
lustre_secinit_downcall_handler = NULL;
cleanup_kerberos_module();
-#ifndef __KERNEL__
-#else
rpc_rmdir(LUSTRE_PIPEDIR);
gss_svc_exit();
-#endif
ptlrpcs_unregister(&gss_type);
}
+#endif
MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
MODULE_DESCRIPTION("GSS Security module for Lustre");