#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;
}