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 <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
  • Loading branch information
cjihrig authored and targos committed Nov 22, 2019
1 parent 0d28527 commit e4812d6
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 e4812d6

Please sign in to comment.