2011-04-19 18:48:57

by Kent Borg

[permalink] [raw]
Subject: shash_alg size fields and stomping memory

In struct shash_alg what are the various sizes for? (WOuld be cool to
know what everything is for in those alg structures...)

My most recent discovery is that if I want to do an shash_desc_ctx() and
use the result, cra_ctxsize doesn't seem to mean a thing. Rather,
unless I set descsize, memory will be stomped.

And, while I am at it, what is "cra"?


-kb, the Kent who would love to RTFM but there doesn't seem to be an FM.


2011-04-27 09:57:56

by Herbert Xu

[permalink] [raw]
Subject: Re: shash_alg size fields and stomping memory

Kent Borg <[email protected]> wrote:
>
> My most recent discovery is that if I want to do an shash_desc_ctx() and
> use the result, cra_ctxsize doesn't seem to mean a thing. Rather,
> unless I set descsize, memory will be stomped.

descsize specifies the size of shash_desc_ctx. ctxsize is the
size of crypto_shash_ctx.

Cheers,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt