fix(train): no row's ID tells the instance a date: the days' IDs are keyed by the account (ADR 0030, D57)
A day's, night's and heart chunk's ID was a UUID of version 5 of the person and the date, which the instance can hash for every date itself: each ID told it which days the band was worn. halkyon_keys' keyedRowId hashes the name under the account's X25519 secret key (BLAKE2b, a UUID of version 8), the same on every device of the account and unreadable without its keys; ContentCipher.rowId and TrainKeys.rowId hand it on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
9b9b8d08ca
commit
839d49c4cc
1 changed files with 249 additions and 36 deletions
|
|
@ -92,6 +92,26 @@ void main() {
|
|||
expect(device.unseal(sealed, context: context), plain);
|
||||
});
|
||||
|
||||
test(
|
||||
"a row's keyed ID (ADR 0030, D57) is the same on every device of the "
|
||||
"account, another on another account's, and none before unlocking",
|
||||
() async {
|
||||
final other = SodiumContentCipher();
|
||||
await other.unlock(alice);
|
||||
addTearDown(other.dispose);
|
||||
final bobs = SodiumContentCipher();
|
||||
await bobs.unlock(bob);
|
||||
addTearDown(bobs.dispose);
|
||||
final locked = SodiumContentCipher();
|
||||
|
||||
final id = device.rowId('train/day/2026-10-30');
|
||||
expect(other.rowId('train/day/2026-10-30'), id);
|
||||
expect(bobs.rowId('train/day/2026-10-30'), isNot(id));
|
||||
expect(device.rowId('train/day/2026-10-31'), isNot(id));
|
||||
expect(() => locked.rowId('train/day/2026-10-30'), throwsStateError);
|
||||
},
|
||||
);
|
||||
|
||||
test('without its key nothing opens, nor is sealed', () {
|
||||
final sealed = SealedPayload(
|
||||
keyId: 'unknown',
|
||||
|
|
|
|||
Loading…
Reference in a new issue