Samantha Figueroa
Samantha Figueroa

Reputation: 9

I keep getting this error of "storage size of 'ctx isn't known for EVP_CIPHER_CTX

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

Answers (1)

dbush
dbush

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

Related Questions