<p dir="ltr">Obviously I am writing the encrypted data :-/ I will post my code on github in an hour so that everyone gets to know what exactly I am doing :-) </p>
<br><div class="gmail_quote">On 6:44pm, Fri 30-Jan-2015 null <<a href="mailto:Valdis.Kletnieks@vt.edu">Valdis.Kletnieks@vt.edu</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, 30 Jan 2015 17:18:21 +0530, Kunal Baweja said:<br>
<br>
> void encrypt(char *data, char *encrypted, size_t size)<br>
> {<br>
> unsigned int i;<br>
> for(i=0;i<(unsigned int)size;i++)<br>
> encrypted[i] = data[i] + 3;<br>
> printk(KERN_INFO "%s",encrypted);<br>
> return;<br>
> }<br>
><br>
> So in the given code wherever u see the calls to *wrapfs_encrypt*, I have<br>
> replaced with my simpler encryption function.<br>
><br>
> But I am not able to figure out why calling this function creates a<br>
> problem, the printk() statement inside the function shows me the correctly<br>
> encrypted contents but the file is still blank.<br>
<br>
Stupid question, but... once you call encrypt(data, encrypted, size),<br>
do you then write out the 'encrypted' buffer, or do you write out 'data'?<br>
<br>
(Bonus points for avoiding a memory leak here :)<br>
</blockquote></div>