Fix GXS identity validation for pre-0.6.8 identities by reconstructing legacy mServiceString used at signing time#292
Open
jolavillette wants to merge 1 commit into
Conversation
…g legacy mServiceString used at signing time
Contributor
|
Validating groups is already a burden. You really want to multiply it by 3? |
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.
Fix GXS identity validation for pre-0.6.8 identities by reconstructing legacy mServiceString used at signing time
Fix "Not found" identities from pre-0.6.8 nodes
Since commit c5135a2, mServiceString is excluded from the serialized payload (replaced by ""). However, service_CreateGroup() in p3idservice populates mServiceString before createGroup() computes the admin signature. This means all pre-0.6.8 identities were signed with a non-empty mServiceString, and strict admin validation (d82c7b5) now rejects them all.
Fix: After the standard verification fails, reconstruct the deterministic mServiceString that was present at identity creation time and retry signature verification. Three candidates are tried:
The mServiceString received from the network (covers edited identities)
The default anonymous creation string ("v2 {P:K:0 T:0 C:0}{T:F:0 P:0 T:0}{R:5 5 0 0}")
The default PGP-linked creation string (PGP ID extracted from received data)
Every candidate is fully verified cryptographically — no security exception is introduced. New identities continue to be signed with "" as intended.
Known limitations: The fallback may still fail for identities that were edited on 0.6.7 after mServiceString was locally modified by the service (e.g. reputation score change), and then forwarded through an intermediate node that overwrote mServiceString with its own local values. In that case the original signed data is irrecoverable. The fix also requires the PGP ID to still be present in the received mServiceString for PGP-linked identities.