Repository navigation
Add missing OpenSSL::SSL::SSLContext and SSLSocket methods - #3301
Open
hasannadeem wants to merge 1 commit into
Open
hasannadeem wants to merge 1 commit into
hasannadeem wants to merge 1 commit into
Conversation
SSLContext#ciphersuites=, #tmp_dh=, #keylog_cb and #keylog_cb= (openssl 3.x), #groups=, #sigalgs= and #client_sigalgs= (openssl 4.0), and SSLSocket#close_read, #close_write, #export_keying_material (openssl 3.x), #group, #sigalg and #peer_sigalg (openssl 4.0) had no signatures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These
OpenSSL::SSLmethods had no signatures:SSLContext#ciphersuites=(String | Array[String]) -> (String | Array[String])SSLContext#tmp_dh=(PKey::DH) -> PKey::DHSSLContext#keylog_cb,#keylog_cb=(^(SSLSocket ssl, String line) -> void)?SSLContext#groups=(String) -> StringSSLContext#sigalgs=,#client_sigalgs=(String) -> StringSSLSocket#close_read,#close_write() -> nilSSLSocket#export_keying_material(String label, int length, ?String? context) -> StringSSLSocket#group,#sigalg,#peer_sigalg() -> String?Notes:
keylog_cbfollows the getter/setter pairs used for the other callbacks (servername_cb,renegotiation_cb). The setter also acceptsnil, which clears the callback.tmp_dh=rejects other key types at runtime (invalid pkey type ... (expected DH)), so it takesPKey::DH.ecdh_curves=is now a deprecated alias ofgroups=, but this leaves its existing signature alone.There were no
SSLSocketinstance tests, soOpenSSLSSLFixtures.connectedmakes a real TLS connection over loopback TCP with a self-signed EC certificate. The tests check:groupandpeer_sigalgare Strings, and itssigalgisnilsince only the server signs;tmp_dh=, usingOpenSSL::PKey.generate_parameters("DH", "group" => "ffdhe2048")so no DH parameters have to be generated.All 12 new tests fail without the signature change. They pass with openssl 4.0.2 (Ruby 4.0.7), three runs in a row, and with openssl 3.3.0 (Ruby 3.4), where the six openssl 4.0 tests are omitted. With Steep, the setters,
export_keying_material,group&.upcaseand a lambdakeylog_cbpass, andtmp_dh = <EC key>is an error. Annotatingcoreandstdlibfrom the full v4.0.7 source leaves the file unchanged, andrake validateandrake typecheck_testpass.Calling
SSLSocket#groupbefore the handshake segfaults with OpenSSL 3.6.3. That is an OpenSSL bug (openssl/openssl#32379, fixed by openssl/openssl#32452), so the test calls it only after the handshake.This PR merges with #3291, #3299 and #3300 without conflicts.