Skip to content

Clean up stale SignifyClient key state after rotate by Re-GETting managed identifier keystate #306

@kentbull

Description

@kentbull

Version

0.3.0-rc1

Environment

NodeJS, MacOS Sequoia

Expected behavior

The Keeper kidx should update to the latest keystate after rotating a managed identifier (sub-identifier of Client AID).

Actual behavior

Currently the kidx becomes stale in any active instances of a SignifyClient so that when a SignifyClient.manager.get(HabState) invocation happens then the returned Keeper has an old, stale kidx.

Steps to reproduce

  1. Initialize three separate SignifyClient instances with three separate salts. Use these same clients for all below steps.
  2. Create a multisig AID with three participants, Q1, Q2, and Q3.
  3. Get the AID state of each participant with SignifyClient.identifiers.get(name). Use this same client for the individual single sig rotation as well as the multisig rotation operations. Do NOT re-execute SignifyClient.identifiers.get(name)because that will refresh thekidx. The bug is that kidx` does not automatically update upon rotating a managed AID.
  4. Rotate each of the participating identifiers and refresh keystate between all three identifiers.
  5. Begin a multisig rotation by creating a drt event with SignifyClient.identifiers().rotate(multisigName, kargs).
  6. Create the exchange message for this multisig and send it to KERIA
  7. KERIA will fail signature validation when ExchangeCollectionEnd.on_post makes the call to:
agent.hby.psr.parseOne(ims=bytearray(ims))

after it gets through

# parseOne -> 
#   onceParsator -> 
#     msgParsator ->
#       Exchanger.processEvent ->
#         ...
        _, eventing.verifySigs(serder.raw, sigers, verfers) ->
# eventing.verifySigs
          ...
          if siger.verfer.verify(siger.raw, raw):  # <-- fails signature verification here because the stale `kidx` was used to select the signing key in the SignifyClient

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNeeds assessment

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions