From 3959469f240edb6c1f43976bbb72a0ba9105a6b1 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Wed, 25 Sep 2019 15:03:09 -0700 Subject: Fix keyword argument separation issues in OpenSSL::SSL::SSLSocket#sys{read,write}_nonblock It's unlikely anyone would actually hit these. The methods are private, you only hit this code path if calling these methods before performing the SSL connection, and there is already a verbose warning issued. --- test/openssl/test_ssl.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/openssl') diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb index dad9a43779..940bc135ed 100644 --- a/test/openssl/test_ssl.rb +++ b/test/openssl/test_ssl.rb @@ -155,6 +155,21 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase } end + def test_sysread_nonblock_and_syswrite_nonblock_keywords + start_server(ignore_listener_error: true) do |port| + sock = TCPSocket.new("127.0.0.1", port) + ssl = OpenSSL::SSL::SSLSocket.new(sock) + + assert_warn ("") do + ssl.send(:syswrite_nonblock, "1", exception: false) + ssl.send(:sysread_nonblock, 1, exception: false) rescue nil + ssl.send(:sysread_nonblock, 1, String.new, exception: false) rescue nil + end + ensure + sock&.close + end + end + def test_sync_close start_server { |port| begin -- cgit v1.2.3