API compatible with OpenSSL before version 1.1.0

Add BN_init() and CRYPTO_num_locks(), compatible with OpenSSL 0.9.8.
And change the default OpenSSL API to 1.1.0.
This commit is contained in:
Zhi Guan
2018-01-07 12:02:03 +08:00
parent 0803f0a034
commit 86e1fc9266
8 changed files with 5372 additions and 5348 deletions

View File

@@ -173,6 +173,9 @@ int BN_num_bits(const BIGNUM *a);
int BN_num_bits_word(BN_ULONG l);
int BN_security_bits(int L, int N);
BIGNUM *BN_new(void);
# if OPENSSL_API_COMPAT < 0x10100000L
void BN_init(BIGNUM *a);
# endif
BIGNUM *BN_secure_new(void);
void BN_clear_free(BIGNUM *a);
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);

View File

@@ -215,7 +215,11 @@ void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx);
* 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
# if OPENSSL_API_COMPAT < 0x10100000L
int CRYPTO_num_locks(void);
# else
# define CRYPTO_num_locks() (1)
# endif
# define CRYPTO_set_locking_callback(func)
# define CRYPTO_get_locking_callback() (NULL)
# define CRYPTO_set_add_lock_callback(func)

View File

@@ -41,9 +41,9 @@ extern "C" {
*/
# define OPENSSL_VERSION_NUMBER 0x1010004fL
# ifdef OPENSSL_FIPS
# define OPENSSL_VERSION_TEXT "GmSSL 2.1.0 - OpenSSL 1.1.0d-fips 03 Jan 2018"
# define OPENSSL_VERSION_TEXT "GmSSL 2.1.0 - OpenSSL 1.1.0d-fips 07 Jan 2018"
# else
# define OPENSSL_VERSION_TEXT "GmSSL 2.1.0 - OpenSSL 1.1.0d 03 Jan 2018"
# define OPENSSL_VERSION_TEXT "GmSSL 2.1.0 - OpenSSL 1.1.0d 07 Jan 2018"
# endif
/*-