-1

In the tester side, I'm trying to print the value of structure evp_pkey_ctx_st but I'm getting error dereferencing pointer to incomplete type EVP_PKEY_CTX.

printf("\nOpearation:%d",ctx->operation);

Can anyone please guide me. Is this a feasible approach? can we print structure values in the engine or tester side?

kelalaka
  • 5,064
  • 5
  • 27
  • 44

1 Answers1

0

The EVP_PKEY_CTX structure is opaque. There are functions you can call to process it, but only code that is part of the implementation itself is supposed to understand the structure. The arrangement of the structure is an implementation detail and not exposed outside the OpenSSL code.

It's not clear exactly what you're trying to do. Are you implementing an OpenSSL engine? Can you show us enough code to replicate the error you're getting along with enough context to understand how to build the code?

David Schwartz
  • 179,497
  • 17
  • 214
  • 278
  • Thanks for quick response . Yes I'm implementing Openssl engine. Please refer this . http://openssl.cs.utah.edu/docs/crypto/EVP_PKEY_encrypt.html I want to print or access structure element like this ctx->operation. Is this possible ? – Asif Sayyad Mar 20 '20 at 15:29
  • Engines can access the structure details, but you need the right #include's and the right build logic. See [here](https://www.openssl.org/blog/blog/2015/10/08/engine-building-lesson-1-a-minimum-useless-engine/) for more. – David Schwartz Mar 20 '20 at 16:13
  • Yes Sir I followed the same tutorial; as of now engine is working fine . To be more precise If I Want to access structure element of context how should I proceed further. Is there any getter functions available that allow me to access structure opaque elements. https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes#No_longer_works – Asif Sayyad Mar 20 '20 at 16:24
  • @AsifSayyad You are probably missing #include's. See the link in my previous comment. – David Schwartz Mar 20 '20 at 16:32