Skip to content

crypto: handle cipher context allocation failures - #63542

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
Herrtian:guard-openssl-alloc-failures
Jun 3, 2026
Merged

crypto: handle cipher context allocation failures#63542
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
Herrtian:guard-openssl-alloc-failures

Conversation

@Herrtian

Copy link
Copy Markdown
Contributor

Fixes: #62774

Handle failed cipher context allocation without hitting CHECK() in crypto/webcrypto paths. The WebCrypto helpers now return FAILED and CipherBase reports a crypto operation error.

No dedicated regression test because this requires forcing OpenSSL allocation failure.

Checks:

  • py -3 tools\cpplint.py --quiet src\crypto\crypto_aes.cc src\crypto\crypto_chacha20_poly1305.cc src\crypto\crypto_cipher.cc
  • git diff --check

Signed-off-by: Herrtian <70463940+Herrtian@users.noreply.github.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels May 24, 2026
@addaleaxaddaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels May 26, 2026
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 26, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecovBot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.30%. Comparing base (8c3e9bd) to head (6892f42).
⚠️ Report is 119 commits behind head on main.

Files with missing linesPatch %Lines
src/crypto/crypto_cipher.cc0.00%4 Missing and 2 partials ⚠️
src/crypto/crypto_aes.cc0.00%1 Missing and 1 partial ⚠️
src/crypto/crypto_chacha20_poly1305.cc0.00%1 Missing and 1 partial ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #63542 +/- ##
==========================================
- Coverage 90.31% 90.30% -0.02% 
==========================================
Files 730 730 Lines 234152 234159 +7 Branches 43913 43909 -4 ==========================================
- Hits 211482 211461 -21 - Misses 14381 14428 +47 + Partials 8289 8270 -19 
Files with missing linesCoverage Δ
src/crypto/crypto_aes.cc54.70% <0.00%> (-0.20%)⬇️
src/crypto/crypto_chacha20_poly1305.cc57.69% <0.00%> (-0.45%)⬇️
src/crypto/crypto_cipher.cc76.87% <0.00%> (-0.56%)⬇️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@addaleaxaddaleax added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 3, 2026
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 3, 2026
@nodejs-github-bot
nodejs-github-bot merged commit f47f941 into nodejs:mainJun 3, 2026
90 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in f47f941

aduh95 pushed a commit that referenced this pull request Jun 18, 2026
Signed-off-by: Herrtian <70463940+Herrtian@users.noreply.github.com>
PR-URL: #63542Fixes: #62774
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
aduh95 pushed a commit that referenced this pull request Jun 25, 2026
Signed-off-by: Herrtian <70463940+Herrtian@users.noreply.github.com>
PR-URL: #63542Fixes: #62774
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
aduh95 pushed a commit that referenced this pull request Jul 30, 2026
Signed-off-by: Herrtian <70463940+Herrtian@users.noreply.github.com>
PR-URL: #63542Fixes: #62774
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

crypto,quic: missing NULL checks for OpenSSL allocation functions

5 participants

@Herrtian@nodejs-github-bot@jasnell@addaleax@tniessen