Reputation: 9
EVP_CIPHER_CTX ctx;
EVP_CIPHER_CTX_init(&ctx);
trying to crypt a word dictionary to find key
Keep getting segmentation faults or storage error
Upvotes: 0
Views: 427
Reputation: 223689
Starting with version 1.1 of OpenSSL, EVP_CIPHER_CTX
became an opaque structure, and EVP_CIPHER_CTX_init
is now an alias for EVP_CIPHER_CTX_reset
which clears an existing structure.
You need to instead use EVP_CIPHER_CTX_new
to allocate space for one.
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
...
EVP_CIPHER_CTX_free(ctx);
Upvotes: 4