Skip to content

Commit 95c6ae6

Browse files
committed
docs(stack-encrypt): say that dynamic::record::decrypt returns passthrough fields unauthenticated
A passthrough field comes back beside the decrypted ones in one map, but nothing authenticates it: a writer to the store can change it and decrypt succeeds. The decrypt docs now say so.
1 parent 6197e29 commit 95c6ae6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎packages/stack-encrypt/src/dynamic/record.rs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,11 @@ fn name_target(error: TargetError, field: &str) -> TargetError {
14021402
/// into its entry of the record's frame and wiped; no value tree holds the
14031403
/// plaintext.
14041404
///
1405+
/// A passthrough field comes back exactly as the store holds it, beside the
1406+
/// decrypted fields in the same map. It is not authenticated: anyone who can
1407+
/// write to the store can change it, and `decrypt` does not detect the
1408+
/// change. Only the fields a plan seals (`"c"`) are checked.
1409+
///
14051410
/// `expected` is the context the caller expects, for a plan with a
14061411
/// [context field](Plan::with_context_field): the chain's
14071412
/// `open(record).context(expected)`. Each record's stored context field is

0 commit comments

Comments
 (0)