RFC 9654 says OCSP requesters MUST use a nonce of at least 32 octets, and responders MUST reject a nonce of 0 or more than 128 octets with malformedRequest.
OpenSSL defaults to 16 (OCSP_DEFAULT_NONCE_LENGTH), which openssl ocsp and OCSP_request_add1_nonce(req, NULL, 0) use. On the responder side, OCSP_copy_nonce() copies any length.
I'd propose raising the default to 32 and making the openssl ocsp responder reject 0 or >128 octet nonces. Should the length check go in the app only, or in OCSP_copy_nonce()? Happy to send a PR.
RFC 9654 says OCSP requesters MUST use a nonce of at least 32 octets, and responders MUST reject a nonce of 0 or more than 128 octets with malformedRequest.
OpenSSL defaults to 16 (
OCSP_DEFAULT_NONCE_LENGTH), whichopenssl ocspandOCSP_request_add1_nonce(req, NULL, 0)use. On the responder side,OCSP_copy_nonce()copies any length.I'd propose raising the default to 32 and making the
openssl ocspresponder reject 0 or >128 octet nonces. Should the length check go in the app only, or inOCSP_copy_nonce()? Happy to send a PR.