File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 20
20
- {os: ubuntu-latest, ruby: '2.6'}
21
21
- {os: ubuntu-latest, ruby: '2.7'}
22
22
- {os: ubuntu-latest, ruby: '3.0'}
23
- - {os: ubuntu-latest, ruby: 'jruby-9.2.21 .0'}
23
+ - {os: ubuntu-latest, ruby: 'jruby-9.3.9 .0'}
24
24
- {os: windows-2019, ruby: '2.5'}
25
25
- {os: windows-2019, ruby: '2.6'}
26
26
- {os: windows-2019, ruby: '2.7'}
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+
3
+ describe Puppet ::SSL ::CertificateSigner do
4
+ include PuppetSpec ::Files
5
+
6
+ let ( :wrong_key ) { OpenSSL ::PKey ::RSA . new ( 512 ) }
7
+ let ( :client_cert ) { cert_fixture ( 'signed.pem' ) }
8
+
9
+ # jruby-openssl >= 0.13.0 (JRuby >= 9.3.5.0) raises an error when signing a
10
+ # certificate when there is a discrepancy between the certificate and key.
11
+ it 'raises if client cert signature is invalid' , if : Puppet ::Util ::Platform . jruby? && RUBY_VERSION . to_f >= 2.6 do
12
+ expect {
13
+ client_cert . sign ( wrong_key , OpenSSL ::Digest ::SHA256 . new )
14
+ } . to raise_error ( OpenSSL ::X509 ::CertificateError ,
15
+ 'invalid public key data' )
16
+ end
17
+ end
Original file line number Diff line number Diff line change 298
298
) . to eq ( [ 'CN=signed' , 'CN=Test CA Subauthority' , 'CN=Test CA' ] )
299
299
end
300
300
301
- it 'raises if client cert signature is invalid' do
301
+ it 'raises if client cert signature is invalid' , unless : Puppet :: Util :: Platform . jruby? && RUBY_VERSION . to_f >= 2.6 do
302
302
client_cert . sign ( wrong_key , OpenSSL ::Digest ::SHA256 . new )
303
303
expect {
304
304
subject . create_context ( **config . merge ( client_cert : client_cert ) )
337
337
end
338
338
end
339
339
340
- it 'raises if intermediate CA signature is invalid' do
340
+ it 'raises if intermediate CA signature is invalid' , unless : Puppet :: Util :: Platform . jruby? && RUBY_VERSION . to_f >= 2.6 do
341
341
int = global_cacerts . last
342
342
int . sign ( wrong_key , OpenSSL ::Digest ::SHA256 . new )
343
343
You can’t perform that action at this time.
0 commit comments