Skip to content

Commit

Permalink
test a different option than sha1, since sha1 is getting deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
duritong committed Nov 16, 2024
1 parent 95e90ee commit 1045895
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/trocla/formats/x509_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def verify(ca,cert)

it 'respects all options' do
co = cert_options.merge({
'hash' => 'sha1',
'hash' => 'sha512',
'keysize' => 2048,
'days' => 3650,
'subject' => nil,
Expand All @@ -311,7 +311,7 @@ def verify(ca,cert)
expect(cert.subject.to_s).to match(/#{field}=#{co[field]}/)
end
expect(cert.subject.to_s).to match(/(Email|emailAddress)=#{co['emailAddress']}/)
hash_match = (defined?(RUBY_ENGINE) &&RUBY_ENGINE == 'jruby') ? 'RSA-SHA1' : 'sha1WithRSAEncryption'
hash_match = (defined?(RUBY_ENGINE) &&RUBY_ENGINE == 'jruby') ? 'RSA-SHA512' : 'sha512WithRSAEncryption'
expect(cert.signature_algorithm).to eq(hash_match)
expect(cert.not_before).to be < Time.now
expect((Date.parse(cert.not_after.localtime.to_s) - Date.today).to_i).to eq(3650)
Expand Down

0 comments on commit 1045895

Please sign in to comment.