TPLSignatureSourceLimits

security and signatures

Description

TPLSignatureSourceLimits bounds the effort one source audit may spend. Callers normally start from the record returned by PLDefaultSignatureSourceLimits, which holds the documented defaults of 64 MiB per byte counter, 100000 nodes, depth 64 and 16 MiB per object, then narrow the field they care about.

The same record is used by every overload of PLAuditSignatureSource, including the stream and callback forms, so a caller can reason about one set of bounds regardless of how the bytes are reached.

Syntax

Delphi

TPLSignatureSourceLimits = record
  MaxBytes: Int64;
  MaxNodes, MaxDepth, MaxObjectBytes: Integer;
end;

Fields

MaxBytesCeiling for Budget.ReadBytes and, separately, for Budget.ScannedBytes; 0 disables the audit
MaxNodesCeiling for Budget.Nodes; 0 disables the audit
MaxDepthNesting ceiling shared by object depth, literal string depth, cross-reference decoding parameters, revision chain length and locator path length; values above 256 are clamped to 256
MaxObjectBytesLargest single parsed object or token slice; values below 20 disable the audit

Remarks

Depth clamping happens when the audit starts and is silent: a value of 1000 is treated as 256 rather than rejected.

A zero in MaxBytes, MaxNodes or MaxDepth, or MaxObjectBytes below 20, makes every call return sssIncomplete with an argument diagnostic instead of a verdict.

MaxObjectBytes also caps the length of a single plain token, so a document with very long literal strings can need a larger value even when the total byte budget is generous.

The record holds only plain integers, so it can be filled field by field, passed by value and stored without any lifetime management.

See also

PLAuditSignatureSource, PLCheckSignatureByteRange