Skip to content

Harden PKCS7 and OCSP error handling#3237

Merged
prasden merged 3 commits into
aws:mainfrom
prasden:penpal-hardening-fixes
May 11, 2026
Merged

Harden PKCS7 and OCSP error handling#3237
prasden merged 3 commits into
aws:mainfrom
prasden:penpal-hardening-fixes

Conversation

@prasden
Copy link
Copy Markdown
Contributor

@prasden prasden commented May 8, 2026

Issues:

Addresses P409219367

Description of changes:

This PR adds hardening fixes for PKCS7 and OCSP brought up by Penpal testing:

  • PKCS7_dataInit did not check the return value of ASN1_OCTET_STRING_new() in pkcs7.c. We now check for NULL.
  • pkcs7_signature_verify used OPENSSL_memcmp for digest comparison in pkcs7.c. We now use CRYPTO_memcmp for constant-time comparison.
  • OCSP_parse_url did not initialize *pssl alongside other output parameters in ocsp_lib.c. We now initialize before any return paths.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@prasden prasden requested a review from a team as a code owner May 8, 2026 22:33
@prasden prasden temporarily deployed to auto-approve May 8, 2026 22:34 — with GitHub Actions Inactive
@prasden prasden temporarily deployed to auto-approve May 8, 2026 22:34 — with GitHub Actions Inactive
@prasden prasden temporarily deployed to auto-approve May 8, 2026 22:34 — with GitHub Actions Inactive
@prasden prasden temporarily deployed to auto-approve May 8, 2026 22:34 — with GitHub Actions Inactive
@prasden prasden temporarily deployed to auto-approve May 8, 2026 22:34 — with GitHub Actions Inactive
@prasden prasden temporarily deployed to auto-approve May 8, 2026 22:34 — with GitHub Actions Inactive
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.13%. Comparing base (9651480) to head (390a727).

Files with missing lines Patch % Lines
crypto/pkcs7/pkcs7.c 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3237   +/-   ##
=======================================
  Coverage   78.12%   78.13%           
=======================================
  Files         689      689           
  Lines      123214   123218    +4     
  Branches    17137    17137           
=======================================
+ Hits        96257    96271   +14     
+ Misses      26047    26036   -11     
- Partials      910      911    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread crypto/ocsp/ocsp_lib.c
Comment thread crypto/ocsp/ocsp_lib.c
@prasden prasden enabled auto-merge (squash) May 11, 2026 20:12
@prasden prasden merged commit 25a859c into aws:main May 11, 2026
487 checks passed
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.

4 participants