Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown keyword: :curve (ArgumentError) occurs when registering a passkey using the ECC algorithm #10

Closed
majora-mask opened this issue Nov 21, 2024 · 2 comments
Assignees

Comments

@majora-mask
Copy link

When registering a passkey in Windows 11, if some conditions are met, the title exception will occur and registration will fail.

Condition

  • Windows 11 23H2
  • Google Chrome 131.0.6778.86
  • Turn off “Offer to save passwords and passkeys” in Google Password Manager settings
  • Hardware TPM2.0 is used (I am not sure, but this was necessary in my verification)

Environments

  • Ruby: 3.1.4
  • Rails: 6.1.7.4 (also had the same problem with 7.0.8.5)
  • OpenSSL Gem: 3.2.0
  • OpenSSL Library Version: OpenSSL 1.1.1.w 11 Sep 2023
  • webauthn-ruby Gem: 3.1.0
  • tpm-key-attestation Gem: 0.12.0
  • openssl-signature_algorithm Gem: 1.3.0

Code for WebAuthn::Credential.options_for_create

WebAuthn::Credential.options_for_create(
  user: {
    id: user.webauthn_id,
    name: user.username
  },
  exclude: user.webauthn_credentials.pluck(:external_id),
  authenticator_selection: {
    authenticator_attachment: :platform,
    resident_key: :preferred,
    user_verification: :required,
  },
  attestation: "direct"
)

Error Details

/Users/majora-mask/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/openssl-signature_algorithm-1.3.0/lib/openssl/signature_algorithm/rsa.rb:39:in `initialize': unknown keyword: :curve (ArgumentError)
  from /Users/majora-mask/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/tpm-key_attestation-0.12.0/lib/tpm/certify_validator.rb:47:in `new'
  from /Users/majora-mask/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/tpm-key_attestation-0.12.0/lib/tpm/certify_validator.rb:47:in `valid_signature?'
  from /Users/majora-mask/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/tpm-key_attestation-0.12.0/lib/tpm/certify_validator.rb:34:in `valid?'
  from /Users/majora-mask/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/tpm-key_attestation-0.12.0/lib/tpm/key_attestation.rb:63:in `valid?'
  from /Users/majora-mask/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/webauthn-3.1.0/lib/webauthn/attestation_statement/tpm.rb:48:in `valid_key_attestation?'
  from /Users/majora-mask/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/webauthn-3.1.0/lib/webauthn/attestation_statement/tpm.rb:23:in `valid?'
  from /Users/majora-mask/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/webauthn-3.1.0/lib/webauthn/attestation_object.rb:41:in `valid_attestation_statement?'
  from /Users/majora-mask/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/webauthn-3.1.0/lib/webauthn/authenticator_attestation_response.rb:80:in `valid_attestation_statement?'
  from /Users/majora-mask/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/webauthn-3.1.0/lib/webauthn/authenticator_response.rb:64:in `verify_item'
  from /Users/majora-mask/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/webauthn-3.1.0/lib/webauthn/authenticator_attestation_response.rb:45:in `verify'
  from /Users/majora-mask/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/webauthn-3.1.0/lib/webauthn/public_key_credential_with_attestation.rb:15:in `verify'
  from /Users/majora-mask/IdeaProjects/webauthn-demo/app/controllers/webauthn_credentials_controller.rb:1:in `create'
  from /Users/majora-mask/IdeaProjects/webauthn-demo/app/controllers/webauthn_credentials_controller.rb:39:in `create'

Investigated

Please investigate the cause and correct the problem!

@santiagorodriguez96
Copy link
Contributor

Hey! Thank you taking the time to report the issue!

I think this is more of an issue of tpm-key_attestation that it's trying to initialize a OpenSSL::SignatureAlgorithm::RSA but incorrectly passing an curve keyword argument. I've opened this same issue in tpm-key_attestation to move the discussion there 🙂

@majora-mask
Copy link
Author

I'm very grateful for your investigation of the issue.

I look forward to continuing to work with you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants