On Tue, Mar 29, 2022 at 06:24:09PM +0200, Remco wrote:
> I get a "forward declaration of 'struct evp_aead_ctx_st'" message, trying to
> use the "EVP_AEAD_CTX" functions on:
> 
> "OpenBSD 7.1 (GENERIC.MP) #448: Tue Mar 29 00:13:47 MDT 2022
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP"
> 
> Some definitions, e.g. "evp_aead_ctx_st", appear to have moved from
> <openssl/evp.h> to "evp_locl.h", since revision 1.98 of <openssl/evp.h>.
> 
> Is the EVP_AEAD_CTX functionality still supposed to be available, and how ?
> 
> The "evp_locl.h" header does not appear installed, find /usr/include -name
> "evp_locl.h", shows nothing.

You need to move the EVP_AEAD_CTX from the stack to the heap and
allocate/free it with EVP_AEAD_CTX_{new,free}().  See the example in
EVP_AEAD_CTX_init(3) - unfortunately written without proper error
checking (I should fix this).

Instead of

        EVP_AEAD_CTX ctx;

        if (!EVP_AEAD_CTX_init(&ctx, ...))
                ...

You'd now write

        EVP_AEAD_CTX *ctx;

        ctx = EVP_AEAD_CTX_new();
        if (ctx == NULL)
                // error

        if (!EVP_AEAD_CTX_init(ctx, ...))
                // error

        ...

        EVP_AEAD_CTX_free(ctx);

Reply via email to