File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ def self.openssl_3?
2727 end
2828
2929 def self . openssl_3_hmac_empty_key_regression?
30- openssl_3? && ::Gem ::Version . new ( OpenSSL ::VERSION ) <= ::Gem ::Version . new ( '3.0.0' )
30+ openssl_3? && openssl_version <= ::Gem ::Version . new ( '3.0.0' )
31+ end
32+
33+ def self . openssl_version
34+ @openssl_version ||= ::Gem ::Version . new ( OpenSSL ::VERSION )
3135 end
3236end
Original file line number Diff line number Diff line change 171171 context 'when e, n, d is given' do
172172 let ( :jwk_parameters ) { all_jwk_parameters . slice ( :e , :n , :d ) }
173173
174+ before do
175+ skip 'OpenSSL prior to 2.2 does not seem to support partial parameters' if ::JWT . openssl_version < ::Gem ::Version . new ( '2.2' )
176+ end
177+
174178 it 'creates a valid RSA object representing a private key' do
175179 expect ( subject ) . to be_a ( ::OpenSSL ::PKey ::RSA )
176180 expect ( subject . private? ) . to eq ( true )
196200
197201 describe '.create_rsa_key_using_sets' do
198202 before do
199- skip unless OpenSSL ::PKey ::RSA . new . respond_to? ( :set_key )
200- skip if ::JWT . openssl_3?
203+ skip 'OpenSSL without the RSA#set_key method not supported' unless OpenSSL ::PKey ::RSA . new . respond_to? ( :set_key )
204+ skip 'OpenSSL 3.0 does not allow mutating objects anymore' if ::JWT . openssl_3?
201205 end
202206
203207 subject ( :rsa ) { described_class . create_rsa_key_using_sets ( rsa_parameters ) }
You can’t perform that action at this time.
0 commit comments