Skip to content

feat: support ML-DSA signature algorithms - #529

Draft
CommanderTvis wants to merge 1 commit into
cedarcode:masterfrom
CommanderTvis:ml-dsa-android-key
Draft

CommanderTvis wants to merge 1 commit into
cedarcode:masterfrom
CommanderTvis:ml-dsa-android-key

Conversation

@CommanderTvis

Copy link
Copy Markdown

Refs #528. Draft until cedarcode/cose-ruby#90 is merged and released, since the ML-DSA specs need it.

Changes

  • AttestationStatement::Base#matching_public_key? compares DER encodings with to_der, which OpenSSL::PKey::PKey objects other than EC/RSA (e.g. ML-DSA) don't have. It now falls back to public_to_der. This also fixes a NoMethodError for android-key/apple attestation with such keys.
  • FakeAuthenticator can build an ML-DSA credential public key, when cose supports it.
  • README.md mentions config.algorithms << "ML-DSA-65". Defaults are unchanged.
  • CHANGELOG.md entry under Unreleased.

Tests: android_key_spec.rb gets an ML-DSA-65 context (valid signature, and a signature from another key). They are skipped when OpenSSL < 3.5 or cose has no COSE::Key::AKP, so CI stays green before the cose release. Without the lib/ changes, the two new specs fail against the cose branch of #90.

Checks: with cose from #90 on OpenSSL 3.5, bundle exec rspec gives 534 examples, 0 failures; with the released cose 1.4.0 it's 534 examples, 0 failures, 2 pending (the ML-DSA ones). rubocop reports no offenses. I also ran real ES256, RS256, PS256, ML-DSA-65 and ML-DSA-87 android-key registrations and assertions through the public Credential API, and all pass with the change. I haven't run the older Ruby/OpenSSL combinations in the CI matrix.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant