Skip to content

gnutls_ocsp_resp_verify: Check key purpose if signer not on trust list

Airtower requested to merge airtower-luna/gnutls:fix-ocsp-signer-check into master

According to RFC 6960, section 4.2.2.2 the id-kp-OCSPSigning key purpose is only needed for delegated signers, not signers explicitly set as trusted. The previous code would reject a signature directly from a CA on the trust list (without delegation) because the CA certificate didn't contain the id-kp-OCSPSigning key purpose.

The included tests check:

  1. Is a signature directly from a CA on the trust list accepted?
  2. Is a signature from a delegated signer issued by a CA on the trust list accepted?
  3. Is a signature from a certificate without id-kp-OCSPSigning issued by a CA on the trust list rejected?

Note that the CA in these tests is also the one that issued the certificate the OCSP response is for, but the code (current and previous) doesn't enforce this.

Fixes #1254 (closed).

Checklist

  • Commits have Signed-off-by: with name/author being identical to the commit author
  • Code modified for feature
  • Test suite updated with functionality tests
  • Test suite updated with negative tests
  • Documentation updated / NEWS entry present (for non-trivial changes)
  • CI timeout is 2h or higher (see Settings/CICD/General pipelines/Timeout)

Reviewer's checklist:

  • Any issues marked for closing are addressed
  • There is a test suite reasonably covering new functionality or modifications
  • Function naming, parameters, return values, types, etc., are consistent and according to CONTRIBUTION.md
  • This feature/change has adequate documentation added
  • No obvious mistakes in the code
Edited by Daiki Ueno

Merge request reports