Skip to content

crypto: use OPENSSL_SIZE_T instead of hard coding int - #66752

Open
aduh95 wants to merge 1 commit into
nodejs:mainfrom
aduh95:OPENSSL_SIZE_T
Open

aduh95 wants to merge 1 commit into
nodejs:mainfrom
aduh95:OPENSSL_SIZE_T

Conversation

@aduh95

@aduh95 aduh95 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

This fixes the following warnings when building against boringssl:

[246](https://github.com/nodejs/node/actions/runs/38704739303/job/116321775602?pr=66751#step:8:1247) ../../src/crypto/crypto_common.cc: In function 'ncrypto::StackOfX509 node::crypto::{anonymous}::CloneSSLCerts(ncrypto::X509Pointer&&, const stack_st_X509*)':
../../src/crypto/crypto_common.cc:93:21: error: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]
93 | for (int i = 0; i < sk_X509_num(ssl_certs); i++) {
| ~~^~~~~~~~~~~~~~~~~~~~~~~~
../../src/crypto/crypto_common.cc: In function 'v8::MaybeLocal<v8::Object> node::crypto::{anonymous}::AddIssuerChainToObject(ncrypto::X509Pointer*, v8::Local<v8::Object>, ncrypto::StackOfX509&&, node::Environment*)':
../../src/crypto/crypto_common.cc:110:19: error: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]
110 | for (i = 0; i < sk_X509_num(peer_certs.get()); i++) {
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/crypto/crypto_common.cc:133:11: error: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Werror=sign-compare]
133 | if (i == sk_X509_num(peer_certs.get()))
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.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 Oct 15, 2026
@panva panva added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Oct 15, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 15, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.48%. Comparing base (49ad950) to head (e437aa9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66752      +/-   ##
==========================================
- Coverage   90.49%   90.48%   -0.01%     
==========================================
  Files         797      797              
  Lines      277494   277495       +1     
  Branches    53321    53331      +10     
==========================================
- Hits       251115   251097      -18     
+ Misses      16802    16797       -5     
- Partials     9577     9601      +24     
Files with missing lines Coverage Δ
src/crypto/crypto_common.cc 78.46% <100.00%> (ø)
src/crypto/crypto_context.cc 71.49% <100.00%> (ø)
src/crypto/crypto_hash.cc 69.01% <100.00%> (-0.39%) ⬇️
src/crypto/crypto_x509.cc 73.07% <100.00%> (+0.03%) ⬆️

... and 31 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.

@panva panva added the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue PRs queued for automated landing through the Commit Queue. 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.

4 participants