Merge branch 'main' into claude/beautiful-brahmagupta-17clq5

This commit is contained in:
David Kaspar
2026-09-13 10:20:46 +02:00
committed by GitHub
@@ -420,8 +420,21 @@ class SecureKeyStorageVaultTest {
} }
storage.enableConsolidatedVault(listOf("account-metadata-key")) storage.enableConsolidatedVault(listOf("account-metadata-key"))
// An alias the vault never covered still falls through to the strict probe: // An alias the vault never covered still falls through to the strict probe.
// a confirmed miss is null, an ambiguous answer still throws. // Off macOS that probe is javakeyring, which cannot tell a miss from a denial,
// so the strict contract there is to throw on any miss.
if (!System.getProperty("os.name").orEmpty().startsWith("Mac")) {
try {
storage.getPrivateKeyOrThrow("npub1neverseen")
throw AssertionError("Expected SecureStorageException for a non-mac keyring miss")
} catch (e: SecureStorageException) {
// Walk the chain: coroutine stack-trace recovery may wrap the original.
assertTrue(generateSequence<Throwable>(e) { it.cause }.any { it is PasswordAccessException })
}
return@runBlocking
}
// On macOS a confirmed miss is null, an ambiguous answer still throws.
wireMacProbe(storage, backend) wireMacProbe(storage, backend)
assertNull(storage.getPrivateKeyOrThrow("npub1neverseen")) assertNull(storage.getPrivateKeyOrThrow("npub1neverseen"))