Re: Non-heap based structures

2022-07-26 Thread Tomas Mraz
Hi, there is no way to do that with OpenSSL 1.1.0 and newer. The thing is that with recent versions of OpenSSL the later operations with the EVP_MD_CTX can fail for other reasons than memory allocation failure such as algorithm unavailability from a provider. So you would need to check anyway. If

Re: Non-heap based structures

2022-07-26 Thread J Decker
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

Non-heap based structures

2022-07-26 Thread Philip Prindeville
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 e