Re: Intercepting memory mapped files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 30 Jan 2015 17:18:21 +0530, Kunal Baweja said:

> void encrypt(char *data, char *encrypted, size_t size)
> {
>     unsigned int i;
>     for(i=0;i<(unsigned int)size;i++)
>         encrypted[i] = data[i] + 3;
>     printk(KERN_INFO "%s",encrypted);
>     return;
> }
>
> So in the given code wherever u see the calls to *wrapfs_encrypt*, I have
> replaced with my simpler encryption function.
>
> But I am not able to figure out why calling this function creates a
> problem, the printk() statement inside the function shows me the correctly
> encrypted contents but the file is still blank.

Stupid question, but... once you call encrypt(data, encrypted, size),
do you then write out the 'encrypted' buffer, or do you write out 'data'?

(Bonus points for avoiding a memory leak here :)

Attachment: pgpHQwwexUQNa.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux