Skip to content

Commit

Permalink
src: fix -Wsign-compare warnings
Browse files Browse the repository at this point in the history
This commit addresses the following compilation warnings:

../src/node_crypto.cc:5053:3: warning: comparison of integers
of different signs: 'unsigned int' and 'int' [-Wsign-compare]
  CHECK_EQ(n, BN_bn2binpad(r, data, n));

../src/node_crypto.cc:5054:3: warning: comparison of integers
of different signs: 'unsigned int' and 'int' [-Wsign-compare]
  CHECK_EQ(n, BN_bn2binpad(s, data + n, n));

PR-URL: #30565
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: David Carlier <[email protected]>
  • Loading branch information
cjihrig authored and addaleax committed Nov 30, 2019
1 parent 8256d38 commit 44f28ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5050,8 +5050,8 @@ static AllocatedBuffer ConvertSignatureToP1363(Environment* env,

const BIGNUM* r = ECDSA_SIG_get0_r(asn1_sig);
const BIGNUM* s = ECDSA_SIG_get0_s(asn1_sig);
CHECK_EQ(n, BN_bn2binpad(r, data, n));
CHECK_EQ(n, BN_bn2binpad(s, data + n, n));
CHECK_EQ(n, static_cast<unsigned int>(BN_bn2binpad(r, data, n)));
CHECK_EQ(n, static_cast<unsigned int>(BN_bn2binpad(s, data + n, n)));

ECDSA_SIG_free(asn1_sig);

Expand Down

0 comments on commit 44f28ea

Please sign in to comment.