Bind runtime handoff to node proof

This commit is contained in:
冰朔 2026-08-10 08:25:34 +08:00
commit 46d19aeb45
7 changed files with 249 additions and 55 deletions

View file

@ -91,7 +91,10 @@ test('verifies a fresh proof from the key fingerprint bound into the signed regi
'A'.repeat(43),
);
const response = responseFor(challenge);
assert.equal(verifyNodePossessionResponse(response, challenge, registration, NOW + 1), true);
const possession = verifyNodePossessionResponse(response, challenge, registration, NOW + 1);
assert.equal(possession.registration, registration);
assert.equal(possession.challenge, challenge);
assert.deepEqual(possession.response, response);
assert.throws(() => verifyNodePossessionResponse(response, challenge, registration, NOW + 2), /proof_invalid/);
});