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
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)
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_copyis returning an error:digging in the code, it seems that
dupctxis 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