Re: crypto apis in cifs module allocating storage for character array during run-time vs. dynamic allocation

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

 



On Mon, Aug 23, 2010 at 5:39 PM, Miloslav Trmac <mitr@xxxxxxxxxx> wrote:
> ----- "Shirish Pargaonkar" <shirishpargaonkar@xxxxxxxxx> wrote:
>> Instead of determining and allocating a char array for use during usage of
>> crypto_shash_* calls, would like to instead dynamically
>> allocate (and free) storage for the duration of crypto calculation
>> (crypto_shash_init,
>> crypto_shash_update, and crypto_shash_final)
>> But everytime I try, it results in some sort of oops in the cifs module.
> Let me just suggest something, without trying it...
>
>> +struct sdesc {
>> +       struct shash_desc shash;
>> +       char *ctx;
>        char ctx[];
> would be correct here.
>> +};
> And you need to allocate both shash_desc and "ctx" together as a single piece of memory - exactly mirror the memory layout of the original "sdesc" variable.
>    Mirek
>

Mirek,

Thanks, that worked.
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux