Skip to content

Commit 0c90e0d

Browse files
authored
Merge pull request #1255 from cipherstash/docs/passthrough-unauthenticated
docs(stack-encrypt): say that dynamic::record::decrypt returns passthrough fields unauthenticated
2 parents 3cba0f6 + 969b38c commit 0c90e0d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,15 @@ 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. 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.
1413+
///
14051414
/// `expected` is the context the caller expects, for a plan with a
14061415
/// [context field](Plan::with_context_field): the chain's
14071416
/// `open(record).context(expected)`. Each record's stored context field is

0 commit comments

Comments
 (0)