0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

src: remove unneeded variables in node_crypto.cc

PR-URL: https://github.com/nodejs/node/pull/23297
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
cjihrig 2018-10-06 16:12:13 -04:00
parent 2c5195a81c
commit 78b4369f09
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -573,17 +573,13 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,
if (ret) {
// If we could set up our certificate, now proceed to
// the CA certificates.
int r;
SSL_CTX_clear_extra_chain_certs(ctx);
for (int i = 0; i < sk_X509_num(extra_certs); i++) {
X509* ca = sk_X509_value(extra_certs, i);
// NOTE: Increments reference count on `ca`
r = SSL_CTX_add1_chain_cert(ctx, ca);
if (!r) {
if (!SSL_CTX_add1_chain_cert(ctx, ca)) {
ret = 0;
issuer = nullptr;
break;
@ -1580,15 +1576,11 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) {
if (index < 0)
continue;
X509_EXTENSION* ext;
int rv;
ext = X509_get_ext(cert, index);
X509_EXTENSION* ext = X509_get_ext(cert, index);
CHECK_NOT_NULL(ext);
if (!SafeX509ExtPrint(bio.get(), ext)) {
rv = X509V3_EXT_print(bio.get(), ext, 0, 0);
CHECK_EQ(rv, 1);
CHECK_EQ(1, X509V3_EXT_print(bio.get(), ext, 0, 0));
}
BIO_get_mem_ptr(bio.get(), &mem);
@ -3746,7 +3738,6 @@ SignBase::Error Verify::VerifyFinal(const char* key_pem,
EVPKeyPointer pkey;
unsigned char m[EVP_MAX_MD_SIZE];
unsigned int m_len;
int r = 0;
*verify_result = false;
EVPMDPointer mdctx = std::move(mdctx_);
@ -3762,11 +3753,11 @@ SignBase::Error Verify::VerifyFinal(const char* key_pem,
ApplyRSAOptions(pkey, pkctx.get(), padding, saltlen) &&
EVP_PKEY_CTX_set_signature_md(pkctx.get(),
EVP_MD_CTX_md(mdctx.get())) > 0) {
r = EVP_PKEY_verify(pkctx.get(),
reinterpret_cast<const unsigned char*>(sig),
siglen,
m,
m_len);
const int r = EVP_PKEY_verify(pkctx.get(),
reinterpret_cast<const unsigned char*>(sig),
siglen,
m,
m_len);
*verify_result = r == 1;
}