diff options
Diffstat (limited to 'include')
29 files changed, 118 insertions, 80 deletions
diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h index 9522eec18f..9210f2ccdc 100644 --- a/include/openssl/asn1.h +++ b/include/openssl/asn1.h @@ -19,7 +19,7 @@ # include <openssl/symhacks.h> # include <openssl/ossl_typ.h> -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # include <openssl/bn.h> # endif diff --git a/include/openssl/asn1t.h b/include/openssl/asn1t.h index c152320785..38b9b76228 100644 --- a/include/openssl/asn1t.h +++ b/include/openssl/asn1t.h @@ -915,7 +915,7 @@ DECLARE_ASN1_ITEM(ZINT64) DECLARE_ASN1_ITEM(UINT64) DECLARE_ASN1_ITEM(ZUINT64) -# if OPENSSL_API_COMPAT < 0x30000000L +# if !OPENSSL_API_3 /* * LONG and ZLONG are strongly discouraged for use as stored data, as the * underlying C type (long) differs in size depending on the architecture. diff --git a/include/openssl/bio.h b/include/openssl/bio.h index 2888b42da8..5587df60c6 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h @@ -681,7 +681,7 @@ int BIO_sock_error(int sock); int BIO_socket_ioctl(int fd, long type, void *arg); int BIO_socket_nbio(int fd, int mode); int BIO_sock_init(void); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define BIO_sock_cleanup() while(0) continue # endif int BIO_set_tcp_ndelay(int sock, int turn_on); diff --git a/include/openssl/bn.h b/include/openssl/bn.h index 8af05d00e5..769cc7f087 100644 --- a/include/openssl/bn.h +++ b/include/openssl/bn.h @@ -61,7 +61,7 @@ extern "C" { # define BN_FLG_CONSTTIME 0x04 # define BN_FLG_SECURE 0x08 -# if OPENSSL_API_COMPAT < 0x00908000L +# if !OPENSSL_API_0_9_8 /* deprecated name for the flag */ # define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME # define BN_FLG_FREE 0x8000 /* used for debugging */ @@ -190,7 +190,7 @@ int BN_is_odd(const BIGNUM *a); void BN_zero_ex(BIGNUM *a); -# if OPENSSL_API_COMPAT >= 0x00908000L +# if OPENSSL_API_0_9_8 # define BN_zero(a) BN_zero_ex(a) # else # define BN_zero(a) (BN_set_word((a),0)) @@ -519,7 +519,7 @@ BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn); BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn); BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define get_rfc2409_prime_768 BN_get_rfc2409_prime_768 # define get_rfc2409_prime_1024 BN_get_rfc2409_prime_1024 # define get_rfc3526_prime_1536 BN_get_rfc3526_prime_1536 diff --git a/include/openssl/comp.h b/include/openssl/comp.h index d814d3cf25..467ce6ad35 100644 --- a/include/openssl/comp.h +++ b/include/openssl/comp.h @@ -35,7 +35,7 @@ int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, COMP_METHOD *COMP_zlib(void); -#if OPENSSL_API_COMPAT < 0x10100000L +#if !OPENSSL_API_1_1_0 #define COMP_zlib_cleanup() while(0) continue #endif diff --git a/include/openssl/conf.h b/include/openssl/conf.h index 7336cd2f1d..f7b5b23c13 100644 --- a/include/openssl/conf.h +++ b/include/openssl/conf.h @@ -90,7 +90,7 @@ int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name)) -#if OPENSSL_API_COMPAT < 0x10100000L +#if !OPENSSL_API_1_1_0 # define OPENSSL_no_config() \ OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL) #endif @@ -137,7 +137,7 @@ int CONF_modules_load_file(const char *filename, const char *appname, unsigned long flags); void CONF_modules_unload(int all); void CONF_modules_finish(void); -#if OPENSSL_API_COMPAT < 0x10100000L +#if !OPENSSL_API_1_1_0 # define CONF_modules_free() while(0) continue #endif int CONF_module_add(const char *name, conf_init_func *ifunc, diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index c7b6e47047..b69b04c500 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h @@ -36,7 +36,7 @@ */ # include <openssl/symhacks.h> -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # include <openssl/opensslv.h> # endif @@ -44,7 +44,7 @@ extern "C" { #endif -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define SSLeay OpenSSL_version_num # define SSLeay_version OpenSSL_version # define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER @@ -62,7 +62,7 @@ typedef struct { int dummy; } CRYPTO_dynlock; -# endif /* OPENSSL_API_COMPAT */ +# endif /* OPENSSL_API_1_1_0 */ typedef void CRYPTO_RWLOCK; @@ -199,7 +199,7 @@ void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val); void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 /* * This function cleans up all "ex_data" state. It mustn't be called under * potential race-conditions. @@ -246,11 +246,11 @@ typedef struct crypto_threadid_st { # define CRYPTO_THREADID_cpy(dest, src) # define CRYPTO_THREADID_hash(id) (0UL) -# if OPENSSL_API_COMPAT < 0x10000000L +# if !OPENSSL_API_1_0_0 # define CRYPTO_set_id_callback(func) # define CRYPTO_get_id_callback() (NULL) # define CRYPTO_thread_id() (0UL) -# endif /* OPENSSL_API_COMPAT < 0x10000000L */ +# endif /* OPENSSL_API_1_0_0 */ # define CRYPTO_set_dynlock_create_callback(dyn_create_function) # define CRYPTO_set_dynlock_lock_callback(dyn_lock_function) @@ -258,7 +258,7 @@ typedef struct crypto_threadid_st { # define CRYPTO_get_dynlock_create_callback() (NULL) # define CRYPTO_get_dynlock_lock_callback() (NULL) # define CRYPTO_get_dynlock_destroy_callback() (NULL) -# endif /* OPENSSL_API_COMPAT < 0x10100000L */ +# endif /* OPENSSL_API_1_1_0 */ int CRYPTO_set_mem_functions( void *(*m) (size_t, const char *, int), @@ -327,7 +327,7 @@ int CRYPTO_mem_leaks(BIO *bio); /* die if we have to */ ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define OpenSSLDie(f,l,a) OPENSSL_die((a),(f),(l)) # endif # define OPENSSL_assert(e) \ diff --git a/include/openssl/dh.h b/include/openssl/dh.h index 3527540cdd..d997e0deab 100644 --- a/include/openssl/dh.h +++ b/include/openssl/dh.h @@ -17,7 +17,7 @@ # include <openssl/bio.h> # include <openssl/asn1.h> # include <openssl/ossl_typ.h> -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # include <openssl/bn.h> # endif # include <openssl/dherr.h> @@ -34,7 +34,7 @@ extern "C" { # define DH_FLAG_CACHE_MONT_P 0x01 -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 /* * Does nothing. Previously this switched off constant time behaviour. */ diff --git a/include/openssl/dsa.h b/include/openssl/dsa.h index 30454f1a48..ba7fcfeb64 100644 --- a/include/openssl/dsa.h +++ b/include/openssl/dsa.h @@ -21,7 +21,7 @@ extern "C" { # include <openssl/crypto.h> # include <openssl/ossl_typ.h> # include <openssl/bn.h> -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # include <openssl/dh.h> # endif # include <openssl/dsaerr.h> @@ -33,7 +33,7 @@ extern "C" { # define OPENSSL_DSA_FIPS_MIN_MODULUS_BITS 1024 # define DSA_FLAG_CACHE_MONT_P 0x01 -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 /* * Does nothing. Previously this switched off constant time behaviour. */ diff --git a/include/openssl/ec.h b/include/openssl/ec.h index 90a40299a1..beb197cc82 100644 --- a/include/openssl/ec.h +++ b/include/openssl/ec.h @@ -16,7 +16,7 @@ # ifndef OPENSSL_NO_EC # include <openssl/asn1.h> # include <openssl/symhacks.h> -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # include <openssl/bn.h> # endif # include <openssl/ecerr.h> diff --git a/include/openssl/engine.h b/include/openssl/engine.h index 0780f0fb5f..4c0afbb44f 100644 --- a/include/openssl/engine.h +++ b/include/openssl/engine.h @@ -14,7 +14,7 @@ # include <openssl/opensslconf.h> # ifndef OPENSSL_NO_ENGINE -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # include <openssl/bn.h> # include <openssl/rsa.h> # include <openssl/dsa.h> @@ -320,7 +320,7 @@ int ENGINE_remove(ENGINE *e); /* Retrieve an engine from the list by its unique "id" value. */ ENGINE *ENGINE_by_id(const char *id); -#if OPENSSL_API_COMPAT < 0x10100000L +#if !OPENSSL_API_1_1_0 # define ENGINE_load_openssl() \ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_OPENSSL, NULL) # define ENGINE_load_dynamic() \ @@ -494,7 +494,7 @@ int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns); int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg); void *ENGINE_get_ex_data(const ENGINE *e, int idx); -#if OPENSSL_API_COMPAT < 0x10100000L +#if !OPENSSL_API_1_1_0 /* * This function previously cleaned up anything that needs it. Auto-deinit will * now take care of it so it is no longer required to call this function. diff --git a/include/openssl/err.h b/include/openssl/err.h index 6cae1a3651..6cde714334 100644 --- a/include/openssl/err.h +++ b/include/openssl/err.h @@ -250,7 +250,7 @@ int ERR_load_strings_const(const ERR_STRING_DATA *str); int ERR_unload_strings(int lib, ERR_STRING_DATA *str); int ERR_load_ERR_strings(void); -#if OPENSSL_API_COMPAT < 0x10100000L +#if !OPENSSL_API_1_1_0 # define ERR_load_crypto_strings() \ OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL) # define ERR_free_strings() while(0) continue diff --git a/include/openssl/evp.h b/include/openssl/evp.h index d22956d343..36249b4201 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -486,7 +486,7 @@ void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data); void *EVP_CIPHER_CTX_get_cipher_data(const EVP_CIPHER_CTX *ctx); void *EVP_CIPHER_CTX_set_cipher_data(EVP_CIPHER_CTX *ctx, void *cipher_data); # define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define EVP_CIPHER_CTX_flags(c) EVP_CIPHER_flags(EVP_CIPHER_CTX_cipher(c)) # endif # define EVP_CIPHER_CTX_mode(c) EVP_CIPHER_mode(EVP_CIPHER_CTX_cipher(c)) @@ -670,7 +670,7 @@ int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define EVP_CIPHER_CTX_init(c) EVP_CIPHER_CTX_reset(c) # define EVP_CIPHER_CTX_cleanup(c) EVP_CIPHER_CTX_reset(c) # endif @@ -938,7 +938,7 @@ const EVP_CIPHER *EVP_sm4_ofb(void); const EVP_CIPHER *EVP_sm4_ctr(void); # endif -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define OPENSSL_add_all_algorithms_conf() \ OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \ | OPENSSL_INIT_ADD_ALL_DIGESTS \ diff --git a/include/openssl/hmac.h b/include/openssl/hmac.h index e24dde2a57..ab12a89162 100644 --- a/include/openssl/hmac.h +++ b/include/openssl/hmac.h @@ -14,7 +14,7 @@ # include <openssl/evp.h> -# if OPENSSL_API_COMPAT < 0x30000000L +# if !OPENSSL_API_3 # define HMAC_MAX_MD_CBLOCK 128 /* Deprecated */ # endif diff --git a/include/openssl/idea.h b/include/openssl/idea.h index 4334f3ea71..56a8e609d1 100644 --- a/include/openssl/idea.h +++ b/include/openssl/idea.h @@ -45,7 +45,7 @@ void IDEA_ofb64_encrypt(const unsigned char *in, unsigned char *out, int *num); void IDEA_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define idea_options IDEA_options # define idea_ecb_encrypt IDEA_ecb_encrypt # define idea_set_encrypt_key IDEA_set_encrypt_key diff --git a/include/openssl/lhash.h b/include/openssl/lhash.h index 88d7d977b9..b7f6129ce2 100644 --- a/include/openssl/lhash.h +++ b/include/openssl/lhash.h @@ -91,7 +91,7 @@ void OPENSSL_LH_stats_bio(const OPENSSL_LHASH *lh, BIO *out); void OPENSSL_LH_node_stats_bio(const OPENSSL_LHASH *lh, BIO *out); void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define _LHASH OPENSSL_LHASH # define LHASH_NODE OPENSSL_LH_NODE # define lh_error OPENSSL_LH_error diff --git a/include/openssl/objects.h b/include/openssl/objects.h index 8e1eb0f6c3..f14da86c3f 100644 --- a/include/openssl/objects.h +++ b/include/openssl/objects.h @@ -156,7 +156,7 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, int OBJ_new_nid(int num); int OBJ_add_object(const ASN1_OBJECT *obj); int OBJ_create(const char *oid, const char *sn, const char *ln); -#if OPENSSL_API_COMPAT < 0x10100000L +#if !OPENSSL_API_1_1_0 # define OBJ_cleanup() while(0) continue #endif int OBJ_create_objects(BIO *in); diff --git a/include/openssl/opensslconf.h.in b/include/openssl/opensslconf.h.in index 12b16631e8..f306e489ea 100644 --- a/include/openssl/opensslconf.h.in +++ b/include/openssl/opensslconf.h.in @@ -52,9 +52,13 @@ extern "C" { /* * Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the - * declarations of functions deprecated in or before <version>. Otherwise, they - * still won't see them if the library has been built to disable deprecated - * functions. + * declarations of functions deprecated in or before <version>. If this is + * undefined, the value of the macro OPENSSL_API_MIN above is the default. + * + * For any version number up until version 1.1.x, <version> is expected to be + * the calculated version number 0xMNNFFPPSL. For version numbers 3.0.0 and + * on, <version> is expected to be only the major version number (i.e. 3 for + * version 3.0.0). */ #ifndef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f; @@ -66,23 +70,36 @@ extern "C" { # endif #endif -#ifndef OPENSSL_FILE -# ifdef OPENSSL_NO_FILENAMES -# define OPENSSL_FILE "" -# define OPENSSL_LINE 0 -# else -# define OPENSSL_FILE __FILE__ -# define OPENSSL_LINE __LINE__ -# endif -#endif +/* + * We convert the OPENSSL_API_COMPAT value to an API level. The API level + * is the major version number for 3.0.0 and on. For earlier versions, it + * uses this scheme, which is close enough for our purposes: + * + * 0.x.y 0 (0.9.8 was the last release in this series) + * 1.0.x 1 (1.0.2 was the last release in this series) + * 1.1.x 2 (1.1.1 was the last release in this series) + */ -#ifndef OPENSSL_MIN_API -# define OPENSSL_MIN_API 0 +/* In case someone defined both */ +#if defined(OPENSSL_API_COMPAT) && defined(OPENSSL_API_LEVEL) +# error "Disallowed to defined both OPENSSL_API_COMPAT and OPENSSL_API_LEVEL" #endif -#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API -# undef OPENSSL_API_COMPAT -# define OPENSSL_API_COMPAT OPENSSL_MIN_API +#ifndef OPENSSL_API_COMPAT +# define OPENSSL_API_LEVEL OPENSSL_MIN_API +#else +# if (OPENSSL_API_COMPAT < 0x1000L) /* Major version numbers up to 16777215 */ +# define OPENSSL_API_LEVEL OPENSSL_API_COMPAT +# elif (OPENSSL_API_COMPAT & 0xF0000000L) == 0x00000000L +# define OPENSSL_API_LEVEL 0 +# elif (OPENSSL_API_COMPAT & 0xFFF00000L) == 0x10000000L +# define OPENSSL_API_LEVEL 1 +# elif (OPENSSL_API_COMPAT & 0xFFF00000L) == 0x10100000L +# define OPENSSL_API_LEVEL 2 +# else +/ * Major number 3 to 15 */ +# define OPENSSL_API_LEVEL ((OPENSSL_API_COMPAT >> 28) & 0xF) +# endif #endif /* @@ -91,34 +108,55 @@ extern "C" { */ #if OPENSSL_VERSION_MAJOR < 4 # define DEPRECATEDIN_4(f) f; -#elif OPENSSL_API_COMPAT < 0x40000000L +# define OPENSSL_API_4 0 +#elif OPENSSL_API_LEVEL < 4 # define DEPRECATEDIN_4(f) DECLARE_DEPRECATED(f) +# define OPENSSL_API_4 0 #else # define DEPRECATEDIN_4(f) +# define OPENSSL_API_4 1 #endif -#if OPENSSL_API_COMPAT < 0x30000000L +#if OPENSSL_API_LEVEL < 3 # define DEPRECATEDIN_3(f) DECLARE_DEPRECATED(f) +# define OPENSSL_API_3 0 #else # define DEPRECATEDIN_3(f) +# define OPENSSL_API_3 1 #endif -#if OPENSSL_API_COMPAT < 0x10100000L +#if OPENSSL_API_LEVEL < 2 # define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) +# define OPENSSL_API_1_1_0 0 #else # define DEPRECATEDIN_1_1_0(f) +# define OPENSSL_API_1_1_0 1 #endif -#if OPENSSL_API_COMPAT < 0x10000000L +#if OPENSSL_API_LEVEL < 1 # define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) +# define OPENSSL_API_1_0_0 0 #else # define DEPRECATEDIN_1_0_0(f) +# define OPENSSL_API_1_0_0 1 #endif -#if OPENSSL_API_COMPAT < 0x00908000L +#if OPENSSL_API_LEVEL < 0 # define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) +# define OPENSSL_API_0_9_8 0 #else # define DEPRECATEDIN_0_9_8(f) +# define OPENSSL_API_0_9_8 1 +#endif + +#ifndef OPENSSL_FILE +# ifdef OPENSSL_NO_FILENAMES +# define OPENSSL_FILE "" +# define OPENSSL_LINE 0 +# else +# define OPENSSL_FILE __FILE__ +# define OPENSSL_LINE __LINE__ +# endif #endif /* Generate 80386 code? */ diff --git a/include/openssl/pkcs12.h b/include/openssl/pkcs12.h index 3f43dad6d9..2538abfeaf 100644 --- a/include/openssl/pkcs12.h +++ b/include/openssl/pkcs12.h @@ -55,7 +55,7 @@ typedef struct pkcs12_bag_st PKCS12_BAGS; /* Compatibility macros */ -#if OPENSSL_API_COMPAT < 0x10100000L +#if !OPENSSL_API_1_1_0 # define M_PKCS12_bag_type PKCS12_bag_type # define M_PKCS12_cert_bag_type PKCS12_cert_bag_type diff --git a/include/openssl/rand.h b/include/openssl/rand.h index 38a2a2718f..0d64711f3e 100644 --- a/include/openssl/rand.h +++ b/include/openssl/rand.h @@ -36,7 +36,7 @@ int RAND_set_rand_engine(ENGINE *engine); RAND_METHOD *RAND_OpenSSL(void); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define RAND_cleanup() while(0) continue # endif int RAND_bytes(unsigned char *buf, int num); diff --git a/include/openssl/rand_drbg.h b/include/openssl/rand_drbg.h index 237fe45206..a5e91e30fd 100644 --- a/include/openssl/rand_drbg.h +++ b/include/openssl/rand_drbg.h @@ -36,7 +36,7 @@ /* Used by RAND_DRBG_set_defaults() to set the private DRBG type and flags. */ # define RAND_DRBG_FLAG_PRIVATE 0x10 -# if OPENSSL_API_COMPAT < 0x30000000L +# if !OPENSSL_API_3 /* This #define was replaced by an internal constant and should not be used. */ # define RAND_DRBG_USED_FLAGS (RAND_DRBG_FLAG_CTR_NO_DF) # endif diff --git a/include/openssl/rsa.h b/include/openssl/rsa.h index cdce1264eb..12633b06ab 100644 --- a/include/openssl/rsa.h +++ b/include/openssl/rsa.h @@ -17,7 +17,7 @@ # include <openssl/bio.h> # include <openssl/crypto.h> # include <openssl/ossl_typ.h> -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # include <openssl/bn.h> # endif # include <openssl/rsaerr.h> @@ -73,13 +73,13 @@ extern "C" { * but other engines might not need it */ # define RSA_FLAG_NO_BLINDING 0x0080 -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 /* * Does nothing. Previously this switched off constant time behaviour. */ # define RSA_FLAG_NO_CONSTTIME 0x0000 # endif -# if OPENSSL_API_COMPAT < 0x00908000L +# if !OPENSSL_API_0_9_8 /* deprecated name for the flag*/ /* * new with 0.9.7h; the built-in RSA diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 1e9e8d5721..fe2e479028 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -16,7 +16,7 @@ # include <openssl/opensslconf.h> # include <openssl/comp.h> # include <openssl/bio.h> -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # include <openssl/x509.h> # include <openssl/crypto.h> # include <openssl/buffer.h> @@ -1089,7 +1089,7 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); # define SSL_VERIFY_CLIENT_ONCE 0x04 # define SSL_VERIFY_POST_HANDSHAKE 0x08 -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define OpenSSL_add_ssl_algorithms() SSL_library_init() # define SSLeay_add_ssl_algorithms() SSL_library_init() # endif @@ -1313,7 +1313,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) SSL_ctrl(s,SSL_CTRL_SET_DH_AUTO,onoff,NULL) # define SSL_set_tmp_dh(ssl,dh) \ SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)(dh)) -# if OPENSSL_API_COMPAT < 0x10200000L +# if !OPENSSL_API_3 # define SSL_CTX_set_tmp_ecdh(ctx,ecdh) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)(ecdh)) # define SSL_set_tmp_ecdh(ssl,ecdh) \ @@ -1466,7 +1466,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_get_shared_curve SSL_get_shared_group -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 /* Provide some compatibility macros for removed functionality. */ # define SSL_CTX_need_tmp_RSA(ctx) 0 # define SSL_CTX_set_tmp_rsa(ctx,rsa) 1 @@ -1594,7 +1594,7 @@ __owur int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, const char *dir); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define SSL_load_error_strings() \ OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS \ | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL) @@ -1943,7 +1943,7 @@ void SSL_set_accept_state(SSL *s); __owur long SSL_get_default_timeout(const SSL *s); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define SSL_library_init() OPENSSL_init_ssl(0, NULL) # endif @@ -2072,7 +2072,7 @@ __owur int SSL_COMP_get_id(const SSL_COMP *comp); STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); __owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) *meths); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define SSL_COMP_free_compression_methods() while(0) continue # endif __owur int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm); @@ -2124,7 +2124,7 @@ size_t SSL_get_num_tickets(SSL *s); int SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets); size_t SSL_CTX_get_num_tickets(SSL_CTX *ctx); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define SSL_cache_hit(s) SSL_session_reused(s) # endif diff --git a/include/openssl/stack.h b/include/openssl/stack.h index cfc075057a..c1b5adc4ae 100644 --- a/include/openssl/stack.h +++ b/include/openssl/stack.h @@ -50,7 +50,7 @@ OPENSSL_STACK *OPENSSL_sk_dup(const OPENSSL_STACK *st); void OPENSSL_sk_sort(OPENSSL_STACK *st); int OPENSSL_sk_is_sorted(const OPENSSL_STACK *st); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define _STACK OPENSSL_STACK # define sk_num OPENSSL_sk_num # define sk_value OPENSSL_sk_value diff --git a/include/openssl/tls1.h b/include/openssl/tls1.h index e13b5dd4bc..434dff1500 100644 --- a/include/openssl/tls1.h +++ b/include/openssl/tls1.h @@ -335,7 +335,7 @@ __owur int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain) # define SSL_set_dtlsext_heartbeat_no_requests(ssl, arg) \ SSL_ctrl(ssl,SSL_CTRL_SET_DTLS_EXT_HEARTBEAT_NO_REQUESTS,arg,NULL) -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define SSL_CTRL_TLS_EXT_SEND_HEARTBEAT \ SSL_CTRL_DTLS_EXT_SEND_HEARTBEAT # define SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING \ diff --git a/include/openssl/ui.h b/include/openssl/ui.h index 701dd85928..1d246dc97d 100644 --- a/include/openssl/ui.h +++ b/include/openssl/ui.h @@ -12,7 +12,7 @@ # include <openssl/opensslconf.h> -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # include <openssl/crypto.h> # endif # include <openssl/safestack.h> @@ -21,7 +21,7 @@ # include <openssl/uierr.h> /* For compatibility reasons, the macro OPENSSL_NO_UI is currently retained */ -# if OPENSSL_API_COMPAT < 0x30000000L +# if !OPENSSL_API_3 # ifdef OPENSSL_NO_UI_CONSOLE # define OPENSSL_NO_UI # endif diff --git a/include/openssl/x509.h b/include/openssl/x509.h index 39ca0ba575..874ea2bce2 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -21,7 +21,7 @@ # include <openssl/safestack.h> # include <openssl/ec.h> -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # include <openssl/rsa.h> # include <openssl/dsa.h> # include <openssl/dh.h> @@ -650,7 +650,7 @@ int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); int X509_up_ref(X509 *x); int X509_get_signature_type(const X509 *x); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define X509_get_notBefore X509_getm_notBefore # define X509_get_notAfter X509_getm_notAfter # define X509_set_notBefore X509_set1_notBefore @@ -716,7 +716,7 @@ int X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); int X509_CRL_sort(X509_CRL *crl); int X509_CRL_up_ref(X509_CRL *crl); -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define X509_CRL_set_lastUpdate X509_CRL_set1_lastUpdate # define X509_CRL_set_nextUpdate X509_CRL_set1_nextUpdate #endif diff --git a/include/openssl/x509_vfy.h b/include/openssl/x509_vfy.h index 2adb155970..d2ce309648 100644 --- a/include/openssl/x509_vfy.h +++ b/include/openssl/x509_vfy.h @@ -49,7 +49,7 @@ typedef enum { X509_LU_X509, X509_LU_CRL } X509_LOOKUP_TYPE; -#if OPENSSL_API_COMPAT < 0x10100000L +#if !OPENSSL_API_1_1_0 #define X509_LU_RETRY -1 #define X509_LU_FAIL 0 #endif @@ -187,7 +187,7 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); /* Certificate verify flags */ -# if OPENSSL_API_COMPAT < 0x10100000L +# if !OPENSSL_API_1_1_0 # define X509_V_FLAG_CB_ISSUER_CHECK 0x0 /* Deprecated */ # endif /* Use check time instead of current time */ @@ -357,7 +357,7 @@ X509_STORE_CTX_lookup_certs_fn X509_STORE_CTX_get_lookup_certs(X509_STORE_CTX *c X509_STORE_CTX_lookup_crls_fn X509_STORE_CTX_get_lookup_crls(X509_STORE_CTX *ctx); X509_STORE_CTX_cleanup_fn X509_STORE_CTX_get_cleanup(X509_STORE_CTX *ctx); -#if OPENSSL_API_COMPAT < 0x10100000L +#if !OPENSSL_API_1_1_0 # define X509_STORE_CTX_get_chain X509_STORE_CTX_get0_chain # define X509_STORE_CTX_set_chain X509_STORE_CTX_set0_untrusted # define X509_STORE_CTX_trusted_stack X509_STORE_CTX_set0_trusted_stack diff --git a/include/openssl/x509v3.h b/include/openssl/x509v3.h index fe1791c681..a4fecd5c07 100644 --- a/include/openssl/x509v3.h +++ b/include/openssl/x509v3.h @@ -629,7 +629,7 @@ X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags); -#if OPENSSL_API_COMPAT < 0x10100000L +#if !OPENSSL_API_1_1_0 /* The new declarations are in crypto.h, but the old ones were here. */ # define hex_to_string OPENSSL_buf2hexstr # define string_to_hex OPENSSL_hexstr2buf |