aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-01-31 18:35:30 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-01-31 18:35:30 +0900
commit732318548f7c0e58f48c1baed3ed63b49a23e121 (patch)
tree50b09ccc5aaa84207159df1ae0ea38093a4e5e50
parent7b0ae4541c66ce228ba4abd75c8f35be177dc8f8 (diff)
parent74f166f410bd75d625a69ecc2b53601718294930 (diff)
downloadruby-openssl-732318548f7c0e58f48c1baed3ed63b49a23e121.tar.gz
Merge branch 'maint'
* maint: Ruby/OpenSSL 2.0.3 .travis.yml: test with Ruby 2.4 ruby-openssl-docker: update versions of Ruby and OpenSSL x509: fix OpenSSL::X509::Name#eql? test/envutil: fix assert_raise_with_message buffering: fix typo in doc
-rw-r--r--.travis.yml11
-rw-r--r--ext/openssl/ossl_x509name.c2
-rw-r--r--lib/openssl/buffering.rb4
-rw-r--r--test/envutil.rb5
-rw-r--r--test/test_x509name.rb10
-rw-r--r--tool/ruby-openssl-docker/Dockerfile42
-rwxr-xr-xtool/ruby-openssl-docker/init.sh4
7 files changed, 51 insertions, 27 deletions
diff --git a/.travis.yml b/.travis.yml
index 9da14b8b..68b8cc4a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,10 +17,11 @@ script:
matrix:
fast_finish: true
include:
- - env: RUBY_VERSION=ruby-2.3 OPENSSL_VERSION=openssl-1.0.1
- env: RUBY_VERSION=ruby-2.3 OPENSSL_VERSION=openssl-1.0.2
- - env: RUBY_VERSION=ruby-2.3 OPENSSL_VERSION=openssl-1.1.0
- - env: RUBY_VERSION=ruby-2.3 OPENSSL_VERSION=libressl-2.3
- - env: RUBY_VERSION=ruby-2.3 OPENSSL_VERSION=libressl-2.4
- - env: RUBY_VERSION=ruby-2.3 OPENSSL_VERSION=libressl-2.5
+ - env: RUBY_VERSION=ruby-2.4 OPENSSL_VERSION=openssl-1.0.1
+ - env: RUBY_VERSION=ruby-2.4 OPENSSL_VERSION=openssl-1.0.2
+ - env: RUBY_VERSION=ruby-2.4 OPENSSL_VERSION=openssl-1.1.0
+ - env: RUBY_VERSION=ruby-2.4 OPENSSL_VERSION=libressl-2.3
+ - env: RUBY_VERSION=ruby-2.4 OPENSSL_VERSION=libressl-2.4
+ - env: RUBY_VERSION=ruby-2.4 OPENSSL_VERSION=libressl-2.5
allow_failures:
diff --git a/ext/openssl/ossl_x509name.c b/ext/openssl/ossl_x509name.c
index 56816bdc..a10ae2c3 100644
--- a/ext/openssl/ossl_x509name.c
+++ b/ext/openssl/ossl_x509name.c
@@ -375,7 +375,7 @@ ossl_x509name_eql(VALUE self, VALUE other)
if (!rb_obj_is_kind_of(other, cX509Name))
return Qfalse;
- return ossl_x509name_cmp0(self, other) ? Qtrue : Qfalse;
+ return ossl_x509name_cmp0(self, other) == 0 ? Qtrue : Qfalse;
}
/*
diff --git a/lib/openssl/buffering.rb b/lib/openssl/buffering.rb
index 7fd647ca..b0dffefd 100644
--- a/lib/openssl/buffering.rb
+++ b/lib/openssl/buffering.rb
@@ -189,7 +189,7 @@ module OpenSSL::Buffering
end
##
- # Reads the next "line+ from the stream. Lines are separated by +eol+. If
+ # Reads the next "line" from the stream. Lines are separated by +eol+. If
# +limit+ is provided the result will not be longer than the given number of
# bytes.
#
@@ -344,7 +344,7 @@ module OpenSSL::Buffering
end
##
- # Writes +str+ in the non-blocking manner.
+ # Writes +s+ in the non-blocking manner.
#
# If there is buffered data, it is flushed first. This may block.
#
diff --git a/test/envutil.rb b/test/envutil.rb
index da304102..89332b35 100644
--- a/test/envutil.rb
+++ b/test/envutil.rb
@@ -1,6 +1,7 @@
# -*- coding: us-ascii -*-
require "timeout"
require "rbconfig"
+require "pp"
module EnvUtil
def rubybin
@@ -259,6 +260,10 @@ eom
values
end
+ def mu_pp(obj) #:nodoc:
+ obj.pretty_inspect.chomp
+ end
+
# :call-seq:
# assert_raise_with_message(exception, expected, msg = nil, &block)
#
diff --git a/test/test_x509name.rb b/test/test_x509name.rb
index 486d0bbb..83b1247d 100644
--- a/test/test_x509name.rb
+++ b/test/test_x509name.rb
@@ -354,6 +354,16 @@ class OpenSSL::TestX509Name < OpenSSL::TestCase
assert_equal(expected, name_hash(name))
end
+ def test_equality
+ name0 = OpenSSL::X509::Name.new([["DC", "org"], ["DC", "ruby-lang"], ["CN", "bar.ruby-lang.org"]])
+ name1 = OpenSSL::X509::Name.new([["DC", "org"], ["DC", "ruby-lang"], ["CN", "bar.ruby-lang.org"]])
+ name2 = OpenSSL::X509::Name.new([["DC", "org"], ["DC", "ruby-lang"], ["CN", "baz.ruby-lang.org"]])
+ assert_equal true, name0 == name1
+ assert_equal true, name0.eql?(name1)
+ assert_equal false, name0 == name2
+ assert_equal false, name0.eql?(name2)
+ end
+
def test_dup
name = OpenSSL::X509::Name.parse("/CN=ruby-lang.org")
assert_equal(name.to_der, name.dup.to_der)
diff --git a/tool/ruby-openssl-docker/Dockerfile b/tool/ruby-openssl-docker/Dockerfile
index a1518a9c..d22a7e43 100644
--- a/tool/ruby-openssl-docker/Dockerfile
+++ b/tool/ruby-openssl-docker/Dockerfile
@@ -19,46 +19,46 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
xz-utils \
zlib1g-dev
-# Supported OpenSSL versions: 1.0.0, 1.0.1, 1.0.2, 1.1.0
+# Supported OpenSSL versions: 1.0.1-
RUN mkdir -p /build/openssl
RUN curl -s https://www.openssl.org/source/openssl-1.0.0t.tar.gz | tar -C /build/openssl -xzf - && \
cd /build/openssl/openssl-1.0.0t && \
./Configure \
--openssldir=/opt/openssl/openssl-1.0.0 \
- shared debug-linux-x86_64 && \
+ shared linux-x86_64 && \
make && make install_sw
RUN curl -s https://www.openssl.org/source/openssl-1.0.1u.tar.gz | tar -C /build/openssl -xzf - && \
cd /build/openssl/openssl-1.0.1u && \
./Configure \
--openssldir=/opt/openssl/openssl-1.0.1 \
- shared debug-linux-x86_64 && \
+ shared linux-x86_64 && \
make && make install_sw
-RUN curl -s https://www.openssl.org/source/openssl-1.0.2j.tar.gz | tar -C /build/openssl -xzf - && \
- cd /build/openssl/openssl-1.0.2j && \
+RUN curl -s https://www.openssl.org/source/openssl-1.0.2k.tar.gz | tar -C /build/openssl -xzf - && \
+ cd /build/openssl/openssl-1.0.2k && \
./Configure \
--openssldir=/opt/openssl/openssl-1.0.2 \
- shared debug-linux-x86_64 && \
+ shared linux-x86_64 && \
make && make install_sw
-RUN curl -s https://www.openssl.org/source/openssl-1.1.0b.tar.gz | tar -C /build/openssl -xzf - && \
- cd /build/openssl/openssl-1.1.0b && \
+RUN curl -s https://www.openssl.org/source/openssl-1.1.0d.tar.gz | tar -C /build/openssl -xzf - && \
+ cd /build/openssl/openssl-1.1.0d && \
./Configure \
--prefix=/opt/openssl/openssl-1.1.0 \
enable-crypto-mdebug enable-crypto-mdebug-backtrace \
- debug-linux-x86_64 && \
+ linux-x86_64 && \
make && make install_sw
-# Supported libressl versions: 2.3, 2.4, 2.5
-RUN curl -s http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.3.8.tar.gz | tar -C /build/openssl -xzf -
-RUN cd /build/openssl/libressl-2.3.8 && \
+# Supported libressl versions: 2.3-
+RUN curl -s http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.3.9.tar.gz | tar -C /build/openssl -xzf -
+RUN cd /build/openssl/libressl-2.3.9 && \
./configure \
--prefix=/opt/openssl/libressl-2.3 && \
make && make install
-RUN curl -s http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.4.3.tar.gz | tar -C /build/openssl -xzf -
-RUN cd /build/openssl/libressl-2.4.3 && \
+RUN curl -s http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.4.4.tar.gz | tar -C /build/openssl -xzf -
+RUN cd /build/openssl/libressl-2.4.4 && \
./configure \
--prefix=/opt/openssl/libressl-2.4 && \
make && make install
@@ -69,16 +69,24 @@ RUN cd /build/openssl/libressl-2.5.0 && \
--prefix=/opt/openssl/libressl-2.5 && \
make && make install
-# Supported Ruby versions: 2.3
+# Supported Ruby versions: 2.3-
RUN mkdir -p /build/ruby
-RUN curl -s https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.gz | tar -C /build/ruby -xzf - && \
- cd /build/ruby/ruby-2.3.1 && \
+RUN curl -s https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz | tar -C /build/ruby -xzf - && \
+ cd /build/ruby/ruby-2.3.3 && \
autoconf && ./configure \
--without-openssl \
--prefix=/opt/ruby/ruby-2.3 \
--disable-install-doc && \
make && make install
+RUN curl -s https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.0.tar.gz | tar -C /build/ruby -xzf - && \
+ cd /build/ruby/ruby-2.4.0 && \
+ autoconf && ./configure \
+ --without-openssl \
+ --prefix=/opt/ruby/ruby-2.4 \
+ --disable-install-doc && \
+ make && make install
+
ONBUILD ADD . /home/openssl/code
ONBUILD WORKDIR /home/openssl/code
diff --git a/tool/ruby-openssl-docker/init.sh b/tool/ruby-openssl-docker/init.sh
index c4301482..4d97e28c 100755
--- a/tool/ruby-openssl-docker/init.sh
+++ b/tool/ruby-openssl-docker/init.sh
@@ -2,12 +2,12 @@
if [[ "$RUBY_VERSION" = "" ]]
then
- RUBY_VERSION=ruby-2.3
+ RUBY_VERSION=ruby-2.4
fi
if [[ "$OPENSSL_VERSION" = "" ]]
then
- OPENSSL_VERSION=openssl-1.0.2
+ OPENSSL_VERSION=openssl-1.1.0
fi
echo "Using Ruby ${RUBY_VERSION} with OpenSSL ${OPENSSL_VERSION}."