summaryrefslogtreecommitdiff
path: root/test/openssl
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-06 03:56:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-06 03:56:38 +0000
commit287a34ae0dfc23e4158f67cb7783d239f202c368 (patch)
tree5e35d5b41aae961b37cf6632f60c42f51c7aa775 /test/openssl
parent9b52ae2e6491bb5d6c59e1799449f6268baf6f89 (diff)
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/ssl_server.rb2
-rw-r--r--test/openssl/test_ec.rb2
-rw-r--r--test/openssl/test_pair.rb2
-rw-r--r--test/openssl/test_pkcs7.rb6
-rw-r--r--test/openssl/test_ssl.rb8
-rw-r--r--test/openssl/test_x509cert.rb30
-rw-r--r--test/openssl/test_x509crl.rb6
-rw-r--r--test/openssl/utils.rb2
8 files changed, 29 insertions, 29 deletions
diff --git a/test/openssl/ssl_server.rb b/test/openssl/ssl_server.rb
index 6e62062..d3ad55d 100644
--- a/test/openssl/ssl_server.rb
+++ b/test/openssl/ssl_server.rb
@@ -53,7 +53,7 @@ tcps = nil
port = port + i
break
rescue Errno::EADDRINUSE
- next
+ next
end
}
ssls = OpenSSL::SSL::SSLServer.new(tcps, ctx)
diff --git a/test/openssl/test_ec.rb b/test/openssl/test_ec.rb
index 66dbf54..282bb67 100644
--- a/test/openssl/test_ec.rb
+++ b/test/openssl/test_ec.rb
@@ -88,7 +88,7 @@ class OpenSSL::TestEC < Test::Unit::TestCase
for key in @keys
sig = key.dsa_sign_asn1(@data1)
assert_equal(key.dsa_verify_asn1(@data1, sig), true)
-
+
assert_raise(OpenSSL::PKey::ECError) { key.dsa_sign_asn1(@data2) }
end
end
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index 271459f..9d22a87 100644
--- a/test/openssl/test_pair.rb
+++ b/test/openssl/test_pair.rb
@@ -57,7 +57,7 @@ module SSLPair
ensure
if th && th.alive?
th.kill
- th.join
+ th.join
end
end
end
diff --git a/test/openssl/test_pkcs7.rb b/test/openssl/test_pkcs7.rb
index 2cdd934..d86de36 100644
--- a/test/openssl/test_pkcs7.rb
+++ b/test/openssl/test_pkcs7.rb
@@ -35,7 +35,7 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
@ca_cert, @rsa2048, OpenSSL::Digest::SHA1.new)
end
- def issue_cert(*args)
+ def issue_cert(*args)
OpenSSL::TestUtils.issue_cert(*args)
end
@@ -77,7 +77,7 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
assert_equal(@ee1_cert.serial, signers[0].serial)
assert_equal(@ee1_cert.issuer.to_s, signers[0].issuer.to_s)
- # A signed-data which have multiple signatures can be created
+ # A signed-data which have multiple signatures can be created
# through the following steps.
# 1. create two signed-data
# 2. copy signerInfo and certificate from one to another
@@ -85,7 +85,7 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
tmp1 = OpenSSL::PKCS7.sign(@ee1_cert, @rsa1024, data, [], flag)
tmp2 = OpenSSL::PKCS7.sign(@ee2_cert, @rsa1024, data, [], flag)
tmp1.add_signer(tmp2.signers[0])
- tmp1.add_certificate(@ee2_cert)
+ tmp1.add_certificate(@ee2_cert)
p7 = OpenSSL::PKCS7.new(tmp1.to_der)
certs = p7.certificates
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
index 2c5886b..5053634 100644
--- a/test/openssl/test_ssl.rb
+++ b/test/openssl/test_ssl.rb
@@ -82,7 +82,7 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
end
Thread.start do
- Thread.current.abort_on_exception = true
+ Thread.current.abort_on_exception = true
server_proc.call(ctx, ssl)
end
end
@@ -93,7 +93,7 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
ctx_proc = args[:ctx_proc]
server_proc = args[:server_proc]
server_proc ||= method(:readwrite_loop)
-
+
store = OpenSSL::X509::Store.new
store.add_cert(@ca_cert)
store.purpose = OpenSSL::X509::PURPOSE_SSL_CLIENT
@@ -120,7 +120,7 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
begin
server = Thread.new do
- Thread.current.abort_on_exception = true
+ Thread.current.abort_on_exception = true
server_loop(ctx, ssls, server_proc)
end
@@ -532,7 +532,7 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
ctx.session_add(saved_session)
end
connections += 1
-
+
readwrite_loop(ctx, ssl)
end
diff --git a/test/openssl/test_x509cert.rb b/test/openssl/test_x509cert.rb
index c092ce5..398ab2f 100644
--- a/test/openssl/test_x509cert.rb
+++ b/test/openssl/test_x509cert.rb
@@ -28,7 +28,7 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
def test_serial
[1, 2**32, 2**100].each{|s|
cert = issue_cert(@ca, @rsa2048, s, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
assert_equal(s, cert.serial)
cert = OpenSSL::X509::Certificate.new(cert.to_der)
assert_equal(s, cert.serial)
@@ -60,25 +60,25 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
def test_validity
now = Time.now until now && now.usec != 0
cert = issue_cert(@ca, @rsa2048, 1, now, now+3600, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
assert_not_equal(now, cert.not_before)
assert_not_equal(now+3600, cert.not_after)
now = Time.at(now.to_i)
cert = issue_cert(@ca, @rsa2048, 1, now, now+3600, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
assert_equal(now.getutc, cert.not_before)
assert_equal((now+3600).getutc, cert.not_after)
now = Time.at(0)
cert = issue_cert(@ca, @rsa2048, 1, now, now, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
assert_equal(now.getutc, cert.not_before)
assert_equal(now.getutc, cert.not_after)
now = Time.at(0x7fffffff)
cert = issue_cert(@ca, @rsa2048, 1, now, now, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
assert_equal(now.getutc, cert.not_before)
assert_equal(now.getutc, cert.not_after)
end
@@ -91,7 +91,7 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
["authorityKeyIdentifier","keyid:always",false],
]
ca_cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, ca_exts,
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
ca_cert.extensions.each_with_index{|ext, i|
assert_equal(ca_exts[i].first, ext.oid)
assert_equal(ca_exts[i].last, ext.critical?)
@@ -105,7 +105,7 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
["subjectAltName","email:ee1@ruby-lang.org",false],
]
ee1_cert = issue_cert(@ee1, @rsa1024, 2, Time.now, Time.now+1800, ee1_exts,
- ca_cert, @rsa2048, OpenSSL::Digest::SHA1.new)
+ ca_cert, @rsa2048, OpenSSL::Digest::SHA1.new)
assert_equal(ca_cert.subject.to_der, ee1_cert.issuer.to_der)
ee1_cert.extensions.each_with_index{|ext, i|
assert_equal(ee1_exts[i].first, ext.oid)
@@ -120,7 +120,7 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
["subjectAltName","email:ee2@ruby-lang.org",false],
]
ee2_cert = issue_cert(@ee2, @rsa1024, 3, Time.now, Time.now+1800, ee2_exts,
- ca_cert, @rsa2048, OpenSSL::Digest::MD5.new)
+ ca_cert, @rsa2048, OpenSSL::Digest::MD5.new)
assert_equal(ca_cert.subject.to_der, ee2_cert.issuer.to_der)
ee2_cert.extensions.each_with_index{|ext, i|
assert_equal(ee2_exts[i].first, ext.oid)
@@ -131,7 +131,7 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
def test_sign_and_verify
cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
assert_equal(false, cert.verify(@rsa1024))
assert_equal(true, cert.verify(@rsa2048))
assert_equal(false, cert.verify(@dsa256))
@@ -140,7 +140,7 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
assert_equal(false, cert.verify(@rsa2048))
cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::MD5.new)
+ nil, nil, OpenSSL::Digest::MD5.new)
assert_equal(false, cert.verify(@rsa1024))
assert_equal(true, cert.verify(@rsa2048))
assert_equal(false, cert.verify(@dsa256))
@@ -149,25 +149,25 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
assert_equal(false, cert.verify(@rsa2048))
cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::DSS1.new)
+ nil, nil, OpenSSL::Digest::DSS1.new)
assert_equal(false, cert.verify(@rsa1024))
assert_equal(false, cert.verify(@rsa2048))
assert_equal(false, cert.verify(@dsa256))
assert_equal(true, cert.verify(@dsa512))
- cert.not_after = Time.now
+ cert.not_after = Time.now
assert_equal(false, cert.verify(@dsa512))
assert_raise(OpenSSL::X509::CertificateError){
cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::DSS1.new)
+ nil, nil, OpenSSL::Digest::DSS1.new)
}
assert_raise(OpenSSL::X509::CertificateError){
cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::MD5.new)
+ nil, nil, OpenSSL::Digest::MD5.new)
}
assert_raise(OpenSSL::X509::CertificateError){
cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::SHA1.new)
+ nil, nil, OpenSSL::Digest::SHA1.new)
}
end
end
diff --git a/test/openssl/test_x509crl.rb b/test/openssl/test_x509crl.rb
index 444a00a..e1f4e00 100644
--- a/test/openssl/test_x509crl.rb
+++ b/test/openssl/test_x509crl.rb
@@ -125,13 +125,13 @@ class OpenSSL::TestX509CRL < Test::Unit::TestCase
def test_extension
cert_exts = [
["basicConstraints", "CA:TRUE", true],
- ["subjectKeyIdentifier", "hash", false],
- ["authorityKeyIdentifier", "keyid:always", false],
+ ["subjectKeyIdentifier", "hash", false],
+ ["authorityKeyIdentifier", "keyid:always", false],
["subjectAltName", "email:xyzzy@ruby-lang.org", false],
["keyUsage", "cRLSign, keyCertSign", true],
]
crl_exts = [
- ["authorityKeyIdentifier", "keyid:always", false],
+ ["authorityKeyIdentifier", "keyid:always", false],
["issuerAltName", "issuer:copy", false],
]
diff --git a/test/openssl/utils.rb b/test/openssl/utils.rb
index 07a1835..2edb7b0 100644
--- a/test/openssl/utils.rb
+++ b/test/openssl/utils.rb
@@ -96,7 +96,7 @@ Q1VB8qkJN7rA7/2HrCR3gTsWNb1YhAsnFsoeRscC+LxXoXi9OAIUBG98h4tilg6S
cert
end
- def issue_crl(revoke_info, serial, lastup, nextup, extensions,
+ def issue_crl(revoke_info, serial, lastup, nextup, extensions,
issuer, issuer_key, digest)
crl = OpenSSL::X509::CRL.new
crl.issuer = issuer.subject