I\'m trying to use openssl with visual studio c project.
I compiled openssl using visual studio nmake command then installed everything to a predefined folder (C:\\opens
You can get the key length using:
*outputkey_size = EVP_CIPHER_key_length(cipher);
Putting in the end of your code the next lines:
printf("Key-size: %d\n", aes_keylen);
printf("Key: "); for (int i = 0; i
It prints the correct output, which is next:
Key-size: 32
Key: 51ae3ac4721439302cc5f90313f440bd9ca714c9a80b2213d034c87c00a700a0
I'm not sure if key_len was available on previous versions but in the openssl-1.10 release notes you can read:
- Most libcrypto and libssl public structures were made opaque, including: BIGNUM and associated types, EC_KEY and EC_KEY_METHOD, DH and DH_METHOD, DSA and DSA_METHOD, RSA and RSA_METHOD, BIO and BIO_METHOD, EVP_MD_CTX, EVP_MD, EVP_CIPHER_CTX, EVP_CIPHER, EVP_PKEY and associated types, HMAC_CTX, X509, X509_CRL, X509_OBJECT, X509_STORE_CTX, X509_STORE, X509_LOOKUP, X509_LOOKUP_METHOD
- libssl internal structures made opaque
which means that the applications are no longer allowed to look inside the variables of the structures. This is the reason that _key_len (and others) shows undefined.