I can't find any method like EVP_CIPHER_free
in openssl/evp.h
. Don't I need to release the EVP_CIPHERs?
Asked
Active
Viewed 1,002 times
1

miho
- 11,765
- 7
- 42
- 85
1 Answers
4
No, you don't. The init function EVP_CipherInit_ex
is actually initializing variables in EVP_CIPHER_CTX object ectx
, which you pass as the first argument. Just remember to call EVP_CIPHER_CTX_cleanup(&ectx)
when you're done.

Chiara Hsieh
- 3,273
- 23
- 32
-
Ah nice. But functions like `EVP_des_cbc()`, `EVP_aes_256_cbc()` and so on doesn't require the context? Aren't these normal ciphers too? – miho Apr 18 '14 at 07:27
-
1Those function is used to assign cipher type, not used to do any encryption or decryption. If you want to use EVP to do encryption, you can find examples in OpenSSL source code, such as demos\maurice\example3.c – Chiara Hsieh Apr 18 '14 at 10:25