Skip to content

Commit bcbb73c

Browse files
committed
[test] need to adjust key-identifier after cert was re-generated ...
1 parent a570ff5 commit bcbb73c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/test/ruby/x509/test_x509cert.rb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,17 @@ def test_inspect_to_text
219219
cert = issue_cert(subj, key, s, now, now + 3600, exts, nil, nil, dgst)
220220

221221
assert cert.inspect.start_with?('#<OpenSSL::X509::Certificate:')
222-
assert cert.inspect.index('subject=/DC=org/DC=ruby-lang/CN=TestCA, issuer=/DC=org/DC=ruby-lang/CN=TestCA')
223-
assert cert.inspect.index('serial=295990750012446699619010157040970350255')
222+
if defined? JRUBY_VERSION
223+
assert cert.inspect.index('subject=/DC=org/DC=ruby-lang/CN=TestCA, issuer=/DC=org/DC=ruby-lang/CN=TestCA')
224+
assert cert.inspect.index('serial=295990750012446699619010157040970350255')
225+
# TODO this isn't MRI compatible, which gives :
226+
# #<OpenSSL::X509::Certificate:
227+
# subject=#<OpenSSL::X509::Name CN=TestCA,DC=ruby-lang,DC=org>,
228+
# issuer=#<OpenSSL::X509::Name CN=TestCA,DC=ruby-lang,DC=org>,
229+
# serial=#<OpenSSL::BN:0x00005627d4602938>,
230+
# not_before=2014-10-09 07:34:20 UTC,
231+
# not_after=2014-10-09 08:34:20 UTC>
232+
end
224233
#assert cert.inspect.index('not_before=2014-10-09 07:34:20 UTC, not_after=2014-10-09 08:34:20 UTC')
225234

226235
text_without_signature = <<-TEXT
@@ -313,7 +322,7 @@ def test_to_text_read_back
313322
crt = File.expand_path('ca.crt', File.dirname(__FILE__))
314323
cert = OpenSSL::X509::Certificate.new File.read(crt)
315324
assert cert.to_text.index('X509v3 Authority Key Identifier:')
316-
assert cert.to_text.match /X509v3 Authority Key Identifier:\s*keyid:BA:5E:E9:90:3B:5B:F6:79:A2:D3:65:09:C5:39:6A:E7:43:6B:F8:3D/m
325+
assert cert.to_text.match /X509v3 Authority Key Identifier:\s*keyid:C6:17:42:6B:7F:B6:44:30:67:01:3D:44:83:9D:0F:B4:52:A1:D7:B7/m
317326
end
318327

319328
def test_to_text_npe_regression

0 commit comments

Comments
 (0)