From fb65495625b4c2867c081e453ba7a911401607f2 Mon Sep 17 00:00:00 2001 From: kares Date: Wed, 1 Jul 2026 16:24:11 +0200 Subject: [PATCH] use proper order of 2 when generating RSA with Java crypto providers generating primes with sizes that aren't 2^x isn't really supported --- spec/jwt/jwa/ps_spec.rb | 2 +- spec/jwt/jwa/rsa_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/jwt/jwa/ps_spec.rb b/spec/jwt/jwa/ps_spec.rb index 1043e9bc5..2aa2983b0 100644 --- a/spec/jwt/jwa/ps_spec.rb +++ b/spec/jwt/jwa/ps_spec.rb @@ -48,7 +48,7 @@ end context 'with a key length less than 2048 bits' do - let(:rsa_key) { OpenSSL::PKey::RSA.generate(2047) } + let(:rsa_key) { OpenSSL::PKey::RSA.generate(1536) } it 'raises an error' do expect do diff --git a/spec/jwt/jwa/rsa_spec.rb b/spec/jwt/jwa/rsa_spec.rb index 318ea8e6e..4f39cc20a 100644 --- a/spec/jwt/jwa/rsa_spec.rb +++ b/spec/jwt/jwa/rsa_spec.rb @@ -21,7 +21,7 @@ end context 'with a key length less than 2048 bits' do - let(:rsa_key) { OpenSSL::PKey::RSA.generate(2047) } + let(:rsa_key) { OpenSSL::PKey::RSA.generate(1024) } it 'raises an error' do expect do