Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

14
deps/ncrypto/BUILD.gn vendored Normal file
View File

@ -0,0 +1,14 @@
##############################################################################
# #
# DO NOT EDIT THIS FILE! #
# #
##############################################################################
# This file is used by GN for building, which is NOT the build system used for
# building official binaries.
# Please modify the gyp files if you are making changes to build system.
import("unofficial.gni")
ncrypto_gn_build("ncrypto") {
}

5
deps/ncrypto/README.md vendored Normal file
View File

@ -0,0 +1,5 @@
# Node.js crypto (ncrypto) library
The `ncrypto` library extracts the base internal implementation of Node.js crypto operations
that support both `node:crypto` and Web Crypto implementations and makes them available for
use in other projects that need to emulate Node.js' behavior.

93
deps/ncrypto/engine.cc vendored Normal file
View File

@ -0,0 +1,93 @@
#include "ncrypto.h"
namespace ncrypto {
// ============================================================================
// Engine
#ifndef OPENSSL_NO_ENGINE
EnginePointer::EnginePointer(ENGINE* engine_, bool finish_on_exit_)
: engine(engine_), finish_on_exit(finish_on_exit_) {}
EnginePointer::EnginePointer(EnginePointer&& other) noexcept
: engine(other.engine), finish_on_exit(other.finish_on_exit) {
other.release();
}
EnginePointer::~EnginePointer() {
reset();
}
EnginePointer& EnginePointer::operator=(EnginePointer&& other) noexcept {
if (this == &other) return *this;
this->~EnginePointer();
return *new (this) EnginePointer(std::move(other));
}
void EnginePointer::reset(ENGINE* engine_, bool finish_on_exit_) {
if (engine != nullptr) {
if (finish_on_exit) {
// This also does the equivalent of ENGINE_free.
ENGINE_finish(engine);
} else {
ENGINE_free(engine);
}
}
engine = engine_;
finish_on_exit = finish_on_exit_;
}
ENGINE* EnginePointer::release() {
ENGINE* ret = engine;
engine = nullptr;
finish_on_exit = false;
return ret;
}
EnginePointer EnginePointer::getEngineByName(const char* name,
CryptoErrorList* errors) {
MarkPopErrorOnReturn mark_pop_error_on_return(errors);
EnginePointer engine(ENGINE_by_id(name));
if (!engine) {
// Engine not found, try loading dynamically.
engine = EnginePointer(ENGINE_by_id("dynamic"));
if (engine) {
if (!ENGINE_ctrl_cmd_string(engine.get(), "SO_PATH", name, 0) ||
!ENGINE_ctrl_cmd_string(engine.get(), "LOAD", nullptr, 0)) {
engine.reset();
}
}
}
return engine;
}
bool EnginePointer::setAsDefault(uint32_t flags, CryptoErrorList* errors) {
if (engine == nullptr) return false;
ClearErrorOnReturn clear_error_on_return(errors);
return ENGINE_set_default(engine, flags) != 0;
}
bool EnginePointer::init(bool finish_on_exit) {
if (engine == nullptr) return false;
if (finish_on_exit) setFinishOnExit();
return ENGINE_init(engine) == 1;
}
EVPKeyPointer EnginePointer::loadPrivateKey(const char* key_name) {
if (engine == nullptr) return EVPKeyPointer();
return EVPKeyPointer(
ENGINE_load_private_key(engine, key_name, nullptr, nullptr));
}
void EnginePointer::initEnginesOnce() {
static bool initialized = false;
if (!initialized) {
ENGINE_load_builtin_engines();
ENGINE_register_all_complete();
initialized = true;
}
}
#endif // OPENSSL_NO_ENGINE
} // namespace ncrypto

4300
deps/ncrypto/ncrypto.cc vendored Normal file

File diff suppressed because it is too large Load Diff

27
deps/ncrypto/ncrypto.gyp vendored Normal file
View File

@ -0,0 +1,27 @@
{
'variables': {
'ncrypto_sources': [
'engine.cc',
'ncrypto.cc',
'ncrypto.h',
],
},
'targets': [
{
'target_name': 'ncrypto',
'type': 'static_library',
'include_dirs': ['.'],
'direct_dependent_settings': {
'include_dirs': ['.'],
},
'sources': [ '<@(ncrypto_sources)' ],
'conditions': [
['node_shared_openssl=="false"', {
'dependencies': [
'../openssl/openssl.gyp:openssl'
]
}],
]
},
]
}

1547
deps/ncrypto/ncrypto.h vendored Normal file

File diff suppressed because it is too large Load Diff

32
deps/ncrypto/unofficial.gni vendored Normal file
View File

@ -0,0 +1,32 @@
# This file is used by GN for building, which is NOT the build system used for
# building official binaries.
# Please edit the gyp files if you are making changes to build system.
import("../../node.gni")
import("$node_v8_path/gni/v8.gni")
# The actual configurations are put inside a template in unofficial.gni to
# prevent accidental edits from contributors.
template("ncrypto_gn_build") {
config("ncrypto_config") {
include_dirs = [ "." ]
cflags = [
"-Wno-deprecated-declarations",
"-Wno-pessimizing-move",
"-Wno-shadow",
"-Wno-unused-variable",
]
}
gypi_values = exec_script("../../tools/gypi_to_gn.py",
[ rebase_path("ncrypto.gyp") ],
"scope",
[ "ncrypto.gyp" ])
source_set(target_name) {
forward_variables_from(invoker, "*")
public_configs = [ ":ncrypto_config" ]
sources = gypi_values.ncrypto_sources
deps = [ "$node_openssl_path" ]
}
}