Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require Ruby 2.6 or later #466

Merged
merged 2 commits into from
Oct 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
ruby: [ head, "3.0", "2.7", "2.6", "2.5", "2.4", "2.3" ]
ruby: [ head, "3.0", "2.7", "2.6" ]
steps:
- name: repo checkout
uses: actions/checkout@v2
Expand All @@ -38,7 +38,7 @@ jobs:
fail-fast: false
matrix:
os: [ windows-latest ]
ruby: [ mswin, mingw, "3.0", "2.7", "2.6", "2.5", "2.4", "2.3" ]
ruby: [ mswin, mingw, "3.0", "2.7", "2.6" ]
steps:
- name: repo checkout
uses: actions/checkout@v2
Expand Down
1 change: 0 additions & 1 deletion ext/openssl/ossl.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ void ossl_debug(const char *, ...);
* Include all parts
*/
#include "openssl_missing.h"
#include "ruby_missing.h"
#include "ossl_asn1.h"
#include "ossl_bio.h"
#include "ossl_bn.h"
Expand Down
3 changes: 0 additions & 3 deletions ext/openssl/ossl_pkey_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,6 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
ossl_raise(rb_eArgError, "wrong number of arguments");
}

#if !defined(LIKELY) && !defined(RB_LIKELY)
#define LIKELY(x) (x)
#endif
ASSUME(group);
RTYPEDDATA_DATA(self) = group;

Expand Down
24 changes: 0 additions & 24 deletions ext/openssl/ruby_missing.h

This file was deleted.

12 changes: 1 addition & 11 deletions lib/openssl/buffering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,6 @@ def consume_rbuff(size=nil)
end
end

if "".respond_to?(:unpack1)
def unpack_byte(str)
str.unpack1("C")
end
else
def unpack_byte(str)
str.unpack("C").first
end
end

public

# call-seq:
Expand All @@ -117,7 +107,7 @@ def unpack_byte(str)
# Get the next 8bit byte from `ssl`. Returns `nil` on EOF
def getbyte
byte = read(1)
byte && unpack_byte(byte)
byte && byte.unpack1("C")
end

##
Expand Down
2 changes: 1 addition & 1 deletion lib/openssl/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module OpenSSL
VERSION = "2.2.1"
VERSION = "3.0.0.pre"
end
4 changes: 2 additions & 2 deletions openssl.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = "openssl"
spec.version = "2.2.1"
spec.version = "3.0.0.pre"
spec.authors = ["Martin Bosslet", "SHIBATA Hiroshi", "Zachary Scott", "Kazuki Yamaguchi"]
spec.email = ["ruby-core@ruby-lang.org"]
spec.summary = %q{OpenSSL provides SSL, TLS and general purpose cryptography.}
Expand All @@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
spec.extra_rdoc_files = Dir["*.md"]
spec.rdoc_options = ["--main", "README.md"]

spec.required_ruby_version = ">= 2.3.0"
spec.required_ruby_version = ">= 2.6.0"

spec.metadata["msys2_mingw_dependencies"] = "openssl"
end
12 changes: 3 additions & 9 deletions test/openssl/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,7 @@ def start_server(verify_mode: OpenSSL::SSL::VERIFY_NONE, start_immediately: true
threads = []
begin
server_thread = Thread.new do
if Thread.method_defined?(:report_on_exception=) # Ruby >= 2.4
Thread.current.report_on_exception = false
end
Thread.current.report_on_exception = false

begin
loop do
Expand All @@ -254,9 +252,7 @@ def start_server(verify_mode: OpenSSL::SSL::VERIFY_NONE, start_immediately: true
end

th = Thread.new do
if Thread.method_defined?(:report_on_exception=)
Thread.current.report_on_exception = false
end
Thread.current.report_on_exception = false

begin
server_proc.call(ctx, ssl)
Expand All @@ -273,9 +269,7 @@ def start_server(verify_mode: OpenSSL::SSL::VERIFY_NONE, start_immediately: true
end

client_thread = Thread.new do
if Thread.method_defined?(:report_on_exception=)
Thread.current.report_on_exception = false
end
Thread.current.report_on_exception = false

begin
block.call(port)
Expand Down