Skip to content

fix(crypto): correct DeviceEntry publicKey validator length#178

Merged
FSM1 merged 1 commit into
mainfrom
fix/device-registry-publickey-validator
Feb 21, 2026
Merged

fix(crypto): correct DeviceEntry publicKey validator length#178
FSM1 merged 1 commit into
mainfrom
fix/device-registry-publickey-validator

Conversation

@FSM1

@FSM1 FSM1 commented Feb 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixed DeviceEntry.publicKey validator checking for 130 hex chars (uncompressed secp256k1) instead of 64 hex chars (Ed25519 32-byte key)
  • Updated test fixture to use correct 64-char Ed25519 key format
  • Corrected docs/METADATA_SCHEMAS.md to document 64 hex chars

Context

Device keypairs are Ed25519 (generateDeviceKeypair() → 32-byte public key → 64 hex chars), but the validator in schema.ts was checking for 130 chars (copy-pasted from secp256k1 uncompressed key validation). This would reject real device keys on encrypt→decrypt round-trip. Found by CodeRabbit on PR #175.

Test plan

  • All 225 crypto package tests pass (pnpm --filter @cipherbox/crypto test)
  • Verified Rust desktop has no equivalent bug (uses serde, no manual length check)

🤖 Generated with Claude Code

…ex chars

Device keypairs are Ed25519 (32-byte public key = 64 hex chars), but the
validator was checking for 130 chars (uncompressed secp256k1). This would
reject real device keys on encrypt→decrypt round-trip. Also fixes test
fixture and docs to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 944ab984b10d
@coderabbitai

coderabbitai Bot commented Feb 21, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@FSM1 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 8 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/device-registry-publickey-validator

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@FSM1 FSM1 enabled auto-merge (squash) February 21, 2026 03:06
@FSM1 FSM1 merged commit f5be3cb into main Feb 21, 2026
8 checks passed
@FSM1 FSM1 deleted the fix/device-registry-publickey-validator branch February 21, 2026 06:17
This was referenced Mar 23, 2026
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