Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSSL Compat Layer: OCSP response improvments #8408

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

rizlik
Copy link
Contributor

@rizlik rizlik commented Feb 1, 2025

Improves of OCSP response handling.

Aligns wolfSSL_OCSP_basic_verify and wolfSSL_d2i_OCSP_RESPONSE to OpenSSL behavior.

Replaces #8036

@rizlik rizlik requested a review from julek-wolfssl February 1, 2025 00:15
@rizlik rizlik self-assigned this Feb 1, 2025
@rizlik rizlik force-pushed the ocsp-resp-refactor branch 3 times, most recently from 3b89ce4 to f96acbb Compare February 1, 2025 02:34
@rizlik rizlik closed this Feb 1, 2025
@rizlik rizlik reopened this Feb 1, 2025
@rizlik rizlik force-pushed the ocsp-resp-refactor branch 3 times, most recently from 43964c1 to 2816d92 Compare February 3, 2025 11:06
@rizlik rizlik assigned julek-wolfssl and unassigned rizlik Feb 3, 2025
@rizlik rizlik force-pushed the ocsp-resp-refactor branch from 2816d92 to a635189 Compare February 3, 2025 11:57
@rizlik
Copy link
Contributor Author

rizlik commented Feb 3, 2025

retest this please

Copy link
Member

@julek-wolfssl julek-wolfssl left a comment

Choose a reason for hiding this comment

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

Still need to review tests/.

wolfssl/wolfcrypt/asn.h Outdated Show resolved Hide resolved
wolfcrypt/src/asn.c Show resolved Hide resolved
src/ocsp.c Outdated Show resolved Hide resolved
src/ocsp.c Outdated Show resolved Hide resolved
wolfcrypt/src/asn.c Show resolved Hide resolved
wolfcrypt/src/asn.c Outdated Show resolved Hide resolved
src/internal.c Outdated Show resolved Hide resolved
src/ssl.c Outdated Show resolved Hide resolved
wolfssl/wolfcrypt/asn.h Show resolved Hide resolved
src/ocsp.c Outdated Show resolved Hide resolved
tests/api/ocsp.c Outdated Show resolved Hide resolved
tests/api/ocsp.c Outdated Show resolved Hide resolved
tests/api/ocsp.c Outdated Show resolved Hide resolved
tests/api/ocsp.c Outdated Show resolved Hide resolved
tests/api/ocsp.c Outdated Show resolved Hide resolved
tests/api/ocsp.c Outdated Show resolved Hide resolved
tests/api/ocsp.c Outdated Show resolved Hide resolved
tests/api/ocsp.c Outdated Show resolved Hide resolved
wolfcrypt/src/asn.c Outdated Show resolved Hide resolved
wolfcrypt/src/asn.c Show resolved Hide resolved
wolfcrypt/src/asn.c Show resolved Hide resolved
@julek-wolfssl julek-wolfssl removed their assignment Feb 4, 2025
@rizlik
Copy link
Contributor Author

rizlik commented Feb 5, 2025

retest this please

- Search certificate based on responderId
- Verify response signer is authorized for all single responses
- Align with OpenSSL behavior
- Separate wolfSSL_OCSP_basic_verify from verification done during
  decoding
The internal fields of OcspResponse refer to the resp->source buffer.
Copying these fields is complex, so it's better to decode the response again.
@rizlik rizlik force-pushed the ocsp-resp-refactor branch from a92d921 to b02a263 Compare February 5, 2025 07:20
@rizlik
Copy link
Contributor Author

rizlik commented Feb 5, 2025

retest this please

@rizlik rizlik assigned julek-wolfssl and unassigned rizlik Feb 5, 2025
wolfcrypt/src/asn.c Show resolved Hide resolved
wolfcrypt/src/asn.c Outdated Show resolved Hide resolved
wolfcrypt/src/asn.c Outdated Show resolved Hide resolved
src/internal.c Outdated Show resolved Hide resolved
src/internal.c Outdated Show resolved Hide resolved
tests/api/ocsp.c Show resolved Hide resolved
tests/api/ocsp.c Outdated Show resolved Hide resolved
tests/api/ocsp.c Outdated Show resolved Hide resolved
tests/api/ocsp.c Outdated Show resolved Hide resolved
tests/api/ocsp.c Outdated Show resolved Hide resolved
@julek-wolfssl julek-wolfssl assigned rizlik and unassigned julek-wolfssl Feb 5, 2025
- search for the signer in the CertificateManager if the embedded cert
  verification fails in original asn template.
- Added a new test case `resp_bad_embedded_cert` in
  `create_ocsp_test_blobs.py` to test OCSP response with an unusable
  internal cert that can be verified in Cert Manager.
- Updated `test_ocsp_response_parsing` in `ocsp.c` to include the new
  test case.
- Ensured the new test case checks for proper handling of OCSP responses
  with incorrect internal certificates.
@rizlik
Copy link
Contributor Author

rizlik commented Feb 6, 2025

retest this please.

@rizlik rizlik closed this Feb 6, 2025
@rizlik rizlik reopened this Feb 6, 2025
@julek-wolfssl julek-wolfssl removed their assignment Feb 6, 2025
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.

3 participants