Test root keys handed to new holders; sr25519 signing context vectors (#34)

- Interceptor test: a root that gives the root keys to new holders is
  followed only with two signatures from the old root keys and two from the
  new ones; with the old ones alone it is refused and nothing is stored.
- Device test with fixed vectors: the signed config check accepts an sr25519
  signature over <Bytes>message</Bytes> made under the substrate signing
  context and refuses one made under bizinikiwi. The utils root check and
  signing page count only substrate signatures because of this; sr25519 is
  native code, so only a device can confirm it.
This commit is contained in:
SatoshiQaziMuhammed authored and GitHub committed 2026-11-05 02:29:13 +04:00
1 parent 58ef588261
commit 295a0df17d
2 files changed
+57

No files matched your search

@@ -174,6 +174,22 @@ class SignedConfigInterceptorTest {
assertNull(fetch(CHAINS))
}
@Test
fun `root keys handed to new holders need two old and two new signatures`() {
val newHolders = List(3) { Key("sr25519") }
val root2 = rootPayload(2, newHolders, targetsKey)
publish(CHAINS to chains)
served["signed/root.2.json"] = envelope(root2, rootKeys[0], rootKeys[1])
assertNull(fetch(CHAINS))
assertNull(store.trustedRoot)
served["signed/root.2.json"] = envelope(root2, rootKeys[0], rootKeys[1], newHolders[0], newHolders[2])
now += 600
assertEquals("[\"pezkuwi\"]", fetch(CHAINS))
assertNotNull(store.trustedRoot)
}
@Test
fun `a root signed by one root key is not followed`() {
val newTargetsKey = Key("ed25519")