openssl 3.3.3 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +3 -0
- data/History.md +81 -12
- data/README.md +12 -11
- data/ext/openssl/extconf.rb +29 -72
- data/ext/openssl/openssl_missing.h +0 -233
- data/ext/openssl/ossl.c +279 -300
- data/ext/openssl/ossl.h +13 -9
- data/ext/openssl/ossl_asn1.c +610 -423
- data/ext/openssl/ossl_asn1.h +15 -1
- data/ext/openssl/ossl_bio.c +3 -3
- data/ext/openssl/ossl_bn.c +286 -291
- data/ext/openssl/ossl_cipher.c +252 -203
- data/ext/openssl/ossl_cipher.h +10 -1
- data/ext/openssl/ossl_config.c +1 -6
- data/ext/openssl/ossl_digest.c +74 -43
- data/ext/openssl/ossl_digest.h +9 -1
- data/ext/openssl/ossl_engine.c +39 -103
- data/ext/openssl/ossl_hmac.c +30 -36
- data/ext/openssl/ossl_kdf.c +42 -53
- data/ext/openssl/ossl_ns_spki.c +27 -32
- data/ext/openssl/ossl_ocsp.c +209 -236
- data/ext/openssl/ossl_pkcs12.c +26 -26
- data/ext/openssl/ossl_pkcs7.c +176 -146
- data/ext/openssl/ossl_pkey.c +102 -158
- data/ext/openssl/ossl_pkey.h +99 -99
- data/ext/openssl/ossl_pkey_dh.c +31 -68
- data/ext/openssl/ossl_pkey_dsa.c +15 -54
- data/ext/openssl/ossl_pkey_ec.c +179 -237
- data/ext/openssl/ossl_pkey_rsa.c +56 -103
- data/ext/openssl/ossl_provider.c +0 -5
- data/ext/openssl/ossl_rand.c +7 -14
- data/ext/openssl/ossl_ssl.c +478 -353
- data/ext/openssl/ossl_ssl.h +8 -8
- data/ext/openssl/ossl_ssl_session.c +93 -97
- data/ext/openssl/ossl_ts.c +79 -125
- data/ext/openssl/ossl_x509.c +9 -28
- data/ext/openssl/ossl_x509.h +6 -6
- data/ext/openssl/ossl_x509attr.c +35 -57
- data/ext/openssl/ossl_x509cert.c +73 -104
- data/ext/openssl/ossl_x509crl.c +80 -91
- data/ext/openssl/ossl_x509ext.c +45 -75
- data/ext/openssl/ossl_x509name.c +64 -91
- data/ext/openssl/ossl_x509req.c +57 -64
- data/ext/openssl/ossl_x509revoked.c +29 -44
- data/ext/openssl/ossl_x509store.c +41 -57
- data/lib/openssl/buffering.rb +30 -24
- data/lib/openssl/digest.rb +1 -1
- data/lib/openssl/pkey.rb +71 -49
- data/lib/openssl/ssl.rb +12 -79
- data/lib/openssl/version.rb +2 -1
- data/lib/openssl/x509.rb +9 -0
- data/lib/openssl.rb +9 -6
- metadata +2 -4
- data/ext/openssl/openssl_missing.c +0 -41
- data/lib/openssl/asn1.rb +0 -188
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6fcaf50b270f86ea2f4b858ebc39103f84dab425927ebe374763123882887ddf
|
|
4
|
+
data.tar.gz: 9443864ee52834e8c8fb065c6e560e5a7072eedb14ebf59cc7dbeff717ecfb6b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9188ba72659d39dc3a61992e802f055d68ba0d282a0de671f691d8f96e3cdbcdbd3bf9ee1dec144afb6dba022227256d2bb2878b2dc053a115768d153b653325
|
|
7
|
+
data.tar.gz: cf5b06f6f262d8e2be158ffe8b94df87cf3b30d866722bb0b57a2ef3bdfa1792bffd2860988b3ed85ca590915ad0cb4bfcc87c0a0941b97f5bf736e2a8c43bb3
|
data/CONTRIBUTING.md
CHANGED
|
@@ -224,6 +224,9 @@ $ OPENSSL_CONF=$OPENSSL_DIR/ssl/openssl_fips.cnf \
|
|
|
224
224
|
The GitHub Actions workflow file [`test.yml`][GitHub test.yml] contains useful
|
|
225
225
|
information for building OpenSSL/LibreSSL and testing against them.
|
|
226
226
|
|
|
227
|
+
## Debugging
|
|
228
|
+
|
|
229
|
+
You can use the `OpenSSL.debug = true` to print additional error strings.
|
|
227
230
|
|
|
228
231
|
## Relation with Ruby source tree
|
|
229
232
|
|
data/History.md
CHANGED
|
@@ -1,7 +1,86 @@
|
|
|
1
|
-
Version
|
|
1
|
+
Version 4.0.0
|
|
2
2
|
=============
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Compatibility
|
|
5
|
+
-------------
|
|
6
|
+
|
|
7
|
+
* Ruby >= 2.7
|
|
8
|
+
* OpenSSL >= 1.1.1, LibreSSL >= 3.9, and AWS-LC 1.66.0
|
|
9
|
+
- Removed support for OpenSSL 1.0.2-1.1.0 and LibreSSL 3.1-3.8.
|
|
10
|
+
[[GitHub #835]](https://github.com/ruby/openssl/issues/835)
|
|
11
|
+
- Added support for AWS-LC.
|
|
12
|
+
[[GitHub #833]](https://github.com/ruby/openssl/issues/833)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
Notable changes
|
|
16
|
+
---------------
|
|
17
|
+
|
|
18
|
+
* `OpenSSL::SSL`
|
|
19
|
+
- Reduce overhead when writing to `OpenSSL::SSL::SSLSocket`. `#syswrite` no
|
|
20
|
+
longer creates a temporary String object.
|
|
21
|
+
[[GitHub #831]](https://github.com/ruby/openssl/pull/831)
|
|
22
|
+
- Make `OpenSSL::SSL::SSLContext#min_version=` and `#max_version=` wrap the
|
|
23
|
+
corresponding OpenSSL APIs directly, and remove the fallback to SSL options.
|
|
24
|
+
[[GitHub #849]](https://github.com/ruby/openssl/pull/849)
|
|
25
|
+
- Add `OpenSSL::SSL::SSLContext#sigalgs=` and `#client_sigalgs=` for
|
|
26
|
+
specifying signature algorithms to use for connections.
|
|
27
|
+
[[GitHub #895]](https://github.com/ruby/openssl/pull/895)
|
|
28
|
+
- Rename `OpenSSL::SSL::SSLContext#ecdh_curves=` to `#groups=` following
|
|
29
|
+
the underlying OpenSSL API rename. This method is no longer specific to
|
|
30
|
+
ECDHE. The old method remains as an alias.
|
|
31
|
+
[[GitHub #900]](https://github.com/ruby/openssl/pull/900)
|
|
32
|
+
- Add `OpenSSL::SSL::SSLSocket#sigalg`, `#peer_sigalg`, and `#group` for
|
|
33
|
+
getting the signature algorithm and the key agreement group used in the
|
|
34
|
+
current connection.
|
|
35
|
+
[[GitHub #908]](https://github.com/ruby/openssl/pull/908)
|
|
36
|
+
- Enable `SSL_CTX_set_dh_auto()` for servers by default.
|
|
37
|
+
[[GitHub #924]](https://github.com/ruby/openssl/pull/924)
|
|
38
|
+
- Improve Ractor compatibility. Note that the internal-use constant
|
|
39
|
+
`OpenSSL::SSL::SSLContext::DEFAULT_PARAMS` is now frozen.
|
|
40
|
+
[[GitHub #925]](https://github.com/ruby/openssl/pull/925)
|
|
41
|
+
* `OpenSSL::PKey`
|
|
42
|
+
- Remove `OpenSSL::PKey::EC::Point#mul` support with array arguments. The
|
|
43
|
+
underlying OpenSSL API has been removed, and the method has been deprecated
|
|
44
|
+
since ruby/openssl v3.0.0.
|
|
45
|
+
[[GitHub #843]](https://github.com/ruby/openssl/pull/843)
|
|
46
|
+
- `OpenSSL::PKey::{RSA,DSA,DH}#params` uses `nil` to indicate missing fields
|
|
47
|
+
instead of the number `0`.
|
|
48
|
+
[[GitHub #774]](https://github.com/ruby/openssl/pull/774)
|
|
49
|
+
- Unify `OpenSSL::PKey::PKeyError` classes. The former subclasses
|
|
50
|
+
`OpenSSL::PKey::DHError`, `OpenSSL::PKey::DSAError`,
|
|
51
|
+
`OpenSSL::PKey::ECError`, and `OpenSSL::PKey::RSAError` have been merged
|
|
52
|
+
into a single class.
|
|
53
|
+
[[GitHub #929]](https://github.com/ruby/openssl/pull/929)
|
|
54
|
+
* `OpenSSL::Cipher`
|
|
55
|
+
- `OpenSSL::Cipher#encrypt` and `#decrypt` no longer accept arguments.
|
|
56
|
+
Passing passwords has been deprecated since Ruby 1.8.2 (released in 2004).
|
|
57
|
+
[[GitHub #887]](https://github.com/ruby/openssl/pull/887)
|
|
58
|
+
- `OpenSSL::Cipher#final` raises `OpenSSL::Cipher::AuthTagError` when the
|
|
59
|
+
integrity check fails for AEAD ciphers. `OpenSSL::Cipher::AuthTagError` is a
|
|
60
|
+
new subclass of `OpenSSL::Cipher::CipherError`, which was previously raised.
|
|
61
|
+
[[GitHub #939]](https://github.com/ruby/openssl/pull/939)
|
|
62
|
+
- `OpenSSL::Cipher.new` now raises `OpenSSL::Cipher::CipherError` instead of
|
|
63
|
+
`RuntimeError` when OpenSSL does not recognize the algorithm.
|
|
64
|
+
[[GitHub #958]](https://github.com/ruby/openssl/pull/958)
|
|
65
|
+
- Add support for "fetched" cipher algorithms with OpenSSL 3.0 or later.
|
|
66
|
+
[[GitHub #958]](https://github.com/ruby/openssl/pull/958)
|
|
67
|
+
* `OpenSSL::Digest`
|
|
68
|
+
- `OpenSSL::Digest.new` now raises `OpenSSL::Digest::DigestError` instead of
|
|
69
|
+
`RuntimeError` when OpenSSL does not recognize the algorithm.
|
|
70
|
+
[[GitHub #958]](https://github.com/ruby/openssl/pull/958)
|
|
71
|
+
- Add support for "fetched" digest algorithms with OpenSSL 3.0 or later.
|
|
72
|
+
[[GitHub #958]](https://github.com/ruby/openssl/pull/958)
|
|
73
|
+
* `OpenSSL::ASN1.decode` now assumes a 1950-2049 year range for `UTCTime`
|
|
74
|
+
according to RFC 5280. It previously used a 1969-2068 range. The encoder
|
|
75
|
+
has always used the 1950-2049 range.
|
|
76
|
+
[[GitHub #909]](https://github.com/ruby/openssl/pull/909)
|
|
77
|
+
* `OpenSSL::OpenSSLError`, the base class for all ruby/openssl errors, carry
|
|
78
|
+
an additional attribute `#errors` to keep the content of OpenSSL's error
|
|
79
|
+
queue. Also, add `#detailed_message` for Ruby 3.2 or later.
|
|
80
|
+
[[GitHub #976]](https://github.com/ruby/openssl/pull/976)
|
|
81
|
+
* `OpenSSL::PKCS7.new` raises `OpenSSL::PKCS7::PKCS7Error` instead of
|
|
82
|
+
`ArgumentError` on error to be consistent with other constructors.
|
|
83
|
+
[[GitHub #983]](https://github.com/ruby/openssl/pull/983)
|
|
5
84
|
|
|
6
85
|
|
|
7
86
|
Version 3.3.2
|
|
@@ -92,16 +171,6 @@ And various non-user-visible changes and bug fixes. Please see the commit
|
|
|
92
171
|
history for more details.
|
|
93
172
|
|
|
94
173
|
|
|
95
|
-
Version 3.2.4
|
|
96
|
-
=============
|
|
97
|
-
|
|
98
|
-
Notable changes
|
|
99
|
-
---------------
|
|
100
|
-
|
|
101
|
-
* Add support for OpenSSL 4.0.
|
|
102
|
-
[[GitHub #1051]](https://github.com/ruby/openssl/pull/1051)
|
|
103
|
-
|
|
104
|
-
|
|
105
174
|
Version 3.2.3
|
|
106
175
|
=============
|
|
107
176
|
|
data/README.md
CHANGED
|
@@ -16,17 +16,18 @@ the standard library of Ruby. This is called a [default gem].
|
|
|
16
16
|
Each stable branch of OpenSSL for Ruby will remain supported as long as it is
|
|
17
17
|
included as a default gem in [supported Ruby branches][Ruby Maintenance Branches].
|
|
18
18
|
|
|
19
|
-
|Version|
|
|
20
|
-
|
|
21
|
-
|
|
|
22
|
-
|3.
|
|
23
|
-
|3.
|
|
24
|
-
|3.
|
|
25
|
-
|
|
|
26
|
-
|2.
|
|
27
|
-
|2.
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
|Version|Minimum Ruby|OpenSSL compatibility |Bundled with|Maintenance |
|
|
20
|
+
|-------|------------|-----------------------------------------|------------|-------------|
|
|
21
|
+
|4.0.x |Ruby 2.7 |OpenSSL 1.1.1-3.x, LibreSSL 3.9+, AWS-LC |Ruby 4.0 |bug fixes |
|
|
22
|
+
|3.3.x |Ruby 2.7 |OpenSSL 1.0.2-3.x, LibreSSL 3.1+ |Ruby 3.4 |bug fixes |
|
|
23
|
+
|3.2.x |Ruby 2.7 |OpenSSL 1.0.2-3.x, LibreSSL 3.1+ |Ruby 3.3 |bug fixes |
|
|
24
|
+
|3.1.x |Ruby 2.6 |OpenSSL 1.0.2-3.x, LibreSSL 3.1+ |Ruby 3.2 |security only|
|
|
25
|
+
|3.0.x |Ruby 2.6 |OpenSSL 1.0.2-3.x, LibreSSL 3.1+ |Ruby 3.1 |end-of-life |
|
|
26
|
+
|2.2.x |Ruby 2.3 |OpenSSL 1.0.1-1.1.1, LibreSSL 2.9+ |Ruby 3.0 |end-of-life |
|
|
27
|
+
|2.1.x |Ruby 2.3 |OpenSSL 1.0.1-1.1.1, LibreSSL 2.5+ |Ruby 2.5-2.7|end-of-life |
|
|
28
|
+
|2.0.x |Ruby 2.3 |OpenSSL 0.9.8-1.1.1, LibreSSL 2.3+ |Ruby 2.4 |end-of-life |
|
|
29
|
+
|
|
30
|
+
[default gem]: https://docs.ruby-lang.org/en/master/standard_library_md.html
|
|
30
31
|
[Ruby Maintenance Branches]: https://www.ruby-lang.org/en/downloads/branches/
|
|
31
32
|
|
|
32
33
|
## Installation
|
data/ext/openssl/extconf.rb
CHANGED
|
@@ -34,14 +34,16 @@ if ssl_ldir&.split(File::PATH_SEPARATOR)&.none? { |dir| File.directory?(dir) }
|
|
|
34
34
|
"library directories."
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
dir_config("kerberos")
|
|
38
|
-
|
|
39
37
|
Logging::message "=== OpenSSL for Ruby configurator ===\n"
|
|
40
38
|
|
|
41
39
|
$defs.push("-D""OPENSSL_SUPPRESS_DEPRECATED")
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
have_func("
|
|
41
|
+
# Missing in TruffleRuby
|
|
42
|
+
have_func("rb_call_super_kw(0, NULL, 0)", "ruby.h")
|
|
43
|
+
# Ruby 3.1
|
|
44
|
+
have_func("rb_io_descriptor", "ruby/io.h")
|
|
45
|
+
have_func("rb_io_maybe_wait(0, Qnil, Qnil, Qnil)", "ruby/io.h")
|
|
46
|
+
# Ruby 3.2
|
|
45
47
|
have_func("rb_io_timeout", "ruby/io.h")
|
|
46
48
|
|
|
47
49
|
Logging::message "=== Checking for system dependent stuff... ===\n"
|
|
@@ -60,7 +62,6 @@ end
|
|
|
60
62
|
def find_openssl_library
|
|
61
63
|
if $mswin || $mingw
|
|
62
64
|
# required for static OpenSSL libraries
|
|
63
|
-
have_library("gdi32") # OpenSSL <= 1.0.2 (for RAND_screen())
|
|
64
65
|
have_library("crypt32")
|
|
65
66
|
end
|
|
66
67
|
|
|
@@ -77,12 +78,6 @@ def find_openssl_library
|
|
|
77
78
|
return true
|
|
78
79
|
end
|
|
79
80
|
|
|
80
|
-
# OpenSSL <= 1.0.2: libeay32.lib and ssleay32.lib.
|
|
81
|
-
if have_library("libeay32", "CRYPTO_malloc") &&
|
|
82
|
-
have_library("ssleay32", "SSL_new")
|
|
83
|
-
return true
|
|
84
|
-
end
|
|
85
|
-
|
|
86
81
|
# LibreSSL: libcrypto-##.lib and libssl-##.lib, where ## is the ABI version
|
|
87
82
|
# number. We have to find the version number out by scanning libpath.
|
|
88
83
|
libpath = $LIBPATH.dup
|
|
@@ -120,14 +115,15 @@ end
|
|
|
120
115
|
|
|
121
116
|
version_ok = if have_macro("LIBRESSL_VERSION_NUMBER", "openssl/opensslv.h")
|
|
122
117
|
is_libressl = true
|
|
123
|
-
checking_for("LibreSSL version >= 3.
|
|
124
|
-
try_static_assert("LIBRESSL_VERSION_NUMBER >=
|
|
118
|
+
checking_for("LibreSSL version >= 3.9.0") {
|
|
119
|
+
try_static_assert("LIBRESSL_VERSION_NUMBER >= 0x30900000L", "openssl/opensslv.h") }
|
|
125
120
|
else
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
is_openssl = true
|
|
122
|
+
checking_for("OpenSSL version >= 1.1.1") {
|
|
123
|
+
try_static_assert("OPENSSL_VERSION_NUMBER >= 0x10101000L", "openssl/opensslv.h") }
|
|
128
124
|
end
|
|
129
125
|
unless version_ok
|
|
130
|
-
raise "OpenSSL >= 1.
|
|
126
|
+
raise "OpenSSL >= 1.1.1 or LibreSSL >= 3.9.0 is required"
|
|
131
127
|
end
|
|
132
128
|
|
|
133
129
|
# Prevent wincrypt.h from being included, which defines conflicting macro with openssl/x509.h
|
|
@@ -137,71 +133,26 @@ end
|
|
|
137
133
|
|
|
138
134
|
Logging::message "=== Checking for OpenSSL features... ===\n"
|
|
139
135
|
evp_h = "openssl/evp.h".freeze
|
|
140
|
-
x509_h = "openssl/x509.h".freeze
|
|
141
136
|
ts_h = "openssl/ts.h".freeze
|
|
142
137
|
ssl_h = "openssl/ssl.h".freeze
|
|
143
138
|
|
|
144
139
|
# compile options
|
|
145
140
|
have_func("RAND_egd()", "openssl/rand.h")
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
#
|
|
153
|
-
have_func("i2d_re_X509_tbs(NULL, NULL)", x509_h)
|
|
154
|
-
|
|
155
|
-
# added in 1.1.0
|
|
156
|
-
if !have_struct_member("SSL", "ctx", "openssl/ssl.h") || is_libressl
|
|
157
|
-
$defs.push("-DHAVE_OPAQUE_OPENSSL")
|
|
158
|
-
end
|
|
159
|
-
have_func("EVP_MD_CTX_new()", evp_h)
|
|
160
|
-
have_func("EVP_MD_CTX_free(NULL)", evp_h)
|
|
161
|
-
have_func("EVP_MD_CTX_pkey_ctx(NULL)", evp_h)
|
|
162
|
-
have_func("X509_STORE_get_ex_data(NULL, 0)", x509_h)
|
|
163
|
-
have_func("X509_STORE_set_ex_data(NULL, 0, NULL)", x509_h)
|
|
164
|
-
have_func("X509_STORE_get_ex_new_index(0, NULL, NULL, NULL, NULL)", x509_h)
|
|
165
|
-
have_func("X509_CRL_get0_signature(NULL, NULL, NULL)", x509_h)
|
|
166
|
-
have_func("X509_REQ_get0_signature(NULL, NULL, NULL)", x509_h)
|
|
167
|
-
have_func("X509_REVOKED_get0_serialNumber(NULL)", x509_h)
|
|
168
|
-
have_func("X509_REVOKED_get0_revocationDate(NULL)", x509_h)
|
|
169
|
-
have_func("X509_get0_tbs_sigalg(NULL)", x509_h)
|
|
170
|
-
have_func("X509_STORE_CTX_get0_untrusted(NULL)", x509_h)
|
|
171
|
-
have_func("X509_STORE_CTX_get0_cert(NULL)", x509_h)
|
|
172
|
-
have_func("X509_STORE_CTX_get0_chain(NULL)", x509_h)
|
|
173
|
-
have_func("OCSP_SINGLERESP_get0_id(NULL)", "openssl/ocsp.h")
|
|
174
|
-
have_func("SSL_CTX_get_ciphers(NULL)", ssl_h)
|
|
175
|
-
have_func("X509_up_ref(NULL)", x509_h)
|
|
176
|
-
have_func("X509_CRL_up_ref(NULL)", x509_h)
|
|
177
|
-
have_func("X509_STORE_up_ref(NULL)", x509_h)
|
|
178
|
-
have_func("SSL_SESSION_up_ref(NULL)", ssl_h)
|
|
179
|
-
have_func("EVP_PKEY_up_ref(NULL)", evp_h)
|
|
180
|
-
have_func("SSL_CTX_set_min_proto_version(NULL, 0)", ssl_h)
|
|
181
|
-
have_func("SSL_CTX_get_security_level(NULL)", ssl_h)
|
|
182
|
-
have_func("X509_get0_notBefore(NULL)", x509_h)
|
|
183
|
-
have_func("SSL_SESSION_get_protocol_version(NULL)", ssl_h)
|
|
184
|
-
have_func("TS_STATUS_INFO_get0_status(NULL)", ts_h)
|
|
185
|
-
have_func("TS_STATUS_INFO_get0_text(NULL)", ts_h)
|
|
186
|
-
have_func("TS_STATUS_INFO_get0_failure_info(NULL)", ts_h)
|
|
187
|
-
have_func("TS_VERIFY_CTS_set_certs(NULL, NULL)", ts_h)
|
|
188
|
-
have_func("TS_VERIFY_CTX_set_store(NULL, NULL)", ts_h)
|
|
189
|
-
have_func("TS_VERIFY_CTX_add_flags(NULL, 0)", ts_h)
|
|
190
|
-
have_func("TS_RESP_CTX_set_time_cb(NULL, NULL, NULL)", ts_h)
|
|
141
|
+
|
|
142
|
+
# added in OpenSSL 1.0.2, not in LibreSSL yet
|
|
143
|
+
have_func("SSL_CTX_set1_sigalgs_list(NULL, NULL)", ssl_h)
|
|
144
|
+
# added in OpenSSL 1.0.2, not in LibreSSL or AWS-LC yet
|
|
145
|
+
have_func("SSL_CTX_set1_client_sigalgs_list(NULL, NULL)", ssl_h)
|
|
146
|
+
|
|
147
|
+
# added in 1.1.0, currently not in LibreSSL
|
|
191
148
|
have_func("EVP_PBE_scrypt(\"\", 0, (unsigned char *)\"\", 0, 0, 0, 0, 0, NULL, 0)", evp_h)
|
|
192
|
-
have_func("SSL_CTX_set_post_handshake_auth(NULL, 0)", ssl_h)
|
|
193
|
-
have_func("X509_STORE_get0_param(NULL)", x509_h)
|
|
194
|
-
have_func("ASN1_STRING_get0_data(NULL)", "openssl/asn1.h")
|
|
195
149
|
|
|
196
|
-
# added in 1.1.1
|
|
150
|
+
# added in OpenSSL 1.1.1 and LibreSSL 3.5.0, then removed in LibreSSL 4.0.0
|
|
197
151
|
have_func("EVP_PKEY_check(NULL)", evp_h)
|
|
198
|
-
have_func("EVP_PKEY_new_raw_private_key(0, NULL, (unsigned char *)\"\", 0)", evp_h)
|
|
199
|
-
have_func("SSL_CTX_set_ciphersuites(NULL, \"\")", ssl_h)
|
|
200
152
|
|
|
201
153
|
# added in 3.0.0
|
|
202
|
-
have_func("
|
|
154
|
+
have_func("SSL_CTX_set0_tmp_dh_pkey(NULL, NULL)", ssl_h)
|
|
203
155
|
have_func("ERR_get_error_all(NULL, NULL, NULL, NULL, NULL)", "openssl/err.h")
|
|
204
|
-
have_func("TS_VERIFY_CTX_set_certs(NULL, NULL)", ts_h)
|
|
205
156
|
have_func("SSL_CTX_load_verify_file(NULL, \"\")", ssl_h)
|
|
206
157
|
have_func("BN_check_prime(NULL, NULL, NULL)", "openssl/bn.h")
|
|
207
158
|
have_func("EVP_MD_CTX_get0_md(NULL)", evp_h)
|
|
@@ -209,8 +160,14 @@ have_func("EVP_MD_CTX_get_pkey_ctx(NULL)", evp_h)
|
|
|
209
160
|
have_func("EVP_PKEY_eq(NULL, NULL)", evp_h)
|
|
210
161
|
have_func("EVP_PKEY_dup(NULL)", evp_h)
|
|
211
162
|
|
|
212
|
-
# added in
|
|
213
|
-
have_func("
|
|
163
|
+
# added in 3.2.0
|
|
164
|
+
have_func("SSL_get0_group_name(NULL)", ssl_h)
|
|
165
|
+
|
|
166
|
+
# added in 3.4.0
|
|
167
|
+
have_func("TS_VERIFY_CTX_set0_certs(NULL, NULL)", ts_h)
|
|
168
|
+
|
|
169
|
+
# added in 3.5.0
|
|
170
|
+
have_func("SSL_get0_peer_signature_name(NULL, NULL)", ssl_h)
|
|
214
171
|
|
|
215
172
|
Logging::message "=== Checking done. ===\n"
|
|
216
173
|
|
|
@@ -12,213 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
#include "ruby/config.h"
|
|
14
14
|
|
|
15
|
-
/* added in 1.1.0 */
|
|
16
|
-
#if !defined(HAVE_EVP_MD_CTX_NEW)
|
|
17
|
-
# define EVP_MD_CTX_new EVP_MD_CTX_create
|
|
18
|
-
#endif
|
|
19
|
-
|
|
20
|
-
#if !defined(HAVE_EVP_MD_CTX_FREE)
|
|
21
|
-
# define EVP_MD_CTX_free EVP_MD_CTX_destroy
|
|
22
|
-
#endif
|
|
23
|
-
|
|
24
|
-
#if !defined(HAVE_X509_STORE_GET_EX_DATA)
|
|
25
|
-
# define X509_STORE_get_ex_data(x, idx) \
|
|
26
|
-
CRYPTO_get_ex_data(&(x)->ex_data, (idx))
|
|
27
|
-
#endif
|
|
28
|
-
|
|
29
|
-
#if !defined(HAVE_X509_STORE_SET_EX_DATA)
|
|
30
|
-
# define X509_STORE_set_ex_data(x, idx, data) \
|
|
31
|
-
CRYPTO_set_ex_data(&(x)->ex_data, (idx), (data))
|
|
32
|
-
#endif
|
|
33
|
-
|
|
34
|
-
#if !defined(HAVE_X509_STORE_GET_EX_NEW_INDEX) && !defined(X509_STORE_get_ex_new_index)
|
|
35
|
-
# define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \
|
|
36
|
-
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, (l), (p), \
|
|
37
|
-
(newf), (dupf), (freef))
|
|
38
|
-
#endif
|
|
39
|
-
|
|
40
|
-
#if !defined(HAVE_X509_CRL_GET0_SIGNATURE)
|
|
41
|
-
void ossl_X509_CRL_get0_signature(const X509_CRL *, const ASN1_BIT_STRING **, const X509_ALGOR **);
|
|
42
|
-
# define X509_CRL_get0_signature ossl_X509_CRL_get0_signature
|
|
43
|
-
#endif
|
|
44
|
-
|
|
45
|
-
#if !defined(HAVE_X509_REQ_GET0_SIGNATURE)
|
|
46
|
-
void ossl_X509_REQ_get0_signature(const X509_REQ *, const ASN1_BIT_STRING **, const X509_ALGOR **);
|
|
47
|
-
# define X509_REQ_get0_signature ossl_X509_REQ_get0_signature
|
|
48
|
-
#endif
|
|
49
|
-
|
|
50
|
-
#if !defined(HAVE_X509_REVOKED_GET0_SERIALNUMBER)
|
|
51
|
-
# define X509_REVOKED_get0_serialNumber(x) ((x)->serialNumber)
|
|
52
|
-
#endif
|
|
53
|
-
|
|
54
|
-
#if !defined(HAVE_X509_REVOKED_GET0_REVOCATIONDATE)
|
|
55
|
-
# define X509_REVOKED_get0_revocationDate(x) ((x)->revocationDate)
|
|
56
|
-
#endif
|
|
57
|
-
|
|
58
|
-
#if !defined(HAVE_X509_GET0_TBS_SIGALG)
|
|
59
|
-
# define X509_get0_tbs_sigalg(x) ((x)->cert_info->signature)
|
|
60
|
-
#endif
|
|
61
|
-
|
|
62
|
-
#if !defined(HAVE_X509_STORE_CTX_GET0_UNTRUSTED)
|
|
63
|
-
# define X509_STORE_CTX_get0_untrusted(x) ((x)->untrusted)
|
|
64
|
-
#endif
|
|
65
|
-
|
|
66
|
-
#if !defined(HAVE_X509_STORE_CTX_GET0_CERT)
|
|
67
|
-
# define X509_STORE_CTX_get0_cert(x) ((x)->cert)
|
|
68
|
-
#endif
|
|
69
|
-
|
|
70
|
-
#if !defined(HAVE_X509_STORE_CTX_GET0_CHAIN)
|
|
71
|
-
# define X509_STORE_CTX_get0_chain(ctx) X509_STORE_CTX_get_chain(ctx)
|
|
72
|
-
#endif
|
|
73
|
-
|
|
74
|
-
#if !defined(HAVE_OCSP_SINGLERESP_GET0_ID)
|
|
75
|
-
# define OCSP_SINGLERESP_get0_id(s) ((s)->certId)
|
|
76
|
-
#endif
|
|
77
|
-
|
|
78
|
-
#if !defined(HAVE_SSL_CTX_GET_CIPHERS)
|
|
79
|
-
# define SSL_CTX_get_ciphers(ctx) ((ctx)->cipher_list)
|
|
80
|
-
#endif
|
|
81
|
-
|
|
82
|
-
#if !defined(HAVE_X509_UP_REF)
|
|
83
|
-
# define X509_up_ref(x) \
|
|
84
|
-
CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_X509)
|
|
85
|
-
#endif
|
|
86
|
-
|
|
87
|
-
#if !defined(HAVE_X509_CRL_UP_REF)
|
|
88
|
-
# define X509_CRL_up_ref(x) \
|
|
89
|
-
CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_X509_CRL);
|
|
90
|
-
#endif
|
|
91
|
-
|
|
92
|
-
#if !defined(HAVE_X509_STORE_UP_REF)
|
|
93
|
-
# define X509_STORE_up_ref(x) \
|
|
94
|
-
CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_X509_STORE);
|
|
95
|
-
#endif
|
|
96
|
-
|
|
97
|
-
#if !defined(HAVE_SSL_SESSION_UP_REF)
|
|
98
|
-
# define SSL_SESSION_up_ref(x) \
|
|
99
|
-
CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_SSL_SESSION);
|
|
100
|
-
#endif
|
|
101
|
-
|
|
102
|
-
#if !defined(HAVE_EVP_PKEY_UP_REF)
|
|
103
|
-
# define EVP_PKEY_up_ref(x) \
|
|
104
|
-
CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_EVP_PKEY);
|
|
105
|
-
#endif
|
|
106
|
-
|
|
107
|
-
#if !defined(HAVE_OPAQUE_OPENSSL)
|
|
108
|
-
#define IMPL_PKEY_GETTER(_type, _name) \
|
|
109
|
-
static inline _type *EVP_PKEY_get0_##_type(EVP_PKEY *pkey) { \
|
|
110
|
-
return pkey->pkey._name; }
|
|
111
|
-
#define IMPL_KEY_ACCESSOR2(_type, _group, a1, a2, _fail_cond) \
|
|
112
|
-
static inline void _type##_get0_##_group(const _type *obj, const BIGNUM **a1, const BIGNUM **a2) { \
|
|
113
|
-
if (a1) *a1 = obj->a1; \
|
|
114
|
-
if (a2) *a2 = obj->a2; } \
|
|
115
|
-
static inline int _type##_set0_##_group(_type *obj, BIGNUM *a1, BIGNUM *a2) { \
|
|
116
|
-
if (_fail_cond) return 0; \
|
|
117
|
-
BN_clear_free(obj->a1); obj->a1 = a1; \
|
|
118
|
-
BN_clear_free(obj->a2); obj->a2 = a2; \
|
|
119
|
-
return 1; }
|
|
120
|
-
#define IMPL_KEY_ACCESSOR3(_type, _group, a1, a2, a3, _fail_cond) \
|
|
121
|
-
static inline void _type##_get0_##_group(const _type *obj, const BIGNUM **a1, const BIGNUM **a2, const BIGNUM **a3) { \
|
|
122
|
-
if (a1) *a1 = obj->a1; \
|
|
123
|
-
if (a2) *a2 = obj->a2; \
|
|
124
|
-
if (a3) *a3 = obj->a3; } \
|
|
125
|
-
static inline int _type##_set0_##_group(_type *obj, BIGNUM *a1, BIGNUM *a2, BIGNUM *a3) { \
|
|
126
|
-
if (_fail_cond) return 0; \
|
|
127
|
-
BN_clear_free(obj->a1); obj->a1 = a1; \
|
|
128
|
-
BN_clear_free(obj->a2); obj->a2 = a2; \
|
|
129
|
-
BN_clear_free(obj->a3); obj->a3 = a3; \
|
|
130
|
-
return 1; }
|
|
131
|
-
|
|
132
|
-
#if !defined(OPENSSL_NO_RSA)
|
|
133
|
-
IMPL_PKEY_GETTER(RSA, rsa)
|
|
134
|
-
IMPL_KEY_ACCESSOR3(RSA, key, n, e, d, (n == obj->n || e == obj->e || (obj->d && d == obj->d)))
|
|
135
|
-
IMPL_KEY_ACCESSOR2(RSA, factors, p, q, (p == obj->p || q == obj->q))
|
|
136
|
-
IMPL_KEY_ACCESSOR3(RSA, crt_params, dmp1, dmq1, iqmp, (dmp1 == obj->dmp1 || dmq1 == obj->dmq1 || iqmp == obj->iqmp))
|
|
137
|
-
#endif
|
|
138
|
-
|
|
139
|
-
#if !defined(OPENSSL_NO_DSA)
|
|
140
|
-
IMPL_PKEY_GETTER(DSA, dsa)
|
|
141
|
-
IMPL_KEY_ACCESSOR2(DSA, key, pub_key, priv_key, (pub_key == obj->pub_key || (obj->priv_key && priv_key == obj->priv_key)))
|
|
142
|
-
IMPL_KEY_ACCESSOR3(DSA, pqg, p, q, g, (p == obj->p || q == obj->q || g == obj->g))
|
|
143
|
-
#endif
|
|
144
|
-
|
|
145
|
-
#if !defined(OPENSSL_NO_DH)
|
|
146
|
-
IMPL_PKEY_GETTER(DH, dh)
|
|
147
|
-
IMPL_KEY_ACCESSOR2(DH, key, pub_key, priv_key, (pub_key == obj->pub_key || (obj->priv_key && priv_key == obj->priv_key)))
|
|
148
|
-
IMPL_KEY_ACCESSOR3(DH, pqg, p, q, g, (p == obj->p || (obj->q && q == obj->q) || g == obj->g))
|
|
149
|
-
static inline ENGINE *DH_get0_engine(DH *dh) { return dh->engine; }
|
|
150
|
-
#endif
|
|
151
|
-
|
|
152
|
-
#if !defined(OPENSSL_NO_EC)
|
|
153
|
-
IMPL_PKEY_GETTER(EC_KEY, ec)
|
|
154
|
-
#endif
|
|
155
|
-
|
|
156
|
-
#undef IMPL_PKEY_GETTER
|
|
157
|
-
#undef IMPL_KEY_ACCESSOR2
|
|
158
|
-
#undef IMPL_KEY_ACCESSOR3
|
|
159
|
-
#endif /* HAVE_OPAQUE_OPENSSL */
|
|
160
|
-
|
|
161
|
-
#if !defined(EVP_CTRL_AEAD_GET_TAG)
|
|
162
|
-
# define EVP_CTRL_AEAD_GET_TAG EVP_CTRL_GCM_GET_TAG
|
|
163
|
-
# define EVP_CTRL_AEAD_SET_TAG EVP_CTRL_GCM_SET_TAG
|
|
164
|
-
# define EVP_CTRL_AEAD_SET_IVLEN EVP_CTRL_GCM_SET_IVLEN
|
|
165
|
-
#endif
|
|
166
|
-
|
|
167
|
-
#if !defined(HAVE_X509_GET0_NOTBEFORE)
|
|
168
|
-
# define X509_get0_notBefore(x) X509_get_notBefore(x)
|
|
169
|
-
# define X509_get0_notAfter(x) X509_get_notAfter(x)
|
|
170
|
-
# define X509_CRL_get0_lastUpdate(x) X509_CRL_get_lastUpdate(x)
|
|
171
|
-
# define X509_CRL_get0_nextUpdate(x) X509_CRL_get_nextUpdate(x)
|
|
172
|
-
# define X509_set1_notBefore(x, t) X509_set_notBefore(x, t)
|
|
173
|
-
# define X509_set1_notAfter(x, t) X509_set_notAfter(x, t)
|
|
174
|
-
# define X509_CRL_set1_lastUpdate(x, t) X509_CRL_set_lastUpdate(x, t)
|
|
175
|
-
# define X509_CRL_set1_nextUpdate(x, t) X509_CRL_set_nextUpdate(x, t)
|
|
176
|
-
#endif
|
|
177
|
-
|
|
178
|
-
#if !defined(HAVE_SSL_SESSION_GET_PROTOCOL_VERSION)
|
|
179
|
-
# define SSL_SESSION_get_protocol_version(s) ((s)->ssl_version)
|
|
180
|
-
#endif
|
|
181
|
-
|
|
182
|
-
#if !defined(HAVE_TS_STATUS_INFO_GET0_STATUS)
|
|
183
|
-
# define TS_STATUS_INFO_get0_status(a) ((a)->status)
|
|
184
|
-
#endif
|
|
185
|
-
|
|
186
|
-
#if !defined(HAVE_TS_STATUS_INFO_GET0_TEXT)
|
|
187
|
-
# define TS_STATUS_INFO_get0_text(a) ((a)->text)
|
|
188
|
-
#endif
|
|
189
|
-
|
|
190
|
-
#if !defined(HAVE_TS_STATUS_INFO_GET0_FAILURE_INFO)
|
|
191
|
-
# define TS_STATUS_INFO_get0_failure_info(a) ((a)->failure_info)
|
|
192
|
-
#endif
|
|
193
|
-
|
|
194
|
-
#if !defined(HAVE_TS_VERIFY_CTS_SET_CERTS)
|
|
195
|
-
# define TS_VERIFY_CTS_set_certs(ctx, crts) ((ctx)->certs=(crts))
|
|
196
|
-
#endif
|
|
197
|
-
|
|
198
|
-
#if !defined(HAVE_TS_VERIFY_CTX_SET_STORE)
|
|
199
|
-
# define TS_VERIFY_CTX_set_store(ctx, str) ((ctx)->store=(str))
|
|
200
|
-
#endif
|
|
201
|
-
|
|
202
|
-
#if !defined(HAVE_TS_VERIFY_CTX_ADD_FLAGS)
|
|
203
|
-
# define TS_VERIFY_CTX_add_flags(ctx, f) ((ctx)->flags |= (f))
|
|
204
|
-
#endif
|
|
205
|
-
|
|
206
|
-
#if !defined(HAVE_TS_RESP_CTX_SET_TIME_CB)
|
|
207
|
-
# define TS_RESP_CTX_set_time_cb(ctx, callback, dta) do { \
|
|
208
|
-
(ctx)->time_cb = (callback); \
|
|
209
|
-
(ctx)->time_cb_data = (dta); \
|
|
210
|
-
} while (0)
|
|
211
|
-
#endif
|
|
212
|
-
|
|
213
|
-
#if !defined(HAVE_ASN1_STRING_GET0_DATA)
|
|
214
|
-
# define ASN1_STRING_get0_data(x) ((x)->data)
|
|
215
|
-
#endif
|
|
216
|
-
|
|
217
15
|
/* added in 3.0.0 */
|
|
218
|
-
#if !defined(HAVE_TS_VERIFY_CTX_SET_CERTS)
|
|
219
|
-
# define TS_VERIFY_CTX_set_certs(ctx, crts) TS_VERIFY_CTS_set_certs(ctx, crts)
|
|
220
|
-
#endif
|
|
221
|
-
|
|
222
16
|
#ifndef HAVE_EVP_MD_CTX_GET0_MD
|
|
223
17
|
# define EVP_MD_CTX_get0_md(ctx) EVP_MD_CTX_md(ctx)
|
|
224
18
|
#endif
|
|
@@ -228,38 +22,11 @@ IMPL_PKEY_GETTER(EC_KEY, ec)
|
|
|
228
22
|
* EVP_MD_CTX_get_pkey_ctx(x) in OpenSSL 3.0.
|
|
229
23
|
*/
|
|
230
24
|
#ifndef HAVE_EVP_MD_CTX_GET_PKEY_CTX
|
|
231
|
-
# ifdef HAVE_EVP_MD_CTX_PKEY_CTX
|
|
232
25
|
# define EVP_MD_CTX_get_pkey_ctx(x) EVP_MD_CTX_pkey_ctx(x)
|
|
233
|
-
# else
|
|
234
|
-
# define EVP_MD_CTX_get_pkey_ctx(x) (x)->pctx
|
|
235
|
-
# endif
|
|
236
26
|
#endif
|
|
237
27
|
|
|
238
28
|
#ifndef HAVE_EVP_PKEY_EQ
|
|
239
29
|
# define EVP_PKEY_eq(a, b) EVP_PKEY_cmp(a, b)
|
|
240
30
|
#endif
|
|
241
31
|
|
|
242
|
-
/* added in 4.0.0 */
|
|
243
|
-
#ifndef HAVE_ASN1_BIT_STRING_SET1
|
|
244
|
-
static inline int
|
|
245
|
-
ASN1_BIT_STRING_set1(ASN1_BIT_STRING *bitstr, const uint8_t *data,
|
|
246
|
-
size_t length, int unused_bits)
|
|
247
|
-
{
|
|
248
|
-
if (length > INT_MAX || !ASN1_STRING_set(bitstr, data, (int)length))
|
|
249
|
-
return 0;
|
|
250
|
-
bitstr->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07);
|
|
251
|
-
bitstr->flags |= ASN1_STRING_FLAG_BITS_LEFT | unused_bits;
|
|
252
|
-
return 1;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
static inline int
|
|
256
|
-
ASN1_BIT_STRING_get_length(const ASN1_BIT_STRING *bitstr, size_t *length,
|
|
257
|
-
int *unused_bits)
|
|
258
|
-
{
|
|
259
|
-
*length = bitstr->length;
|
|
260
|
-
*unused_bits = bitstr->flags & 0x07;
|
|
261
|
-
return 1;
|
|
262
|
-
}
|
|
263
|
-
#endif
|
|
264
|
-
|
|
265
32
|
#endif /* _OSSL_OPENSSL_MISSING_H_ */
|