From c0026d35ff263ff28140082fefa54d166b4d843d Mon Sep 17 00:00:00 2001 From: Augustin Gottlieb <33221555+aguspe@users.noreply.github.com> Date: Sat, 7 Mar 2026 23:17:57 +0100 Subject: [PATCH 1/2] Fix credential issue with private key This commit fix the bug https://github.com/SeleniumHQ/selenium/issues/16916 where the type of private key is wrong, I also updated the test --- .../webdriver/common/virtual_authenticator/credential.rb | 2 +- rb/spec/unit/selenium/webdriver/common/credentials_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rb/lib/selenium/webdriver/common/virtual_authenticator/credential.rb b/rb/lib/selenium/webdriver/common/virtual_authenticator/credential.rb index cc81f65ae38a6..cddac059f1e7f 100644 --- a/rb/lib/selenium/webdriver/common/virtual_authenticator/credential.rb +++ b/rb/lib/selenium/webdriver/common/virtual_authenticator/credential.rb @@ -47,7 +47,7 @@ def from_json(opts) new(id: decode(opts['credentialId']), resident_credential: opts['isResidentCredential'], rp_id: opts['rpId'], - private_key: opts['privateKey'], + private_key: decode(opts['privateKey']), sign_count: opts['signCount'], user_handle: user_handle) end diff --git a/rb/spec/unit/selenium/webdriver/common/credentials_spec.rb b/rb/spec/unit/selenium/webdriver/common/credentials_spec.rb index fb55a99801c34..74176e65931da 100644 --- a/rb/spec/unit/selenium/webdriver/common/credentials_spec.rb +++ b/rb/spec/unit/selenium/webdriver/common/credentials_spec.rb @@ -95,7 +95,7 @@ module WebDriver expect(credential.resident_credential?).to be(true) expect(credential.rp_id).to eq('localhost') expect(credential.user_handle).to eq(user_handle) - expect(credential.private_key).to eq(base64_encoded_pk) + expect(credential.private_key).to eq(described_class.decode(base64_encoded_pk)) expect(credential.sign_count).to eq(0) end end From 7bc18fee54a8d9de4770a12168565dae989f723a Mon Sep 17 00:00:00 2001 From: Augustin Gottlieb <33221555+aguspe@users.noreply.github.com> Date: Wed, 11 Mar 2026 17:43:46 +0100 Subject: [PATCH 2/2] Update rb/spec/unit/selenium/webdriver/common/credentials_spec.rb Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- rb/spec/unit/selenium/webdriver/common/credentials_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rb/spec/unit/selenium/webdriver/common/credentials_spec.rb b/rb/spec/unit/selenium/webdriver/common/credentials_spec.rb index 74176e65931da..4d8525b3f6348 100644 --- a/rb/spec/unit/selenium/webdriver/common/credentials_spec.rb +++ b/rb/spec/unit/selenium/webdriver/common/credentials_spec.rb @@ -95,7 +95,7 @@ module WebDriver expect(credential.resident_credential?).to be(true) expect(credential.rp_id).to eq('localhost') expect(credential.user_handle).to eq(user_handle) - expect(credential.private_key).to eq(described_class.decode(base64_encoded_pk)) + expect(credential.private_key).to eq(private_key) expect(credential.sign_count).to eq(0) end end