Skip to content

ocsp: match openssl ocsp client output and exit status - #302

Open
julek-wolfssl wants to merge 2 commits into
wolfSSL:mainfrom
julek-wolfssl:ocsp-client-openssl-compat
Open

julek-wolfssl wants to merge 2 commits into
wolfSSL:mainfrom
julek-wolfssl:ocsp-client-openssl-compat

Conversation

@julek-wolfssl

Copy link
Copy Markdown
Member

The OCSP client now prints the certificate status and exits the way openssl ocsp does.

  • Print <cert>: good|revoked|unknown on stdout, followed by This Update, Next Update and, for revoked certificates, Reason and Revocation Time. Previously the status line went to stderr.
  • Exit 0 for any verified status, including revoked and unknown. Previously an unknown status was reported as an error.
  • Print openssl's "Responder Error" line when the responder returns an error status.

The client uses the native API for the exchange: wc_InitOcspRequest and wc_EncodeOcspRequest build the request, EmbedOcspLookup sends it, and wolfSSL_CertManagerCheckOCSPResponse verifies the response and returns the matched CertStatus, which supplies the status details. Dates are formatted from wc_GetDateAsCalendarTime.

Ref: F-12945

Print the certificate status on stdout the way openssl ocsp does:
"<cert>: good|revoked|unknown" followed by This Update, Next Update and,
for revoked certificates, Reason and Revocation Time. Exit 0 for any
verified status, including revoked and unknown, and print openssl's
"Responder Error" line when the responder returns an error status.
Previously the status line went to stderr and an unknown status was
reported as an error.

The client drives the exchange with the native API: wc_InitOcspRequest
and wc_EncodeOcspRequest build the request, EmbedOcspLookup sends it and
wolfSSL_CertManagerCheckOCSPResponse verifies the response and returns
the matched CertStatus, which supplies the status details. Dates are
formatted from wc_GetDateAsCalendarTime.

F-12945
Copilot AI balanced review requested due to automatic review settings October 14, 2026 13:13
@julek-wolfssl julek-wolfssl self-assigned this Oct 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The implementation omits valid revocation reasons and introduces dependencies on APIs unavailable without OPENSSL_EXTRA.

2 open findings
What changed in this PR

Aligns the wolfCLU OCSP client’s output and exit behavior with OpenSSL.

Changes:

  • Uses native OCSP request, transport, and verification APIs.
  • Prints verified certificate details to stdout.
  • Adds coverage and documentation for good, revoked, unknown, and responder-error results.
File Description
src/​ocsp/​clu_ocsp.c Implements request exchange and compatible status output.
tests/​ocsp/​ocsp-test.py Tests statuses, output streams, and responder errors.
manpages/​wolfssl-ocsp.1 Documents output and exit behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/ocsp/clu_ocsp.c Outdated
Comment on lines +357 to +358
wolfSSL_BIO_printf(bio, "%s: %s\n", name,
wolfSSL_OCSP_cert_status_str(cs->status));
Comment thread src/ocsp/clu_ocsp.c
Comment on lines +312 to +315
case WC_CRL_REASON_REMOVE_FROM_CRL:
return "removeFromCRL";
default:
return "(UNKNOWN)";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants