[OCSP-1] OCSP responder certificate expires after 1 year and is never renewed #64

Closed
opened 2026-11-15 20:19:03 +01:00 by amiryahaya · 0 comments
Owner

Finding

The delegated OCSP responder certificate is created once, at first boot, with a one-year validity (lib/mdid_ws/cert_management/issuer_manager.ex:206, set_validity_period(:now, {1, :year})). MdidWs.Application.ensure_issuers/0 only generates it when it is missing. Nothing checks its expiry and no code regenerates it. OcspResponder signs every answer with whatever responder certificate is stored.

Impact

About a year after the first boot, OCSP responses are signed by an expired responder certificate. Relying parties that validate the responder certificate reject the responses, or treat the certificate status as unknown. Revocation checking silently stops working for every certificate this service issued.

Fix

  • Regenerate the responder certificate when it is missing, expired, or near expiry (for example within 30 days), signed by the online Sub CA, on boot and on a timer (the CrlRepublisher pattern fits)
  • Add a test with a responder certificate close to expiry
  • Check the Sub CA and Root CA lifetimes against the longest leaf certificate they can issue (not verified yet; a Sub CA that expires before its leaves causes the same failure)

Notes

Found during review of the architecture docs (docs/architecture-current.md, section 5.5). Independent of the emCA work: the local CA and OCSP stay as they are.

## Finding The delegated OCSP responder certificate is created once, at first boot, with a one-year validity (`lib/mdid_ws/cert_management/issuer_manager.ex:206`, `set_validity_period(:now, {1, :year})`). `MdidWs.Application.ensure_issuers/0` only generates it when it is missing. Nothing checks its expiry and no code regenerates it. `OcspResponder` signs every answer with whatever responder certificate is stored. ## Impact About a year after the first boot, OCSP responses are signed by an expired responder certificate. Relying parties that validate the responder certificate reject the responses, or treat the certificate status as unknown. Revocation checking silently stops working for every certificate this service issued. ## Fix - [ ] Regenerate the responder certificate when it is missing, expired, or near expiry (for example within 30 days), signed by the online Sub CA, on boot and on a timer (the CrlRepublisher pattern fits) - [ ] Add a test with a responder certificate close to expiry - [ ] Check the Sub CA and Root CA lifetimes against the longest leaf certificate they can issue (not verified yet; a Sub CA that expires before its leaves causes the same failure) ## Notes Found during review of the architecture docs (docs/architecture-current.md, section 5.5). Independent of the emCA work: the local CA and OCSP stay as they are.
Sign in to join this conversation.
No description provided.