Skip to content

feat: add device public key and fingerprint for cross-layer binding#46

Merged
felippemsc merged 3 commits intomainfrom
feature/cross-layer-binding
Feb 17, 2026
Merged

feat: add device public key and fingerprint for cross-layer binding#46
felippemsc merged 3 commits intomainfrom
feature/cross-layer-binding

Conversation

@felippemsc
Copy link
Contributor

@felippemsc felippemsc commented Feb 17, 2026

Summary

  • Require public_key (Base64 uncompressed EC point) in POST /devices request- Compute device_public_key_fingerprint (SHA-256 hex of raw key bytes) and store both on the Device model as NOT NULL columns
  • Carry fingerprint through session cache into JWT claims, binding the Capture Trust layer to the Media Integrity layer
  • Add Alembic migration for the two new columns

Context

The sidecar's two layers (Capture Trust JWT + Media Integrity ECDSA proof) were not cryptographically bound.
An attacker could reuse a valid JWT with a forged media integrity proof signed by a different key pair.
Including the device's content-signing public key fingerprint in the JWT closes this gap.
Validators can now verify that the public key in the sidecar matches the one the server saw at registration.

Test plan

  • All 21 unit tests pass (test_device.py, test_capture.py)
  • All integration tests pass (test_device_flow.py, test_capture_flow.py, test_jwks.py)
  • alembic upgrade head applies cleanly
  • POST /devices without public_key returns 422
  • POST /devices with public_key stores both key and fingerprint
  • Full capture flow produces JWT with device_public_key_fingerprint claim
  • SHA-256(base64_decode(public_key)) matches the JWT claim

@felippemsc felippemsc added the deploy-rc Deploys release candidate to dev environment label Feb 17, 2026
@github-actions
Copy link

🚀 Release Candidate Deployed!

Version: v0.0.27-rc.46

The RC has been deployed to the dev environment. Check the /health endpoint to verify.

@felippemsc felippemsc removed the deploy-rc Deploys release candidate to dev environment label Feb 17, 2026
@felippemsc felippemsc added the deploy-rc Deploys release candidate to dev environment label Feb 17, 2026
@github-actions
Copy link

🚀 Release Candidate Deployed!

Version: v0.0.28-rc.46

The RC has been deployed to the dev environment. Check the /health endpoint to verify.

@felippemsc felippemsc added deploy-rc Deploys release candidate to dev environment and removed deploy-rc Deploys release candidate to dev environment labels Feb 17, 2026
@github-actions
Copy link

🚀 Release Candidate Deployed!

Version: v0.0.29-rc.46

The RC has been deployed to the dev environment. Check the /health endpoint to verify.

@felippemsc felippemsc merged commit 1716c82 into main Feb 17, 2026
5 checks passed
@felippemsc felippemsc deleted the feature/cross-layer-binding branch February 17, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy-rc Deploys release candidate to dev environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments