Help Needed for deprecated functions and macros like "CRYPTO_num_locks()" , "CRYPTO_LOCK" ......etc

Kumar Mishra, Sanjeev Sanjeev.Kumar-Mishra at rbbn.com
Tue Aug 17 13:59:14 UTC 2021


Hi All,
I am upgrading the code from OpenSSL 1.0.1 to OpenSSL 3.0.
I am getting compilation errors for deprecated functions and macros like "CRYPTO_num_locks()" , "CRYPTO_LOCK" ......etc. But there is not any replacement for these functions and macros in OpenSSL 3.0.
How can I handle these compilation errors ?
Should I re-write these functions doing nothing and macros with any arbitrary numbers ?
In OpenSSL 3.0 source code file /include/openssl/crypto.h.in, it is mentioned that to handle these functions and macros as "no-ops".
Could anybody elaborate the following comment from source code of OpenSSL 3.0 ( /include/openssl/crypto.h.in) in details.......

/*
* The old locking functions have been removed completely without compatibility
* macros. This is because the old functions either could not properly report
* errors, or the returned error values were not clearly documented.
* Replacing the locking functions with no-ops would cause race condition
* issues in the affected applications. It is far better for them to fail at
* compile time.
* On the other hand, the locking callbacks are no longer used. Consequently,
* the callback management functions can be safely replaced with no-op macros.
*/
# define CRYPTO_num_locks() (1)
# define CRYPTO_set_locking_callback(func)
# define CRYPTO_get_locking_callback() (NULL)
# define CRYPTO_set_add_lock_callback(func)
# define CRYPTO_get_add_lock_callback() (NULL)
/*
* These defines where used in combination with the old locking callbacks,
* they are not called anymore, but old code that's not called might still
* use them.
*/
# define CRYPTO_LOCK 1
# define CRYPTO_UNLOCK 2
# define CRYPTO_READ 4
# define CRYPTO_WRITE 8
.....
.....
......

Thanks in anticipation,
Sanjeev Kumar Mishra


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/20210817/fac96adc/attachment.html>


More information about the openssl-users mailing list