Macro to support 3.0 and 1.0

Shivakumar Poojari Shivakumar.Poojari at
Thu May 6 10:38:30 UTC 2021

Hi All,

         We are upgrading our code to openssl 3.0. But we need to keep the older
         version of code also which is 1.0. So, we tried by keeping the newer version
         of the code as below but when we compiled the code for 3.0, evp.h is not
         getting included. Please suggest f our approach is correct

#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)

  /******higher version code************/

 #include <openssl/evp.h>


  /*******lower version code *********/

 #include <openssl/aes.h>


       Also, we found that OPENSSL_VERSION_NUMBER is deprecated, so thought of using
       the below macros but we think since this macro is defined in newer version this might
       not work when we compile it for older versions. Please suggest how to handle this.

  #include <openssl/evp.h>
  #include <openssl/aes.h>

shiva kumar

Notice: This e-mail together with any attachments may contain information of Ribbon Communications Inc. and its Affiliates that is confidential and/or proprietary for the sole use of the intended recipient. Any review, disclosure, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please notify the sender immediately and then delete all copies, including any attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the openssl-users mailing list