Native OCSP nonce policy

Security and signatures

Requires the Enterprise edition — part of the Enterprise signature verification and revocation surface in TPDFlibSignatureVerifier (unit PDFlibEntSignVerify)

Description

The nonce policy nonmDisabled, nonmPrefer or nonmRequire controls whether native OCSP requests carry a 32-byte nonce, how it is reused across responder URLs within one verification, and which fetched or supplied responses pass the response syntax checks. Use it when replay protection for OCSP responses must be enforced or explained, including its limits for cached, archival and historical timestamp evidence.

Selection

Verifier.NativeOCSPNonceMode := nonmRequire;

NativeOCSPNonceMode uses TPDFlibNativeOCSPNonceMode and applies to native non-Windows signer-chain and timestamp OCSP retrieval

The property persists when opening another document or clearing trust anchors; the Windows CryptoAPI route retains its existing policy

nonmDisabledDefault: send the existing nonce-free request and use normal signed evidence checks
nonmPreferSend a nonce, require equality when a response nonce is present, and permit a response that omits the nonce
nonmRequireSend a nonce and admit the fetched OCSP response only when its valid nonce exactly matches

Request generation and reuse

Enabled requests use a 32-byte nonce from the selected OpenSSL provider's RAND_bytes CSPRNG, following the requester minimum in RFC 9654

OpenSSL OCSP_request_add1_nonce encodes the nonce as an OCTET STRING inside the extension's extnValue OCTET STRING

Generation or encoding failure never silently creates a nonce-free OCSP request; other independently applicable CRL evidence remains eligible

Within one verification call, each exact certificate/issuer pair reuses one request and nonce across responder URLs and GET/POST fallback

The cache permits at most 1024 certificate/issuer pairs; each request remains bounded to 64 KiB, and a later verification call generates fresh nonces

Reuse preserves duplicate suppression: rejected, unknown or unusable responses cannot consume repeated attempts merely because a new random nonce changed the request identity

Nonce-bearing GET URLs use the same percent-escaped encoding and complete URL length rules as NativeOCSPHTTPMethod

An explicit PFX request identity signs the nonce-bearing request without changing its nonce policy or request reuse

Response checks

A known nonce extension must contain one canonical encoded OCTET STRING with 1 through 128 nonce bytes; duplicate or critical nonce extensions, invalid lengths, malformed values and trailing value bytes are rejected

Extension OID lengths and base-128 subidentifiers must use their minimal encoding, preventing malformed nonce OIDs from being treated as an omitted nonce

This syntax check also applies to supplied DSS and CMS archival OCSP responses, including when online nonce generation is disabled

A matching nonce supplies request binding only: response signature, signer authorization, exact CertID, certificate trust, thisUpdate, producedAt and nextUpdate checks remain mandatory

Invalid or mismatched fetched responses provide no coverage and remain eligible for the existing CRL fallback and shared request/time/byte limits

Unresolved coverage returns stsRevocationUnknown unless another authenticated source establishes good or revoked status; NativeError can retain the underlying chain or CRL diagnostic

Cached and historical evidence

The policy controls online OCSP requests and their fetched responses; it does not require existing DSS, archival or CRL evidence to contain the nonce of a request that has not yet been made

Complete authenticated supplied coverage is used before retrieval, even in nonmRequire mode

Supplied responses with a well-formed nonce remain subject to ordinary independent trust and time checks, without comparison against a later online request

Timestamp verification keeps its fixed GenerationTime: a newly produced nonce-bound response cannot establish historical status when it was generated after that instant

Archival and downloaded responses retain separate source accounting and do not increase DSS inventory or DSSOCSPValidatedCount

Low-level APIs and qualification

PLNativeBuildOCSPRequest retains its nonce-free contract; PLNativeBuildOCSPRequestEx accepts UseNonce and returns both request DER and the generated nonce, clearing nonce output on failure

PLNativeOCSPResponseNonce extracts a valid nonce and presence flag from a successful basic response without establishing signature or evidence trust; failure clears both outputs

The response reader bounds input to 16 MiB and response extensions to 1024; PLNativeVerifyCMSChainWithEvidenceAtTime accepts the nonce mode as its final optional integer parameter

Actual runtime qualification covers Linux x64 FPC 3.3.1 with OpenSSL 3.5.5; other providers and target hosts require qualification

Additional Freshest location profiles remain outside this route

See also

Native OCSP revocation, Native timestamp verification, TPDFlibSignatureVerifier