From e4812d62ebc7830d20872da44cfa4539d7ff0125 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Wed, 20 Nov 2019 14:26:38 -0500 Subject: [PATCH] src: fix -Wsign-compare warnings 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: https://github.com/nodejs/node/pull/30565 Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen Reviewed-By: Yongsheng Zhang Reviewed-By: David Carlier --- src/node_crypto.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index fa85f7855371b5..c4fa6e90200f5b 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -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(BN_bn2binpad(r, data, n))); + CHECK_EQ(n, static_cast(BN_bn2binpad(s, data + n, n))); ECDSA_SIG_free(asn1_sig);