|
47 | 47 | end |
48 | 48 | end |
49 | 49 |
|
50 | | -result = checking_for("OpenSSL version is 0.9.8 or later") { |
51 | | - try_static_assert("OPENSSL_VERSION_NUMBER >= 0x00908000L", "openssl/opensslv.h") |
52 | | -} |
53 | | -unless result |
54 | | - raise "OpenSSL 0.9.8 or later required." |
55 | | -end |
56 | | - |
57 | | -unless OpenSSL.check_func("SSL_library_init()", "openssl/ssl.h") |
58 | | - raise "Ignore OpenSSL broken by Apple.\nPlease use another openssl. (e.g. using `configure --with-openssl-dir=/path/to/openssl')" |
| 50 | +unless checking_for("OpenSSL version is 1.0.1 or later") { |
| 51 | + try_static_assert("OPENSSL_VERSION_NUMBER >= 0x10001000L", "openssl/opensslv.h") } |
| 52 | + raise "OpenSSL >= 1.0.1 or LibreSSL is required" |
59 | 53 | end |
60 | 54 |
|
61 | 55 | Logging::message "=== Checking for OpenSSL features... ===\n" |
62 | 56 | # compile options |
63 | 57 |
|
64 | | -# check OPENSSL_NO_{SSL2,SSL3_METHOD} macro: on some environment, these symbols |
65 | | -# exist even if compiled with no-ssl2 or no-ssl3-method. |
66 | | -unless have_macro("OPENSSL_NO_SSL2", "openssl/opensslconf.h") |
67 | | - have_func("SSLv2_method") |
68 | | -end |
69 | | -unless have_macro("OPENSSL_NO_SSL3_METHOD", "openssl/opensslconf.h") |
70 | | - have_func("SSLv3_method") |
71 | | -end |
72 | | -have_func("TLSv1_1_method") |
73 | | -have_func("TLSv1_2_method") |
| 58 | +# SSLv2 and SSLv3 may be removed in future versions of OpenSSL, and even macros |
| 59 | +# like OPENSSL_NO_SSL2 may not be defined. |
| 60 | +have_func("SSLv2_method") |
| 61 | +have_func("SSLv3_method") |
74 | 62 | have_func("RAND_egd") |
75 | 63 | engines = %w{builtin_engines openbsd_dev_crypto dynamic 4758cca aep atalla chil |
76 | 64 | cswift nuron sureware ubsec padlock capi gmp gost cryptodev aesni} |
77 | 65 | engines.each { |name| |
78 | 66 | OpenSSL.check_func_or_macro("ENGINE_load_#{name}", "openssl/engine.h") |
79 | 67 | } |
80 | 68 |
|
81 | | -# added in 0.9.8X |
82 | | -have_func("EVP_CIPHER_CTX_new") |
83 | | -have_func("EVP_CIPHER_CTX_free") |
84 | | -OpenSSL.check_func_or_macro("SSL_CTX_clear_options", "openssl/ssl.h") |
85 | | - |
86 | | -# added in 1.0.0 |
87 | | -have_func("ASN1_TIME_adj") |
88 | | -have_func("EVP_CIPHER_CTX_copy") |
89 | | -have_func("EVP_PKEY_base_id") |
90 | | -have_func("HMAC_CTX_copy") |
91 | | -have_func("PKCS5_PBKDF2_HMAC") |
92 | | -have_func("X509_NAME_hash_old") |
93 | | -have_func("X509_STORE_CTX_get0_current_crl") |
94 | | -have_func("X509_STORE_set_verify_cb") |
95 | | -have_func("i2d_ASN1_SET_ANY") |
96 | | -have_func("SSL_SESSION_cmp") # removed |
97 | | -OpenSSL.check_func_or_macro("SSL_set_tlsext_host_name", "openssl/ssl.h") |
98 | | -have_struct_member("CRYPTO_THREADID", "ptr", "openssl/crypto.h") |
99 | | -have_func("EVP_PKEY_get0") |
100 | | - |
101 | | -# added in 1.0.1 |
102 | | -have_func("SSL_CTX_set_next_proto_select_cb") |
103 | | -have_macro("EVP_CTRL_GCM_GET_TAG", ['openssl/evp.h']) && $defs.push("-DHAVE_AUTHENTICATED_ENCRYPTION") |
104 | | - |
105 | 69 | # added in 1.0.2 |
106 | 70 | have_func("EC_curve_nist2nid") |
107 | 71 | have_func("X509_REVOKED_dup") |
|
0 commit comments