Skip to content

Commit

Permalink
src: fixup includes after x509 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Aug 7, 2024
1 parent 907c7a8 commit 6397861
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion deps/ncrypto/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
15 changes: 7 additions & 8 deletions deps/ncrypto/ncrypto.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#include "ncrypto.h"
#include <algorithm>
#include <cstring>
#include "openssl/bn.h"
#include "openssl/evp.h"
#include "openssl/pkcs12.h"
#include "openssl/types.h"
#include "openssl/x509v3.h"
#include <openssl/bn.h>
#include <openssl/evp.h>
#include <openssl/pkcs12.h>
#include <openssl/x509v3.h>
#if OPENSSL_VERSION_MAJOR >= 3
#include "openssl/provider.h"
#include <openssl/provider.h>
#endif

namespace ncrypto {
Expand Down Expand Up @@ -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<X509*>(cert_)) <= 0) return {};
return bio;
}

Expand All @@ -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<X509*>(cert_)) <= 0) return {};
return bio;
}

Expand Down
3 changes: 1 addition & 2 deletions deps/ncrypto/ncrypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#include <optional>
#include <string>
#include <string_view>
#include "openssl/bn.h"
#include "openssl/types.h"
#include <openssl/bn.h>
#include <openssl/x509.h>
#include <openssl/dh.h>
#include <openssl/dsa.h>
Expand Down
3 changes: 0 additions & 3 deletions src/crypto/crypto_x509.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string>
Expand Down

0 comments on commit 6397861

Please sign in to comment.