Skip to content

crypto: add missing return value check#56615

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mhdawson:fix-unused
Jan 17, 2025
Merged

crypto: add missing return value check#56615
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
mhdawson:fix-unused

Conversation

@mhdawson

Copy link
Copy Markdown
Member

Add return value check for call to SSL_CTX_add_client_CA to be consistent with other places it is called

Fixed unused warning in one of the static analysis tools we use at Red Hat even though it is not being reported by coverity in the configuration we run.

Add return value check for call to SSL_CTX_add_client_CA
to be consistent with other places it is called

Fixed unused warning in one of the static analysis tools we use
at Red Hat even though it is not being reported by coverity in
the configuration we run.

Signed-off-by: Michael Dawson <midawson@redhat.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels Jan 15, 2025
@mhdawson

Copy link
Copy Markdown
Member Author

@khardix can you pass this on and ask your new team members to validate this resolves the problem they are seeing?

@codecov

codecov Bot commented Jan 15, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.19%. Comparing base (1238f0a) to head (c77f543).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
src/crypto/crypto_context.cc 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56615      +/-   ##
==========================================
- Coverage   89.20%   89.19%   -0.01%     
==========================================
  Files         662      662              
  Lines      191819   191819              
  Branches    36927    36923       -4     
==========================================
- Hits       171110   171100      -10     
+ Misses      13565    13557       -8     
- Partials     7144     7162      +18     
Files with missing lines Coverage Δ
src/crypto/crypto_context.cc 69.22% <0.00%> (-0.12%) ⬇️

... and 40 files with indirect coverage changes

@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 16, 2025
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 16, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@khardix

khardix commented Jan 16, 2025

Copy link
Copy Markdown
Contributor

This was mostly discovered by @jackorp, so CC'ing him.

As for the fix, well, I do not think this addresses the main issue. Yes, our coverity run will now probably pass, but the -Werror=unused-result in node.gyp is still a ticking bomb.

The -Werror flag is generally only usable if one can guarantee that the software is always being built with exactly the same compiler. Different version of the compiler can produce different set of warnings, which will then cause the build to fail unexpectedly (as they are now errors). Add to this that the static analysis software we run apparently adds it's own set of flags and macro definitions, and the warnings-turned-to-errors can start to pile up rapidly.

So the actual "main fix" we would like to see is either to remove the -Werror flag, or to hide it behind a configuration option (IIRC there should be one already), so we can opt in and out depending on the environment that the build is currently running in.

@mhdawson

Copy link
Copy Markdown
Member Author

So the actual "main fix" we would like to see is either to remove the -Werror flag, or to hide it behind a configuration option (IIRC there should be one already), so we can opt in and out depending on the environment that the build is currently running in.

We can look into why that was added originally, but hopefully this PR will remove the immediate issue.

@mhdawson mhdawson added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 17, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 17, 2025
@nodejs-github-bot nodejs-github-bot merged commit 2e45656 into nodejs:main Jan 17, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 2e45656

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants