rfc-9654

Online Certificate Status Protocol (OCSP) Nonce Extension

H. Sharma (Editor)
date2024-08 streamIETF areasec wglamps statusPROPOSED STANDARD pages13 canonicalhttps://www.rfc-editor.org/rfc/rfc9654 doi10.17487/RFC9654
RFC 8954 imposed size constraints on the optional Nonce extension for the Online Certificate Status Protocol (OCSP). OCSP is used to check the status of a certificate, and the Nonce extension is used to cryptographically bind an OCSP response message to a particular OCSP request message. Some environments use cryptographic algorithms that generate a Nonce value that is longer than 32 octets. This document also modifies the "Nonce" section of RFC 6960 to clearly define and differentiate the encoding format and values for easier implementation and understanding. This document obsoletes RFC 8954, which includes updated ASN.1 modules for OCSP, and updates RFC 6960.

obsoletes

updates

Extracted elements (15)

design-rationale §A

The 1998 ASN.1 module (Appendix A.1) remains the normative module per the policy of the PKIX Working Group, even though a 2008 ASN.1 module is also provided (Appendix A.2).

pkix

design-rationale §1

The maximum Nonce length was extended from 32 octets (RFC 8954) to 128 octets to support cryptographic algorithms that generate nonces longer than 32 octets. The minimum of 1 octet is retained for backward compatibility with older OCSP requesters following RFC 6960.

pkix, crypto

interoperability-note §2.1

Implementations compliant with RFC 8954 will not be able to process nonces generated per the new specification with sizes in excess of the 32-octet limit specified in RFC 8954. Deployers must account for this backward-compatibility constraint.

pkix, crypto

normative-requirement §2.1 MUST

An OCSP requester that implements the extension in this document MUST use a minimum length of 32 octets for Nonce in the Nonce extension.

pkix, crypto, security

normative-requirement §2.1 MUST

An OCSP responder that supports the Nonce extension MUST accept Nonce lengths of at least 16 octets and up to and including 32 octets. A responder MAY choose to respond without the Nonce extension for requests where the Nonce length is between 1–15 octets or 33–128 octets.

pkix, crypto, security

normative-requirement §2.1 MUST

If the Nonce extension is present, the length of the Nonce MUST be at least 1 octet and can be up to 128 octets.

pkix, crypto, security

normative-requirement §2.1 MUST

Responders that implement this extension MUST reject any OCSP request that has a Nonce with a length of either 0 octets or greater than 128 octets, with the malformedRequest OCSPResponseStatus as described in Section 4.2.1 of RFC 6960.

pkix, security

normative-requirement §2.1 MUST

The value of the Nonce MUST be generated using a cryptographically strong pseudorandom number generator (see RFC 4086).

pkix, crypto, security

protocol-element §2.1

The Nonce cryptographically binds an OCSP request and response to prevent replay attacks. It is included as a requestExtension in requests and as a responseExtension in responses, identified by the OID id-pkix-ocsp-nonce (1.3.6.1.5.5.7.48.1.2).

pkix, crypto, security

protocol-element §A.1

The OCSPResponseStatus enumeration defines six values: successful (0), malformedRequest (1), internalError (2), tryLater (3), sigRequired (5), and unauthorized (6); value 4 is not used. A malformedRequest status MUST be returned when the Nonce length is 0 or greater than 128 octets.

pkix

registry §4

IANA assigned two OIDs in the 'SMI Security for PKIX Module Identifier' registry (1.3.6.1.5.5.7.0): value 111 for id-mod-ocsp-2024-88 (1998 ASN.1 module) and value 112 for id-mod-ocsp-2024-08 (2008 ASN.1 module).

pkix, registry

security-consideration §3

During the interval in which a previous OCSP response for a certificate is not yet expired but the responder has a changed status for that certificate, a copy of the old response can be replayed to indicate the certificate is still valid. Including a requester's nonce value in the OCSP response ensures the response is the most recent one from the server.

pkix, security

security-consideration §3.1

Since the OCSP responder may choose not to send the Nonce extension in the response even if the requester sent it (per RFC 5019), an on-path attacker can intercept the request and respond with an earlier response without the Nonce. This can be mitigated by configuring a short interval between thisUpdate and nextUpdate in the OCSP response.

pkix, security

wire-format §2.1

An example encoded OCSP Nonce extension with a 32-octet Nonce is provided: a SEQUENCE containing the OID id-pkix-ocsp-nonce (9 bytes) and an OCTET STRING encapsulating a 32-byte OCTET STRING value, totaling 47 bytes.

pkix, crypto

wire-format §2.1

The Nonce field is encoded as an OCTET STRING with a size constraint of 1 to 128 octets: `Nonce ::= OCTET STRING(SIZE(1..128))`. The extnValue of the Nonce extension contains the DER-encoded Nonce value encapsulated in an OCTET STRING wrapper.

pkix, crypto