<div dir="ltr">looks like <a href="https://linux.die.net/man/3/evp_md_ctx_init" target="_blank">https://linux.die.net/man/3/evp_md_ctx_init</a> initializes a structure that's allocated already.  Yes it could be on the stack, or static...<br><div>(instead of _new)</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 27, 2022 at 1:42 AM Philip Prindeville <<a href="mailto:philipp_subx@redfish-solutions.com">philipp_subx@redfish-solutions.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I suspect I already know the answer, but... is there a way to have a non-heap based structure like EVP_MD_CTX?<br>
<br>
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?<br>
<br>
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...<br>
<br>
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.<br>
<br>
Thanks,<br>
<br>
-Philip<br>
<br>
</blockquote></div>