Summary
TrustManager.verifyPeer accepts uppercase hexadecimal DID fingerprints at format-validation time, but then compares the fingerprint to a lowercase digest using a case-sensitive string comparison.
This rejects an otherwise valid fingerprint value that differs only by hex letter casing.
Reproduction (public API)
- Generate an identity with
AgentIdentity.generate("peer-agent").
- Export with
exportJSON() and replace the DID fingerprint suffix with its uppercase form.
- Re-import via
AgentIdentity.fromJSON(...).
- Call
TrustManager.verifyPeer("peer-agent", identity).
Observed result:
verified === false
reason === "Peer identity DID fingerprint does not match the public key"
Additional check in the same repro:
uppercaseFingerprint.toLowerCase() === expectedFingerprint.toLowerCase() is true.
Expected behavior
If fingerprint format validation accepts uppercase hex, verification should not fail when the value differs only by case.
Actual behavior
Verification fails due to case-sensitive comparison.
Implementation evidence
In agent-governance-typescript/src/trust.ts:
- format check uses
/^[0-9a-f]{16}$/i (case-insensitive)
- comparison uses
didFingerprint !== expectedFingerprint (case-sensitive)
Suggested fix
Normalize both values before comparison (for example, compare ToLowerInvariant() / .toLowerCase() values) so the comparison matches the accepted hex format semantics.
Environment
- Repository:
microsoft/agent-governance-toolkit
- Branch:
main
- Commit verified:
e5693cb11db5e336508ee0a793356ccfb84c1834
- Platform used for repro: Windows
Summary
TrustManager.verifyPeeraccepts uppercase hexadecimal DID fingerprints at format-validation time, but then compares the fingerprint to a lowercase digest using a case-sensitive string comparison.This rejects an otherwise valid fingerprint value that differs only by hex letter casing.
Reproduction (public API)
AgentIdentity.generate("peer-agent").exportJSON()and replace the DID fingerprint suffix with its uppercase form.AgentIdentity.fromJSON(...).TrustManager.verifyPeer("peer-agent", identity).Observed result:
verified === falsereason === "Peer identity DID fingerprint does not match the public key"Additional check in the same repro:
uppercaseFingerprint.toLowerCase() === expectedFingerprint.toLowerCase()istrue.Expected behavior
If fingerprint format validation accepts uppercase hex, verification should not fail when the value differs only by case.
Actual behavior
Verification fails due to case-sensitive comparison.
Implementation evidence
In
agent-governance-typescript/src/trust.ts:/^[0-9a-f]{16}$/i(case-insensitive)didFingerprint !== expectedFingerprint(case-sensitive)Suggested fix
Normalize both values before comparison (for example, compare
ToLowerInvariant()/.toLowerCase()values) so the comparison matches the accepted hex format semantics.Environment
microsoft/agent-governance-toolkitmaine5693cb11db5e336508ee0a793356ccfb84c1834