@@ -212,7 +212,7 @@ static int CryptoPemCallback(char *buf, int size, int rwflag, void *u) {
212
212
213
213
214
214
void ThrowCryptoError (Environment* env,
215
- unsigned long err,
215
+ unsigned long err, // NOLINT(runtime/int)
216
216
const char * default_message = nullptr ) {
217
217
HandleScope scope (env->isolate ());
218
218
if (err != 0 || default_message == nullptr ) {
@@ -458,7 +458,7 @@ void SecureContext::SetKey(const FunctionCallbackInfo<Value>& args) {
458
458
459
459
if (!key) {
460
460
BIO_free_all (bio);
461
- unsigned long err = ERR_get_error ();
461
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
462
462
if (!err) {
463
463
return env->ThrowError (" PEM_read_bio_PrivateKey" );
464
464
}
@@ -470,7 +470,7 @@ void SecureContext::SetKey(const FunctionCallbackInfo<Value>& args) {
470
470
BIO_free_all (bio);
471
471
472
472
if (!rv) {
473
- unsigned long err = ERR_get_error ();
473
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
474
474
if (!err)
475
475
return env->ThrowError (" SSL_CTX_use_PrivateKey" );
476
476
return ThrowCryptoError (env, err);
@@ -588,7 +588,7 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,
588
588
589
589
X509* extra = nullptr ;
590
590
int ret = 0 ;
591
- unsigned long err = 0 ;
591
+ unsigned long err = 0 ; // NOLINT(runtime/int)
592
592
593
593
// Read extra certs
594
594
STACK_OF (X509)* extra_certs = sk_X509_new_null ();
@@ -664,7 +664,7 @@ void SecureContext::SetCert(const FunctionCallbackInfo<Value>& args) {
664
664
BIO_free_all (bio);
665
665
666
666
if (!rv) {
667
- unsigned long err = ERR_get_error ();
667
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
668
668
if (!err) {
669
669
return env->ThrowError (" SSL_CTX_use_certificate_chain" );
670
670
}
@@ -873,7 +873,9 @@ void SecureContext::SetOptions(const FunctionCallbackInfo<Value>& args) {
873
873
return sc->env ()->ThrowTypeError (" Options must be an integer value" );
874
874
}
875
875
876
- SSL_CTX_set_options (sc->ctx_ , static_cast <long >(args[0 ]->IntegerValue ()));
876
+ SSL_CTX_set_options (
877
+ sc->ctx_ ,
878
+ static_cast <long >(args[0 ]->IntegerValue ())); // NOLINT(runtime/int)
877
879
}
878
880
879
881
@@ -1016,7 +1018,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo<Value>& args) {
1016
1018
delete[] pass;
1017
1019
1018
1020
if (!ret) {
1019
- unsigned long err = ERR_get_error ();
1021
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
1020
1022
const char * str = ERR_reason_error_string (err);
1021
1023
return env->ThrowError (str);
1022
1024
}
@@ -1458,7 +1460,7 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) {
1458
1460
String::kNormalString , mem->length ));
1459
1461
(void ) BIO_reset (bio);
1460
1462
1461
- unsigned long exponent_word = BN_get_word (rsa->e );
1463
+ BN_ULONG exponent_word = BN_get_word (rsa->e );
1462
1464
BIO_printf (bio, " 0x%lx" , exponent_word);
1463
1465
1464
1466
BIO_get_mem_ptr (bio, &mem);
@@ -1928,7 +1930,8 @@ void SSLWrap<Base>::VerifyError(const FunctionCallbackInfo<Value>& args) {
1928
1930
// XXX(bnoordhuis) The UNABLE_TO_GET_ISSUER_CERT error when there is no
1929
1931
// peer certificate is questionable but it's compatible with what was
1930
1932
// here before.
1931
- long x509_verify_error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT;
1933
+ long x509_verify_error = // NOLINT(runtime/int)
1934
+ X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT;
1932
1935
if (X509* peer_cert = SSL_get_peer_certificate (w->ssl_ )) {
1933
1936
X509_free (peer_cert);
1934
1937
x509_verify_error = SSL_get_verify_result (w->ssl_ );
@@ -2157,11 +2160,6 @@ void SSLWrap<Base>::SetNPNProtocols(const FunctionCallbackInfo<Value>& args) {
2157
2160
#endif // OPENSSL_NPN_NEGOTIATED
2158
2161
2159
2162
#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
2160
- typedef struct tlsextalpnctx_st {
2161
- unsigned char * data;
2162
- unsigned short len;
2163
- } tlsextalpnctx;
2164
-
2165
2163
template <class Base >
2166
2164
int SSLWrap<Base>::SelectALPNCallback(SSL* s,
2167
2165
const unsigned char ** out,
@@ -2401,7 +2399,7 @@ void SSLWrap<Base>::CertCbDone(const FunctionCallbackInfo<Value>& args) {
2401
2399
if (rv)
2402
2400
rv = w->SetCACerts (sc);
2403
2401
if (!rv) {
2404
- unsigned long err = ERR_get_error ();
2402
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
2405
2403
if (!err)
2406
2404
return env->ThrowError (" CertCbDone" );
2407
2405
return ThrowCryptoError (env, err);
@@ -2839,7 +2837,7 @@ void Connection::New(const FunctionCallbackInfo<Value>& args) {
2839
2837
SSL_set_bio (conn->ssl_ , conn->bio_read_ , conn->bio_write_ );
2840
2838
2841
2839
#ifdef SSL_MODE_RELEASE_BUFFERS
2842
- long mode = SSL_get_mode (conn->ssl_ );
2840
+ long mode = SSL_get_mode (conn->ssl_ ); // NOLINT(runtime/int)
2843
2841
SSL_set_mode (conn->ssl_ , mode | SSL_MODE_RELEASE_BUFFERS);
2844
2842
#endif
2845
2843
@@ -3838,7 +3836,7 @@ void SignBase::CheckThrow(SignBase::Error error) {
3838
3836
case kSignPrivateKey :
3839
3837
case kSignPublicKey :
3840
3838
{
3841
- unsigned long err = ERR_get_error ();
3839
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
3842
3840
if (err)
3843
3841
return ThrowCryptoError (env (), err);
3844
3842
switch (error) {
@@ -5415,11 +5413,11 @@ class RandomBytesRequest : public AsyncWrap {
5415
5413
size_ = 0 ;
5416
5414
}
5417
5415
5418
- inline unsigned long error () const {
5416
+ inline unsigned long error () const { // NOLINT(runtime/int)
5419
5417
return error_;
5420
5418
}
5421
5419
5422
- inline void set_error (unsigned long err) {
5420
+ inline void set_error (unsigned long err) { // NOLINT(runtime/int)
5423
5421
error_ = err;
5424
5422
}
5425
5423
@@ -5428,7 +5426,7 @@ class RandomBytesRequest : public AsyncWrap {
5428
5426
uv_work_t work_req_;
5429
5427
5430
5428
private:
5431
- unsigned long error_;
5429
+ unsigned long error_; // NOLINT(runtime/int)
5432
5430
size_t size_;
5433
5431
char * data_;
5434
5432
};
@@ -5446,9 +5444,9 @@ void RandomBytesWork(uv_work_t* work_req) {
5446
5444
5447
5445
// RAND_bytes() returns 0 on error.
5448
5446
if (r == 0 ) {
5449
- req->set_error (ERR_get_error ());
5447
+ req->set_error (ERR_get_error ()); // NOLINT(runtime/int)
5450
5448
} else if (r == -1 ) {
5451
- req->set_error (static_cast <unsigned long >(-1 ));
5449
+ req->set_error (static_cast <unsigned long >(-1 )); // NOLINT(runtime/int)
5452
5450
}
5453
5451
}
5454
5452
@@ -5458,7 +5456,7 @@ void RandomBytesCheck(RandomBytesRequest* req, Local<Value> argv[2]) {
5458
5456
if (req->error ()) {
5459
5457
char errmsg[256 ] = " Operation not supported" ;
5460
5458
5461
- if (req->error () != static_cast <unsigned long >(-1 ))
5459
+ if (req->error () != static_cast <unsigned long >(-1 )) // NOLINT(runtime/int)
5462
5460
ERR_error_string_n (req->error (), errmsg, sizeof errmsg);
5463
5461
5464
5462
argv[0 ] = Exception::Error (OneByteString (req->env ()->isolate (), errmsg));
@@ -5797,7 +5795,7 @@ void InitCryptoOnce() {
5797
5795
5798
5796
#ifdef NODE_FIPS_MODE
5799
5797
/* Override FIPS settings in cnf file, if needed. */
5800
- unsigned long err = 0 ;
5798
+ unsigned long err = 0 ; // NOLINT(runtime/int)
5801
5799
if (enable_fips_crypto || force_fips_crypto) {
5802
5800
if (0 == FIPS_mode () && !FIPS_mode_set (1 )) {
5803
5801
err = ERR_get_error ();
@@ -5879,7 +5877,7 @@ void SetFipsCrypto(const FunctionCallbackInfo<Value>& args) {
5879
5877
return env->ThrowError (
5880
5878
" Cannot set FIPS mode, it was forced with --force-fips at startup." );
5881
5879
} else if (!FIPS_mode_set (mode)) {
5882
- unsigned long err = ERR_get_error ();
5880
+ unsigned long err = ERR_get_error (); // NOLINT(runtime/int)
5883
5881
return ThrowCryptoError (env, err);
5884
5882
}
5885
5883
#else
0 commit comments