Non-heap based structures

J Decker d3ck0r at gmail.com
Wed Jul 27 06:33:32 UTC 2022


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_subx at 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mta.openssl.org/pipermail/openssl-users/attachments/20220727/93953973/attachment.htm>


More information about the openssl-users mailing list