Skip to content

Commit 43d0f24

Browse files
fix(test): use 2048 bits in RSA key when encoding with JWT
- JWT 3 requires the RSA key to be 2048 bits, see: jwt/ruby-jwt#661
1 parent 470b4f6 commit 43d0f24

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

spec/spec_helper.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,8 @@ def finder_for(certificate_file, return_empty: false)
114114
RootCertificateFinder.new(certificate_file, return_empty)
115115
end
116116

117-
def create_rsa_key
118-
key_bits = 1024 # NOTE: Use 2048 or more in real life! We use 1024 here just for making the test fast.
119-
117+
# NOTE: Use 2048 or more in real life! We use 1024 here just for making the test fast.
118+
def create_rsa_key(key_bits = 1024)
120119
OpenSSL::PKey::RSA.new(key_bits)
121120
end
122121

spec/webauthn/attestation_statement/android_safetynet_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
OpenSSL::Digest::SHA256.digest(authenticator_data_bytes + client_data_hash)
3131
)
3232
end
33-
let(:attestation_key) { create_rsa_key }
33+
let(:attestation_key) { create_rsa_key(key_bits = 2048) }
3434

3535
let(:leaf_certificate) do
3636
issue_certificate(root_certificate, root_key, attestation_key, name: "CN=attest.android.com")

0 commit comments

Comments
 (0)