looks like https://linux.die.net/man/3/evp_md_ctx_init initializes a structure that's allocated already. Yes it could be on the stack, or static... (instead of _new)
On Wed, Jul 27, 2022 at 1:42 AM Philip Prindeville < philipp_s...@redfish-solutions.com> wrote: > Hi, > > I suspect I already know the answer, but... is there a way to have a > non-heap based structure like EVP_MD_CTX? > > If I don't want to have one be malloc'd (or OPENSSL_zalloc'd as the case > may be), I can't have one be a stack variable or static, can I? > > I ask because I'm trying to replace some existing code that has no path to > handle out-of-memory exceptions if EVP_MD_CTX_create() ever returns NULL... > > I guess the point of crypto/evp/evp_local.h is to completely hide details > of the structure, including its size... so the answer to the original > question is probably "no". But I just wanted to make sure. > > Thanks, > > -Philip > >