From 63978610069f119d09591c8343bc8b37e2095aa3 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 7 Aug 2024 06:59:26 -0700 Subject: [PATCH] src: fixup includes after x509 changes --- deps/ncrypto/engine.cc | 2 +- deps/ncrypto/ncrypto.cc | 15 +++++++-------- deps/ncrypto/ncrypto.h | 3 +-- src/crypto/crypto_x509.cc | 3 --- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/deps/ncrypto/engine.cc b/deps/ncrypto/engine.cc index de708d1c13cf3e..6bb827dcab0dc1 100644 --- a/deps/ncrypto/engine.cc +++ b/deps/ncrypto/engine.cc @@ -58,7 +58,7 @@ EnginePointer EnginePointer::getEngineByName(const std::string_view name, } } } - return std::move(engine); + return engine; } bool EnginePointer::setAsDefault(uint32_t flags, CryptoErrorList* errors) { diff --git a/deps/ncrypto/ncrypto.cc b/deps/ncrypto/ncrypto.cc index c0c0a2b5260cfe..3f9a96e0833bcc 100644 --- a/deps/ncrypto/ncrypto.cc +++ b/deps/ncrypto/ncrypto.cc @@ -1,13 +1,12 @@ #include "ncrypto.h" #include #include -#include "openssl/bn.h" -#include "openssl/evp.h" -#include "openssl/pkcs12.h" -#include "openssl/types.h" -#include "openssl/x509v3.h" +#include +#include +#include +#include #if OPENSSL_VERSION_MAJOR >= 3 -#include "openssl/provider.h" +#include #endif namespace ncrypto { @@ -737,7 +736,7 @@ BIOPointer X509View::toPEM() const { if (cert_ == nullptr) return {}; BIOPointer bio(BIO_new(BIO_s_mem())); if (!bio) return {}; - if (PEM_write_bio_X509(bio.get(), cert_) <= 0) return {}; + if (PEM_write_bio_X509(bio.get(), const_cast(cert_)) <= 0) return {}; return bio; } @@ -746,7 +745,7 @@ BIOPointer X509View::toDER() const { if (cert_ == nullptr) return {}; BIOPointer bio(BIO_new(BIO_s_mem())); if (!bio) return {}; - if (i2d_X509_bio(bio.get(), cert_) <= 0) return {}; + if (i2d_X509_bio(bio.get(), const_cast(cert_)) <= 0) return {}; return bio; } diff --git a/deps/ncrypto/ncrypto.h b/deps/ncrypto/ncrypto.h index 7adc7682514590..b646d2e90b734d 100644 --- a/deps/ncrypto/ncrypto.h +++ b/deps/ncrypto/ncrypto.h @@ -6,8 +6,7 @@ #include #include #include -#include "openssl/bn.h" -#include "openssl/types.h" +#include #include #include #include diff --git a/src/crypto/crypto_x509.cc b/src/crypto/crypto_x509.cc index 30c9cb0089487b..4dbd5e59174864 100644 --- a/src/crypto/crypto_x509.cc +++ b/src/crypto/crypto_x509.cc @@ -9,9 +9,6 @@ #include "ncrypto.h" #include "node_errors.h" #include "util-inl.h" -#include "v8-function-callback.h" -#include "v8-function.h" -#include "v8-primitive.h" #include "v8.h" #include