@@ -208,7 +208,7 @@ static int CryptoPemCallback(char *buf, int size, int rwflag, void *u) {
208
208
209
209
210
210
void ThrowCryptoError (Environment* env,
211
- unsigned long err,
211
+ unsigned long err, // NOLINT(runtime/int)
212
212
const char * default_message = nullptr ) {
213
213
HandleScope scope (env->isolate ());
214
214
if (err != 0 || default_message == nullptr ) {
@@ -467,7 +467,7 @@ void SecureContext::SetKey(const FunctionCallbackInfo<Value>& args) {
467
467
468
468
if (!key) {
469
469
BIO_free_all (bio);
470
- unsigned long err = ERR_get_error ();
470
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
471
471
if (!err) {
472
472
return env->ThrowError (" PEM_read_bio_PrivateKey" );
473
473
}
@@ -479,7 +479,7 @@ void SecureContext::SetKey(const FunctionCallbackInfo<Value>& args) {
479
479
BIO_free_all (bio);
480
480
481
481
if (!rv) {
482
- unsigned long err = ERR_get_error ();
482
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
483
483
if (!err)
484
484
return env->ThrowError (" SSL_CTX_use_PrivateKey" );
485
485
return ThrowCryptoError (env, err);
@@ -597,7 +597,7 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,
597
597
598
598
X509* extra = nullptr ;
599
599
int ret = 0 ;
600
- unsigned long err = 0 ;
600
+ unsigned long err = 0 ; // NOLINT(runtime/int)
601
601
602
602
// Read extra certs
603
603
STACK_OF (X509)* extra_certs = sk_X509_new_null ();
@@ -672,7 +672,7 @@ void SecureContext::SetCert(const FunctionCallbackInfo<Value>& args) {
672
672
BIO_free_all (bio);
673
673
674
674
if (!rv) {
675
- unsigned long err = ERR_get_error ();
675
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
676
676
if (!err) {
677
677
return env->ThrowError (" SSL_CTX_use_certificate_chain" );
678
678
}
@@ -866,7 +866,9 @@ void SecureContext::SetOptions(const FunctionCallbackInfo<Value>& args) {
866
866
return sc->env ()->ThrowTypeError (" Bad parameter" );
867
867
}
868
868
869
- SSL_CTX_set_options (sc->ctx_ , static_cast <long >(args[0 ]->IntegerValue ()));
869
+ SSL_CTX_set_options (
870
+ sc->ctx_ ,
871
+ static_cast <long >(args[0 ]->IntegerValue ())); // NOLINT(runtime/int)
870
872
}
871
873
872
874
@@ -1001,7 +1003,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo<Value>& args) {
1001
1003
delete[] pass;
1002
1004
1003
1005
if (!ret) {
1004
- unsigned long err = ERR_get_error ();
1006
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
1005
1007
const char * str = ERR_reason_error_string (err);
1006
1008
return env->ThrowError (str);
1007
1009
}
@@ -1427,7 +1429,7 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) {
1427
1429
String::kNormalString , mem->length ));
1428
1430
(void ) BIO_reset (bio);
1429
1431
1430
- unsigned long exponent_word = BN_get_word (rsa->e );
1432
+ BN_ULONG exponent_word = BN_get_word (rsa->e );
1431
1433
BIO_printf (bio, " 0x%lx" , exponent_word);
1432
1434
1433
1435
BIO_get_mem_ptr (bio, &mem);
@@ -1834,7 +1836,8 @@ void SSLWrap<Base>::VerifyError(const FunctionCallbackInfo<Value>& args) {
1834
1836
// XXX(bnoordhuis) The UNABLE_TO_GET_ISSUER_CERT error when there is no
1835
1837
// peer certificate is questionable but it's compatible with what was
1836
1838
// here before.
1837
- long x509_verify_error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT;
1839
+ long x509_verify_error = // NOLINT(runtime/int)
1840
+ X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT;
1838
1841
if (X509* peer_cert = SSL_get_peer_certificate (w->ssl_ )) {
1839
1842
X509_free (peer_cert);
1840
1843
x509_verify_error = SSL_get_verify_result (w->ssl_ );
@@ -2171,7 +2174,7 @@ void SSLWrap<Base>::CertCbDone(const FunctionCallbackInfo<Value>& args) {
2171
2174
if (rv)
2172
2175
rv = w->SetCACerts (sc);
2173
2176
if (!rv) {
2174
- unsigned long err = ERR_get_error ();
2177
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
2175
2178
if (!err)
2176
2179
return env->ThrowError (" CertCbDone" );
2177
2180
return ThrowCryptoError (env, err);
@@ -2605,7 +2608,7 @@ void Connection::New(const FunctionCallbackInfo<Value>& args) {
2605
2608
SSL_set_bio (conn->ssl_ , conn->bio_read_ , conn->bio_write_ );
2606
2609
2607
2610
#ifdef SSL_MODE_RELEASE_BUFFERS
2608
- long mode = SSL_get_mode (conn->ssl_ );
2611
+ long mode = SSL_get_mode (conn->ssl_ ); // NOLINT(runtime/int)
2609
2612
SSL_set_mode (conn->ssl_ , mode | SSL_MODE_RELEASE_BUFFERS);
2610
2613
#endif
2611
2614
@@ -3551,7 +3554,7 @@ void SignBase::CheckThrow(SignBase::Error error) {
3551
3554
case kSignPrivateKey :
3552
3555
case kSignPublicKey :
3553
3556
{
3554
- unsigned long err = ERR_get_error ();
3557
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
3555
3558
if (err)
3556
3559
return ThrowCryptoError (env (), err);
3557
3560
switch (error) {
@@ -5049,11 +5052,11 @@ class RandomBytesRequest : public AsyncWrap {
5049
5052
size_ = 0 ;
5050
5053
}
5051
5054
5052
- inline unsigned long error () const {
5055
+ inline unsigned long error () const { // NOLINT(runtime/int)
5053
5056
return error_;
5054
5057
}
5055
5058
5056
- inline void set_error (unsigned long err) {
5059
+ inline void set_error (unsigned long err) { // NOLINT(runtime/int)
5057
5060
error_ = err;
5058
5061
}
5059
5062
@@ -5062,7 +5065,7 @@ class RandomBytesRequest : public AsyncWrap {
5062
5065
uv_work_t work_req_;
5063
5066
5064
5067
private:
5065
- unsigned long error_;
5068
+ unsigned long error_; // NOLINT(runtime/int)
5066
5069
size_t size_;
5067
5070
char * data_;
5068
5071
};
@@ -5080,9 +5083,9 @@ void RandomBytesWork(uv_work_t* work_req) {
5080
5083
5081
5084
// RAND_bytes() returns 0 on error.
5082
5085
if (r == 0 ) {
5083
- req->set_error (ERR_get_error ());
5086
+ req->set_error (ERR_get_error ()); // NOLINT(runtime/int)
5084
5087
} else if (r == -1 ) {
5085
- req->set_error (static_cast <unsigned long >(-1 ));
5088
+ req->set_error (static_cast <unsigned long >(-1 )); // NOLINT(runtime/int)
5086
5089
}
5087
5090
}
5088
5091
@@ -5092,7 +5095,7 @@ void RandomBytesCheck(RandomBytesRequest* req, Local<Value> argv[2]) {
5092
5095
if (req->error ()) {
5093
5096
char errmsg[256 ] = " Operation not supported" ;
5094
5097
5095
- if (req->error () != static_cast <unsigned long >(-1 ))
5098
+ if (req->error () != static_cast <unsigned long >(-1 )) // NOLINT(runtime/int)
5096
5099
ERR_error_string_n (req->error (), errmsg, sizeof errmsg);
5097
5100
5098
5101
argv[0 ] = Exception::Error (OneByteString (req->env ()->isolate (), errmsg));
0 commit comments