summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/openssl/test_pkey_dsa.rb9
-rw-r--r--test/openssl/test_pkey_ec.rb5
-rw-r--r--test/openssl/test_pkey_rsa.rb11
3 files changed, 24 insertions, 1 deletions
diff --git a/test/openssl/test_pkey_dsa.rb b/test/openssl/test_pkey_dsa.rb
index ba3bfb5b4a6..e498e3c03a7 100644
--- a/test/openssl/test_pkey_dsa.rb
+++ b/test/openssl/test_pkey_dsa.rb
@@ -76,6 +76,7 @@ end
assert_equal(g, key.g)
assert_equal(y, key.pub_key)
assert_equal(nil, key.priv_key)
+ assert_equal([], OpenSSL.errors)
end
def test_read_DSAPublicKey_pem
@@ -100,6 +101,7 @@ fWLOqqkzFeRrYMDzUpl36XktY6Yq8EJYlW9pCMmBVNy/dQ==
assert_equal(g, key.g)
assert_equal(y, key.pub_key)
assert_equal(nil, key.priv_key)
+ assert_equal([], OpenSSL.errors)
end
def test_read_DSA_PUBKEY_pem
@@ -125,6 +127,7 @@ YNMbNw==
assert_equal(g, key.g)
assert_equal(y, key.pub_key)
assert_equal(nil, key.priv_key)
+ assert_equal([], OpenSSL.errors)
end
def test_export_format_is_DSA_PUBKEY_pem
@@ -154,6 +157,7 @@ YNMbNw==
pub_key = OpenSSL::ASN1.decode(seq[1].value)
assert_equal(OpenSSL::ASN1::INTEGER, pub_key.tag)
assert_equal(key.pub_key, pub_key.value)
+ assert_equal([], OpenSSL.errors)
end
def test_read_private_key_der
@@ -162,6 +166,7 @@ YNMbNw==
key2 = OpenSSL::PKey.read(der)
assert(key2.private?)
assert_equal(der, key2.to_der)
+ assert_equal([], OpenSSL.errors)
end
def test_read_private_key_pem
@@ -170,6 +175,7 @@ YNMbNw==
key2 = OpenSSL::PKey.read(pem)
assert(key2.private?)
assert_equal(pem, key2.to_pem)
+ assert_equal([], OpenSSL.errors)
end
def test_read_public_key_der
@@ -178,6 +184,7 @@ YNMbNw==
key2 = OpenSSL::PKey.read(der)
assert(!key2.private?)
assert_equal(der, key2.to_der)
+ assert_equal([], OpenSSL.errors)
end
def test_read_public_key_pem
@@ -186,6 +193,7 @@ YNMbNw==
key2 = OpenSSL::PKey.read(pem)
assert(!key2.private?)
assert_equal(pem, key2.to_pem)
+ assert_equal([], OpenSSL.errors)
end
def test_read_private_key_pem_pw
@@ -200,6 +208,7 @@ YNMbNw==
key2 = OpenSSL::PKey.read(pem, 'secret')
assert(key2.private?)
#omit pem equality check, will be different due to cipher iv
+ assert_equal([], OpenSSL.errors)
end
private
diff --git a/test/openssl/test_pkey_ec.rb b/test/openssl/test_pkey_ec.rb
index 3fb8d29c32e..e63f617140a 100644
--- a/test/openssl/test_pkey_ec.rb
+++ b/test/openssl/test_pkey_ec.rb
@@ -126,6 +126,7 @@ class OpenSSL::TestEC < Test::Unit::TestCase
ec2 = OpenSSL::PKey.read(der)
assert(ec2.private_key?)
assert_equal(der, ec2.to_der)
+ assert_equal([], OpenSSL.errors)
end
def test_read_private_key_pem
@@ -134,6 +135,7 @@ class OpenSSL::TestEC < Test::Unit::TestCase
ec2 = OpenSSL::PKey.read(pem)
assert(ec2.private_key?)
assert_equal(pem, ec2.to_pem)
+ assert_equal([], OpenSSL.errors)
end
def test_read_public_key_der
@@ -144,6 +146,7 @@ class OpenSSL::TestEC < Test::Unit::TestCase
ec3 = OpenSSL::PKey.read(der)
assert(!ec3.private_key?)
assert_equal(der, ec3.to_der)
+ assert_equal([], OpenSSL.errors)
end
def test_read_public_key_pem
@@ -154,6 +157,7 @@ class OpenSSL::TestEC < Test::Unit::TestCase
ec3 = OpenSSL::PKey.read(pem)
assert(!ec3.private_key?)
assert_equal(pem, ec3.to_pem)
+ assert_equal([], OpenSSL.errors)
end
def test_read_private_key_pem_pw
@@ -168,6 +172,7 @@ class OpenSSL::TestEC < Test::Unit::TestCase
ec2 = OpenSSL::PKey.read(pem, 'secret')
assert(ec2.private_key?)
#omit pem equality check, will be different due to cipher iv
+ assert_equal([], OpenSSL.errors)
end
# test Group: asn1_flag, point_conversion
diff --git a/test/openssl/test_pkey_rsa.rb b/test/openssl/test_pkey_rsa.rb
index 3dfb08e7a07..5ba14229af8 100644
--- a/test/openssl/test_pkey_rsa.rb
+++ b/test/openssl/test_pkey_rsa.rb
@@ -42,7 +42,6 @@ class OpenSSL::TestPKeyRSA < Test::Unit::TestCase
end
def test_new
- OpenSSL.errors
key = OpenSSL::PKey::RSA.new 512
pem = key.public_key.to_pem
OpenSSL::PKey::RSA.new pem
@@ -92,6 +91,7 @@ class OpenSSL::TestPKeyRSA < Test::Unit::TestCase
assert_equal(nil, key.d)
assert_equal(nil, key.p)
assert_equal(nil, key.q)
+ assert_equal([], OpenSSL.errors)
end
def test_read_RSA_PUBKEY
@@ -110,6 +110,7 @@ class OpenSSL::TestPKeyRSA < Test::Unit::TestCase
assert_equal(nil, key.d)
assert_equal(nil, key.p)
assert_equal(nil, key.q)
+ assert_equal([], OpenSSL.errors)
end
def test_read_RSAPublicKey_pem
@@ -129,6 +130,7 @@ AudJR1JobbIbDJrQu6AXnWh5k/YtAgMBAAE=
assert_equal(nil, key.d)
assert_equal(nil, key.p)
assert_equal(nil, key.q)
+ assert_equal([], OpenSSL.errors)
end
def test_read_RSA_PUBKEY_pem
@@ -149,6 +151,7 @@ AwEAAQ==
assert_equal(nil, key.d)
assert_equal(nil, key.p)
assert_equal(nil, key.q)
+ assert_equal([], OpenSSL.errors)
end
def test_export_format_is_RSA_PUBKEY
@@ -170,6 +173,7 @@ AwEAAQ==
key = OpenSSL::PKey.read(der)
assert(key.private?)
assert_equal(der, key.to_der)
+ assert_equal([], OpenSSL.errors)
end
def test_read_private_key_pem
@@ -177,6 +181,7 @@ AwEAAQ==
key = OpenSSL::PKey.read(pem)
assert(key.private?)
assert_equal(pem, key.to_pem)
+ assert_equal([], OpenSSL.errors)
end
def test_read_public_key_der
@@ -184,6 +189,7 @@ AwEAAQ==
key = OpenSSL::PKey.read(der)
assert(!key.private?)
assert_equal(der, key.to_der)
+ assert_equal([], OpenSSL.errors)
end
def test_read_public_key_pem
@@ -191,6 +197,7 @@ AwEAAQ==
key = OpenSSL::PKey.read(pem)
assert(!key.private?)
assert_equal(pem, key.to_pem)
+ assert_equal([], OpenSSL.errors)
end
def test_read_private_key_pem_pw
@@ -204,6 +211,7 @@ AwEAAQ==
key = OpenSSL::PKey.read(pem, 'secret')
assert(key.private?)
#omit pem equality check, will be different due to cipher iv
+ assert_equal([], OpenSSL.errors)
end
private
@@ -228,6 +236,7 @@ AwEAAQ==
assert_equal(key.n, pub_key.value[0].value)
assert_equal(OpenSSL::ASN1::INTEGER, pub_key.value[1].tag)
assert_equal(key.e, pub_key.value[1].value)
+ assert_equal([], OpenSSL.errors)
end
end