diff options
-rw-r--r-- | test/test_x509cert.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/test_x509cert.rb b/test/test_x509cert.rb index bde3fbc9..40a5b0ad 100644 --- a/test/test_x509cert.rb +++ b/test/test_x509cert.rb @@ -170,11 +170,17 @@ class OpenSSL::TestX509Certificate < OpenSSL::TestCase end def test_eq - cacert = issue_cert(@ca, @rsa1024, 1, [], nil, nil) - cert1 = issue_cert(@ee1, @rsa2048, 2, [], cacert, @rsa1024) - cert2 = issue_cert(@ee1, @rsa2048, 2, [], cacert, @rsa1024) - cert3 = issue_cert(@ee1, @rsa2048, 3, [], cacert, @rsa1024) - cert4 = issue_cert(@ee1, @rsa2048, 2, [], cacert, @rsa1024, digest: "sha512") + now = Time.now + cacert = issue_cert(@ca, @rsa1024, 1, [], nil, nil, + not_before: now, not_after: now + 3600) + cert1 = issue_cert(@ee1, @rsa2048, 2, [], cacert, @rsa1024, + not_before: now, not_after: now + 3600) + cert2 = issue_cert(@ee1, @rsa2048, 2, [], cacert, @rsa1024, + not_before: now, not_after: now + 3600) + cert3 = issue_cert(@ee1, @rsa2048, 3, [], cacert, @rsa1024, + not_before: now, not_after: now + 3600) + cert4 = issue_cert(@ee1, @rsa2048, 2, [], cacert, @rsa1024, + digest: "sha512", not_before: now, not_after: now + 3600) assert_equal false, cert1 == 12345 assert_equal true, cert1 == cert2 |