Repository navigation
General bugfixes - #661
Merged
Merged
General bugfixes#661
Conversation
aseigler
commented
Sep 10, 2026
Collaborator
- Adds a couple MDS summaries that are missing and fixes a minor spelling error
- Implements check for user.Id length (must be 1 - 64 bytes)
- Report Ed448 as unimplemented rather than unknown
- Skip the hash-algorithm detail TPM ECC/RSA schemes carry (fixes new conformance test fail)
…liance - Change distributed cache interval from 8 days to 25 hours - Update GetDistributedCacheAbsoluteExpiryTime to use buffer period semantics - This allows cross-server caching efficiency within MDS v3.1.1 rate limit window - Memory cache still expires at nextUpdateTime for rate limiting enforcement
WebAuthn requires a user handle of at least 1 and at most 64 bytes. The upper bound was already declared on PublicKeyCredentialUserEntity; the lower bound was not, and neither was checked when building creation options, so a zero-length handle reached the authenticator and failed there instead.
An Ed448 credential public key fell into the "Missing or unknown crv" branch and surfaced as an InvalidOperationException. The curve is well known, the gap is that NSec.Cryptography has no Ed448 support, so say that instead. WebAuthn L3 ships a test vector for this key type (§16.12).
Conformance test P-4 (a TPM attestation for ES256) failed the whole ceremony with a NullReferenceException in PubArea's constructor, reading a null ECPoint.X/Y. TPMU_ASYM_SCHEME (reached via TPMT_ECC_SCHEME/TPMT_RSA_SCHEME) is a union: its 2-byte algorithm selector is the entire field only when that selector is TPM_ALG_NULL. For every other scheme this library can see here -- ECDSA, RSASSA, RSAPSS, OAEP, ECDH, ECSCHNORR, SM2 -- the selector is followed by a TPMI_ALG_HASH naming the signature hash algorithm (ECDAA adds a further count). PubArea read the selector as if it were the whole field and moved on, so a pubArea naming an explicit hash algorithm shifted every field read after it -- CurveID, KDF, and the EC point -- two bytes out of place. fido2-net-lib's own TPM test fixtures never caught this because they all hardcode TPM_ALG_NULL for Scheme, the one selector value with no trailing detail; the FIDO conformance tool's TPM simulator sends TPM_ALG_ECDSA with an explicit TPM_ALG_SHA256 for ES256. PubArea now consumes and discards that detail once it reads the selector, so offsets stay aligned regardless of which scheme is named. A new test pins this down directly: constructing a pubArea with an ECDSA/SHA256 scheme reproduces the reported crash against the pre-fix code and passes against the fix.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #661 +/- ##
==========================================
+ Coverage 78.64% 80.12% +1.47%
==========================================
Files 98 98
Lines 2548 2556 +8
Branches 425 428 +3
==========================================
+ Hits 2004 2048 +44
+ Misses 434 398 -36
Partials 110 110 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Neither had any test exercising them. No test anywhere in the suite calls Fido2.RequestNewCredential() -- every other registration test builds CredentialCreateOptions directly via object initializer, bypassing the options-generation path entirely. That left the 1-64 byte user handle bound this branch adds (and the whole CredentialCreateOptions.Create factory around it) completely unverified. RequestNewCredentialTests covers the empty, null, oversized, and both boundary (1 and 64 byte) cases, plus a normal case asserting the returned options actually carry the challenge/user/rp. CredentialPublicKeyTests gains a case constructing an OKP/EdDSA/Ed448 key and asserting it's refused with Fido2VerificationException + UnimplementedAlgorithm rather than the InvalidOperationException it used to crash with.
aseigler
force-pushed
the
general-bugfixes
branch
from
September 11, 2026 23:37
ad7d36e to
d644a84
Compare
aseigler
added a commit
to aseigler/fido2-net-lib
that referenced
this pull request
Sep 12, 2026
Resolves conflicts arising from Fido2.Ctap2 and MDS work that had been developed in parallel on this branch and squash-merged separately upstream. Kept this branch's versions throughout, since they are a strict superset (BOM/CRLF-only diffs for shared CTAP2 files; MDS anchor fixes verified against the spec HTML; the metadata repository and CredentialPublicKey rewrites carry everything upstream had plus x5u support, rollback protection, and the CommandIdentifierArray converter). Updated Ed448IsRefusedAsInvalidRatherThanCrashing (renamed from ...Unimplemented) to match this branch's stricter, spec-correct handling of alg=EdDSA with crv=Ed448.
This was referenced Sep 21, 2026
This was referenced Sep 29, 2026
This was referenced Sep 29, 2026
This was referenced Oct 6, 2026
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.