Repository navigation
feat(api): report client certificate fingerprints - #5984
Open
miguelangel-nubla wants to merge 2 commits into
Open
miguelangel-nubla wants to merge 2 commits into
miguelangel-nubla wants to merge 2 commits into
Conversation
Add a `fingerprint` field (SHA-256 of the client certificate's DER encoding, uppercase hex) to each entry of `GET /api/pin` and `GET /api/clients/list`. A pairing request has carried the client's certificate since its first phase, but the web API exposed only the client-reported name and the source address. Neither identifies a device: Moonlight sends a fixed device name, and an address can be shared (several Moonlight forks on one device) or rewritten (NAT, VPN). With the fingerprint, an operator or a management tool can tell which device a waiting request comes from, and that it is the same device already paired under some name, before approving it.
miguelangel-nubla
marked this pull request as ready for review
October 23, 2026 14:37
|
This branch has not been deployed
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.



Description
Adds a
fingerprintfield to each entry ofGET /api/pin(pending pairing requests) andGET /api/clients/list(paired clients): the SHA-256 of the client certificate's DER encoding, as upper-case hex without separators (the digestopenssl x509 -fingerprint -sha256prints).A pairing request carries the client's certificate from its first phase, but the web API only shows the device name the client reports and the source address. Neither identifies a device:
With the fingerprint, an operator or a management tool can tell which device a waiting request comes from before approving it, and whether that device is already paired under some name. The fingerprint a request reports is the one
/api/clients/listshows once it is paired, and a device has the same fingerprint on every host.Changes:
crypto::fingerprint256(): parses the PEM certificate and returns the digest, or an empty string when the PEM is invalid.nvhttp::pending_pairing_t::fingerprint, filled byget_pending_pairings(), and afingerprintkey inget_all_clients().confighttp::getPendingPairings()andgetClients()document their response format, andGET /api/pinis added todocs/api.md, where it was missing.The fields are additive; existing fields and behaviour are unchanged.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Testing
New unit tests:
CryptoTest.Fingerprint256HashesTheDerCertificate: the result matches an independently computed SHA-256 ofi2d_X509, and two certificates give different fingerprints.CryptoTest.Fingerprint256OfInvalidCertificateIsEmptyPairingSessionRegistryTest.PendingPairingReportsClientCertificateFingerprint: a pending request reports its certificate's fingerprint, and one without a valid certificate reports an empty one.ClientAuthorizationTest.ClientListReportsCertificateFingerprintsRuns:
docker buildx bake ubuntu-24-04, without CUDA: 866 tests, 859 passed, 0 failed, 7 skipped for lack of hardware (GPU encoders, system tray, PipeWire).Not run: Windows, FreeBSD and the CUDA build.
Type of Change
Checklist
AI Usage
See our AI usage policy.
Claude Code wrote the change, the tests and this description. The test results above are from the runs described.
🤖 Generated with Claude Code