Skip to content

Commit 969b38c

Browse files
committed
docs(stack-encrypt): carve the context field out of the unauthenticated-passthrough note
A plan's context field is stored as a passthrough, but a change to it is caught: every other field was sealed under it, so decrypt fails with ContextMismatch against the expected context, or the sealed fields do not open. Found by review on #1255.
1 parent 95c6ae6 commit 969b38c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,11 @@ fn name_target(error: TargetError, field: &str) -> TargetError {
14051405
/// A passthrough field comes back exactly as the store holds it, beside the
14061406
/// decrypted fields in the same map. It is not authenticated: anyone who can
14071407
/// write to the store can change it, and `decrypt` does not detect the
1408-
/// change. Only the fields a plan seals (`"c"`) are checked.
1408+
/// change. The fields a plan seals (`"c"`) are checked, and so, in effect, is
1409+
/// a plan's [context field](Plan::with_context_field), although it too is
1410+
/// stored as a passthrough: every other field was sealed under it, so a
1411+
/// changed context field either fails [`Error::ContextMismatch`](crate::Error::ContextMismatch)
1412+
/// against `expected` or leaves the sealed fields unable to open.
14091413
///
14101414
/// `expected` is the context the caller expects, for a plan with a
14111415
/// [context field](Plan::with_context_field): the chain's

0 commit comments

Comments
 (0)