Macro to support 3.0 and 1.0

Shivakumar Poojari Shivakumar.Poojari at rbbn.com
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>

#else

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

 #include <openssl/aes.h>

#endif

       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.

if (OPENSSL_VERSION_MAJOR >= 3)
  #include <openssl/evp.h>
else if (OPENSSL_VERSION_MAJOR < 3)
  #include <openssl/aes.h>


thanks,
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: <https://mta.openssl.org/pipermail/openssl-users/attachments/20210506/02c5ee42/attachment-0001.html>


More information about the openssl-users mailing list