-
Notifications
You must be signed in to change notification settings - Fork 42
Clean up stale SignifyClient key state after rotate by Re-GETting managed identifier keystate #306
Copy link
Copy link
Open
Labels
Description
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
- Initialize three separate SignifyClient instances with three separate salts. Use these same clients for all below steps.
- Create a multisig AID with three participants, Q1, Q2, and Q3.
- 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 thatkidx` does not automatically update upon rotating a managed AID. - Rotate each of the participating identifiers and refresh keystate between all three identifiers.
- Begin a multisig rotation by creating a
drtevent withSignifyClient.identifiers().rotate(multisigName, kargs). - Create the exchange message for this multisig and send it to KERIA
- KERIA will fail signature validation when
ExchangeCollectionEnd.on_postmakes 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 SignifyClientReactions are currently unavailable