Skip to content

EVP_CIPHER_CTX_copy for aes-gcm #21955

Closed
Closed

Description

@BMBurstein

I use the same key to encrypt multiple chunks of data (using a different IV each time). I have code similar to the following which was working in openssl 1.1.1 (on Ubuntu 20.04)

ctx = EVP_CIPHER_CTX_new();
EVP_CipherInit_ex(ctx, EVP_aes_256_gcm(), NULL, key, NULL, 1);
...
// do this for each chunk
temp = EVP_CIPHER_CTX_new();
EVP_CIPHER_CTX_copy(temp, ctx);
EVP_CipherInit_ex(temp, NULL, NULL, NULL, iv, -1);
... // use temp do encrypt

This worked fine. I am now trying to compile on a newer platform (Ubuntu 22.04) which has OSSL 3.0.2, and the call to EVP_CIPHER_CTX_copy is returning an error:

digital envelope routines:EVP_CIPHER_CTX_copy:not able to copy ctx:../crypto/evp/evp_enc.c:1361

digging in the code, it seems that dupctx is not implemented for aes-gcm anymore.

I apologize if this is already fixed in newer versions. I don't have a newer version to check with

Activity

  1. self-assigned this
    on Sep 4, 2023
  2. nhorman commented on Sep 4, 2023

    @nhorman
    Contributor

    addressed by #21933

  3. BMBurstein commented on Sep 4, 2023

    @BMBurstein
    Author

    will this fix be backported to 3.0.2, or only available in newer versions?

  4. t8m commented on Sep 4, 2023

    @t8m
    Member

    will this fix be backported to 3.0.2, or only available in newer versions?

    3.0.2 is done release, it cannot be changed. But at some point there will be a new release in 3.0 branch that will contain the fix from #21933.

  5. nhorman commented on Sep 5, 2023

    @nhorman
    Contributor

    closing as a duplicate of #21933

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

issue: bug reportThe issue was opened to report a bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions