dsh-remote 0.8.46 → 0.8.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.en.md +361 -361
- package/README.md +368 -368
- package/cordis.patch.yml +9 -9
- package/lib/binding.js +172 -172
- package/lib/client.js +3637 -3637
- package/lib/credential.js +177 -177
- package/lib/deploy-tasks.js +142 -142
- package/lib/errors.js +87 -87
- package/lib/file-reference.js +457 -457
- package/lib/forwards.js +258 -258
- package/lib/hostkey.js +108 -108
- package/lib/http-transport.js +196 -196
- package/lib/ignore.js +202 -156
- package/lib/index.js +3779 -3747
- package/lib/openssh.js +838 -838
- package/lib/paths.js +225 -225
- package/lib/pool.js +757 -757
- package/lib/registry.js +95 -95
- package/lib/remote-fs.js +148 -143
- package/lib/routes-fs.js +233 -233
- package/lib/search.js +235 -230
- package/lib/sftp-surface.js +76 -76
- package/lib/sshconfig.js +454 -454
- package/lib/sync.js +275 -275
- package/lib/tasks.js +95 -95
- package/lib/telemetry.js +213 -213
- package/lib/update.js +472 -472
- package/lib/web-attach.js +850 -850
- package/lib/web-deploy-skill.js +205 -205
- package/lib/web-deploy.js +694 -694
- package/node_modules/asn1/Jenkinsfile +65 -0
- package/node_modules/asn1/LICENSE +19 -0
- package/node_modules/asn1/README.md +50 -0
- package/node_modules/asn1/lib/ber/errors.js +13 -0
- package/node_modules/asn1/lib/ber/index.js +27 -0
- package/node_modules/asn1/lib/ber/reader.js +262 -0
- package/node_modules/asn1/lib/ber/types.js +36 -0
- package/node_modules/asn1/lib/ber/writer.js +317 -0
- package/node_modules/asn1/lib/index.js +20 -0
- package/node_modules/asn1/package.json +31 -0
- package/node_modules/bcrypt-pbkdf/CONTRIBUTING.md +13 -0
- package/node_modules/bcrypt-pbkdf/LICENSE +66 -0
- package/node_modules/bcrypt-pbkdf/README.md +45 -0
- package/node_modules/bcrypt-pbkdf/index.js +556 -0
- package/node_modules/bcrypt-pbkdf/package.json +15 -0
- package/node_modules/buildcheck/.eslintrc.js +5 -0
- package/node_modules/buildcheck/.github/workflows/ci.yml +88 -0
- package/node_modules/buildcheck/.github/workflows/lint.yml +27 -0
- package/node_modules/buildcheck/.npmignore +3 -0
- package/node_modules/buildcheck/LICENSE +19 -0
- package/node_modules/buildcheck/README.md +106 -0
- package/node_modules/buildcheck/deps/Find-VisualStudio.cs +250 -0
- package/node_modules/buildcheck/lib/findvs.js +361 -0
- package/node_modules/buildcheck/lib/index.js +738 -0
- package/node_modules/buildcheck/package.json +36 -0
- package/node_modules/buildcheck/test/test.js +8 -0
- package/node_modules/cpu-features/.eslintrc.js +5 -0
- package/node_modules/cpu-features/.github/workflows/ci.yml +74 -0
- package/node_modules/cpu-features/.github/workflows/lint.yml +27 -0
- package/node_modules/cpu-features/LICENSE +19 -0
- package/node_modules/cpu-features/README.md +59 -0
- package/node_modules/cpu-features/binding.gyp +16 -0
- package/node_modules/cpu-features/buildcheck.js +32 -0
- package/node_modules/cpu-features/deps/cpu_features/.clang-format +4 -0
- package/node_modules/cpu-features/deps/cpu_features/.dockerignore +31 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/Dockerfile +5 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/aarch64_linux_cmake.yml +30 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_freebsd_cmake.yml +22 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_bazel.yml +26 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_cmake.yml +31 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_macos_cmake.yml +43 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_windows_cmake.yml +25 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/arm_linux_cmake.yml +31 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/clang_format.yml +24 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/mips_linux_cmake.yml +30 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/power_linux_cmake.yml +29 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/riscv_linux_cmake.yml +28 -0
- package/node_modules/cpu-features/deps/cpu_features/.github/workflows/s390x_linux_cmake.yml +27 -0
- package/node_modules/cpu-features/deps/cpu_features/.grenrc.yml +21 -0
- package/node_modules/cpu-features/deps/cpu_features/BUILD.bazel +329 -0
- package/node_modules/cpu-features/deps/cpu_features/CMakeLists.txt +261 -0
- package/node_modules/cpu-features/deps/cpu_features/CONTRIBUTING.md +23 -0
- package/node_modules/cpu-features/deps/cpu_features/LICENSE +230 -0
- package/node_modules/cpu-features/deps/cpu_features/README.md +272 -0
- package/node_modules/cpu-features/deps/cpu_features/WORKSPACE +19 -0
- package/node_modules/cpu-features/deps/cpu_features/bazel/ci/README.md +5 -0
- package/node_modules/cpu-features/deps/cpu_features/bazel/platforms.bzl +11 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesConfig.cmake.in +3 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesNdkCompatConfig.cmake.in +3 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/README.md +30 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/Makefile +252 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/README.md +40 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.dot +64 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.svg +312 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/generate_image.sh +7 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/amd64/Dockerfile +48 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/toolchain/Dockerfile +34 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/CMakeLists.txt +22 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/main.cpp +11 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/ci/vagrant/freebsd/Vagrantfile +107 -0
- package/node_modules/cpu-features/deps/cpu_features/cmake/googletest.CMakeLists.txt.in +15 -0
- package/node_modules/cpu-features/deps/cpu_features/cpu_features.gyp +105 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_cache_info.h +54 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_macros.h +384 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_aarch64.h +259 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h +121 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_mips.h +74 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_ppc.h +149 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_riscv.h +72 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_s390x.h +108 -0
- package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_x86.h +288 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/bit_utils.h +40 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/cpuid_x86.h +37 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/filesystem.h +39 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/hwcaps.h +240 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/stack_line_reader.h +49 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/string_view.h +110 -0
- package/node_modules/cpu-features/deps/cpu_features/include/internal/windows_utils.h +70 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/CMakeLists.txt +60 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/README.md +4 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.c +205 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.h +320 -0
- package/node_modules/cpu-features/deps/cpu_features/ndk_compat/ndk-compat-test.c +12 -0
- package/node_modules/cpu-features/deps/cpu_features/patches/0001-Add-Apple-Silicon-Support.patch +456 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/generate_badges.d +165 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/make_release.sh +75 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/run_integration.sh +490 -0
- package/node_modules/cpu-features/deps/cpu_features/scripts/test_integration.sh +79 -0
- package/node_modules/cpu-features/deps/cpu_features/src/copy.inl +19 -0
- package/node_modules/cpu-features/deps/cpu_features/src/define_introspection.inl +86 -0
- package/node_modules/cpu-features/deps/cpu_features/src/define_introspection_and_hwcaps.inl +26 -0
- package/node_modules/cpu-features/deps/cpu_features/src/equals.inl +22 -0
- package/node_modules/cpu-features/deps/cpu_features/src/filesystem.c +62 -0
- package/node_modules/cpu-features/deps/cpu_features/src/hwcaps.c +169 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64__base_implementation.inl +88 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_linux_or_android.c +79 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.c +82 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_windows.c +138 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_arm_linux_or_android.c +212 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_mips_linux_or_android.c +93 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_ppc_linux.c +163 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_riscv_linux.c +111 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_s390x_linux.c +120 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86__base_implementation.inl +2055 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_freebsd.c +68 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_linux_or_android.c +58 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_macos.c +57 -0
- package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_windows.c +58 -0
- package/node_modules/cpu-features/deps/cpu_features/src/stack_line_reader.c +132 -0
- package/node_modules/cpu-features/deps/cpu_features/src/string_view.c +192 -0
- package/node_modules/cpu-features/deps/cpu_features/src/utils/list_cpu_features.c +461 -0
- package/node_modules/cpu-features/deps/cpu_features/test/CMakeLists.txt +114 -0
- package/node_modules/cpu-features/deps/cpu_features/test/bit_utils_test.cc +53 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_aarch64_test.cc +396 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_arm_test.cc +384 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_mips_test.cc +176 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_ppc_test.cc +131 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_riscv_test.cc +180 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_s390x_test.cc +82 -0
- package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_x86_test.cc +1729 -0
- package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.cc +103 -0
- package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.h +61 -0
- package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.cc +52 -0
- package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.h +31 -0
- package/node_modules/cpu-features/deps/cpu_features/test/stack_line_reader_test.cc +132 -0
- package/node_modules/cpu-features/deps/cpu_features/test/string_view_test.cc +202 -0
- package/node_modules/cpu-features/lib/index.js +5 -0
- package/node_modules/cpu-features/package.json +40 -0
- package/node_modules/cpu-features/src/binding.cc +151 -0
- package/node_modules/cpu-features/test/test.js +12 -0
- package/node_modules/nan/.github/workflows/ci.yml +46 -0
- package/node_modules/nan/.pre-commit-config.yaml +8 -0
- package/node_modules/nan/CHANGELOG.md +605 -0
- package/node_modules/nan/CMakeLists.txt +138 -0
- package/node_modules/nan/LICENSE.md +9 -0
- package/node_modules/nan/README.md +457 -0
- package/node_modules/nan/doc/asyncworker.md +146 -0
- package/node_modules/nan/doc/buffers.md +54 -0
- package/node_modules/nan/doc/callback.md +76 -0
- package/node_modules/nan/doc/converters.md +41 -0
- package/node_modules/nan/doc/errors.md +226 -0
- package/node_modules/nan/doc/json.md +62 -0
- package/node_modules/nan/doc/maybe_types.md +583 -0
- package/node_modules/nan/doc/methods.md +689 -0
- package/node_modules/nan/doc/new.md +147 -0
- package/node_modules/nan/doc/node_misc.md +123 -0
- package/node_modules/nan/doc/object_wrappers.md +263 -0
- package/node_modules/nan/doc/persistent.md +296 -0
- package/node_modules/nan/doc/scopes.md +73 -0
- package/node_modules/nan/doc/script.md +58 -0
- package/node_modules/nan/doc/string_bytes.md +81 -0
- package/node_modules/nan/doc/v8_internals.md +211 -0
- package/node_modules/nan/doc/v8_misc.md +85 -0
- package/node_modules/nan/include_dirs.js +1 -0
- package/node_modules/nan/nan.h +3202 -0
- package/node_modules/nan/nan_callbacks.h +141 -0
- package/node_modules/nan/nan_callbacks_12_inl.h +730 -0
- package/node_modules/nan/nan_callbacks_pre_12_inl.h +528 -0
- package/node_modules/nan/nan_converters.h +72 -0
- package/node_modules/nan/nan_converters_43_inl.h +68 -0
- package/node_modules/nan/nan_converters_pre_43_inl.h +42 -0
- package/node_modules/nan/nan_define_own_property_helper.h +29 -0
- package/node_modules/nan/nan_implementation_12_inl.h +446 -0
- package/node_modules/nan/nan_implementation_pre_12_inl.h +263 -0
- package/node_modules/nan/nan_json.h +166 -0
- package/node_modules/nan/nan_maybe_43_inl.h +360 -0
- package/node_modules/nan/nan_maybe_pre_43_inl.h +268 -0
- package/node_modules/nan/nan_new.h +340 -0
- package/node_modules/nan/nan_object_wrap.h +156 -0
- package/node_modules/nan/nan_persistent_12_inl.h +132 -0
- package/node_modules/nan/nan_persistent_pre_12_inl.h +242 -0
- package/node_modules/nan/nan_private.h +73 -0
- package/node_modules/nan/nan_scriptorigin.h +97 -0
- package/node_modules/nan/nan_string_bytes.h +305 -0
- package/node_modules/nan/nan_typedarray_contents.h +96 -0
- package/node_modules/nan/nan_weak.h +453 -0
- package/node_modules/nan/package.json +38 -0
- package/node_modules/nan/tools/1to2.js +412 -0
- package/node_modules/nan/tools/README.md +14 -0
- package/node_modules/nan/tools/package.json +19 -0
- package/node_modules/safer-buffer/LICENSE +21 -0
- package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/node_modules/safer-buffer/Readme.md +156 -0
- package/node_modules/safer-buffer/dangerous.js +58 -0
- package/node_modules/safer-buffer/package.json +34 -0
- package/node_modules/safer-buffer/safer.js +77 -0
- package/node_modules/safer-buffer/tests.js +406 -0
- package/node_modules/ssh2/.eslintignore +4 -0
- package/node_modules/ssh2/.eslintrc.js +5 -0
- package/node_modules/ssh2/.github/workflows/ci.yml +110 -0
- package/node_modules/ssh2/.github/workflows/lint.yml +27 -0
- package/node_modules/ssh2/LICENSE +19 -0
- package/node_modules/ssh2/README.md +1529 -0
- package/node_modules/ssh2/SFTP.md +413 -0
- package/node_modules/ssh2/examples/server-chat.js +238 -0
- package/node_modules/ssh2/examples/sftp-server-download-only.js +134 -0
- package/node_modules/ssh2/install.js +27 -0
- package/node_modules/ssh2/lib/Channel.js +295 -0
- package/node_modules/ssh2/lib/agent.js +1123 -0
- package/node_modules/ssh2/lib/client.js +2176 -0
- package/node_modules/ssh2/lib/http-agents.js +84 -0
- package/node_modules/ssh2/lib/index.js +44 -0
- package/node_modules/ssh2/lib/keygen.js +582 -0
- package/node_modules/ssh2/lib/protocol/Protocol.js +2136 -0
- package/node_modules/ssh2/lib/protocol/SFTP.js +4052 -0
- package/node_modules/ssh2/lib/protocol/constants.js +356 -0
- package/node_modules/ssh2/lib/protocol/crypto/binding.gyp +23 -0
- package/node_modules/ssh2/lib/protocol/crypto/poly1305.js +43 -0
- package/node_modules/ssh2/lib/protocol/crypto/src/binding.cc +2300 -0
- package/node_modules/ssh2/lib/protocol/crypto.js +1602 -0
- package/node_modules/ssh2/lib/protocol/handlers.js +16 -0
- package/node_modules/ssh2/lib/protocol/handlers.misc.js +1285 -0
- package/node_modules/ssh2/lib/protocol/kex.js +1908 -0
- package/node_modules/ssh2/lib/protocol/keyParser.js +1484 -0
- package/node_modules/ssh2/lib/protocol/node-fs-compat.js +115 -0
- package/node_modules/ssh2/lib/protocol/utils.js +356 -0
- package/node_modules/ssh2/lib/protocol/zlib.js +255 -0
- package/node_modules/ssh2/lib/server.js +1380 -0
- package/node_modules/ssh2/lib/utils.js +336 -0
- package/node_modules/ssh2/package.json +49 -0
- package/node_modules/ssh2/test/common.js +316 -0
- package/node_modules/ssh2/test/fixtures/bad_rsa_private_key +26 -0
- package/node_modules/ssh2/test/fixtures/https_cert.pem +33 -0
- package/node_modules/ssh2/test/fixtures/https_key.pem +52 -0
- package/node_modules/ssh2/test/fixtures/id_dsa +12 -0
- package/node_modules/ssh2/test/fixtures/id_ecdsa +5 -0
- package/node_modules/ssh2/test/fixtures/id_rsa +15 -0
- package/node_modules/ssh2/test/fixtures/id_rsa.ppk +26 -0
- package/node_modules/ssh2/test/fixtures/id_rsa_enc +30 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa +21 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc +22 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm +23 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa +9 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc +10 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm +10 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519 +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa +27 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc +28 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm +29 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa +12 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc +15 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa +5 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa +27 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc +30 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc.pub.result +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256 +54 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256.pub +1 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256.pub.result +6 -0
- package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256.result +6 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_dsa_enc +17 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_dsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa +26 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa_enc +18 -0
- package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa_enc.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa.pub +9 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa2.pub +10 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa2.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa3.pub +11 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa3.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa4.pub +11 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa4.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa5.pub +8 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa5.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa6.pub +13 -0
- package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa6.pub.result +7 -0
- package/node_modules/ssh2/test/fixtures/openssh_new_rsa +27 -0
- package/node_modules/ssh2/test/fixtures/ssh_host_dsa_key +12 -0
- package/node_modules/ssh2/test/fixtures/ssh_host_ecdsa_key +5 -0
- package/node_modules/ssh2/test/fixtures/ssh_host_rsa_key +15 -0
- package/node_modules/ssh2/test/test-exec.js +578 -0
- package/node_modules/ssh2/test/test-integration-openssh.js +486 -0
- package/node_modules/ssh2/test/test-keygen.js +60 -0
- package/node_modules/ssh2/test/test-misc-client-server.js +1460 -0
- package/node_modules/ssh2/test/test-openssh.js +261 -0
- package/node_modules/ssh2/test/test-protocol-crypto.js +631 -0
- package/node_modules/ssh2/test/test-protocol-keyparser.js +177 -0
- package/node_modules/ssh2/test/test-server-hostkeys.js +138 -0
- package/node_modules/ssh2/test/test-sftp.js +842 -0
- package/node_modules/ssh2/test/test-shell.js +109 -0
- package/node_modules/ssh2/test/test-userauth-agent-openssh.js +110 -0
- package/node_modules/ssh2/test/test-userauth-agent.js +171 -0
- package/node_modules/ssh2/test/test-userauth.js +611 -0
- package/node_modules/ssh2/test/test-worker-imports.js +25 -0
- package/node_modules/ssh2/test/test.js +20 -0
- package/node_modules/ssh2/util/build_pagent.bat +2 -0
- package/node_modules/ssh2/util/pagent.c +88 -0
- package/node_modules/ssh2/util/pagent.exe +0 -0
- package/node_modules/tweetnacl/.npmignore +4 -0
- package/node_modules/tweetnacl/AUTHORS.md +28 -0
- package/node_modules/tweetnacl/CHANGELOG.md +221 -0
- package/node_modules/tweetnacl/LICENSE +24 -0
- package/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md +20 -0
- package/node_modules/tweetnacl/README.md +459 -0
- package/node_modules/tweetnacl/nacl-fast.js +2388 -0
- package/node_modules/tweetnacl/nacl-fast.min.js +2 -0
- package/node_modules/tweetnacl/nacl.d.ts +98 -0
- package/node_modules/tweetnacl/nacl.js +1175 -0
- package/node_modules/tweetnacl/nacl.min.js +1 -0
- package/node_modules/tweetnacl/package.json +58 -0
- package/package.json +96 -89
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
/* eslint-disable node/no-deprecated-api */
|
|
2
|
+
|
|
3
|
+
'use strict'
|
|
4
|
+
|
|
5
|
+
var test = require('tape')
|
|
6
|
+
|
|
7
|
+
var buffer = require('buffer')
|
|
8
|
+
|
|
9
|
+
var index = require('./')
|
|
10
|
+
var safer = require('./safer')
|
|
11
|
+
var dangerous = require('./dangerous')
|
|
12
|
+
|
|
13
|
+
/* Inheritance tests */
|
|
14
|
+
|
|
15
|
+
test('Default is Safer', function (t) {
|
|
16
|
+
t.equal(index, safer)
|
|
17
|
+
t.notEqual(safer, dangerous)
|
|
18
|
+
t.notEqual(index, dangerous)
|
|
19
|
+
t.end()
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
test('Is not a function', function (t) {
|
|
23
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
24
|
+
t.equal(typeof impl, 'object')
|
|
25
|
+
t.equal(typeof impl.Buffer, 'object')
|
|
26
|
+
});
|
|
27
|
+
[buffer].forEach(function (impl) {
|
|
28
|
+
t.equal(typeof impl, 'object')
|
|
29
|
+
t.equal(typeof impl.Buffer, 'function')
|
|
30
|
+
})
|
|
31
|
+
t.end()
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
test('Constructor throws', function (t) {
|
|
35
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
36
|
+
t.throws(function () { impl.Buffer() })
|
|
37
|
+
t.throws(function () { impl.Buffer(0) })
|
|
38
|
+
t.throws(function () { impl.Buffer('a') })
|
|
39
|
+
t.throws(function () { impl.Buffer('a', 'utf-8') })
|
|
40
|
+
t.throws(function () { return new impl.Buffer() })
|
|
41
|
+
t.throws(function () { return new impl.Buffer(0) })
|
|
42
|
+
t.throws(function () { return new impl.Buffer('a') })
|
|
43
|
+
t.throws(function () { return new impl.Buffer('a', 'utf-8') })
|
|
44
|
+
})
|
|
45
|
+
t.end()
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
test('Safe methods exist', function (t) {
|
|
49
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
50
|
+
t.equal(typeof impl.Buffer.alloc, 'function', 'alloc')
|
|
51
|
+
t.equal(typeof impl.Buffer.from, 'function', 'from')
|
|
52
|
+
})
|
|
53
|
+
t.end()
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
test('Unsafe methods exist only in Dangerous', function (t) {
|
|
57
|
+
[index, safer].forEach(function (impl) {
|
|
58
|
+
t.equal(typeof impl.Buffer.allocUnsafe, 'undefined')
|
|
59
|
+
t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined')
|
|
60
|
+
});
|
|
61
|
+
[dangerous].forEach(function (impl) {
|
|
62
|
+
t.equal(typeof impl.Buffer.allocUnsafe, 'function')
|
|
63
|
+
t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function')
|
|
64
|
+
})
|
|
65
|
+
t.end()
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
test('Generic methods/properties are defined and equal', function (t) {
|
|
69
|
+
['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) {
|
|
70
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
71
|
+
t.equal(impl.Buffer[method], buffer.Buffer[method], method)
|
|
72
|
+
t.notEqual(typeof impl.Buffer[method], 'undefined', method)
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
t.end()
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
test('Built-in buffer static methods/properties are inherited', function (t) {
|
|
79
|
+
Object.keys(buffer).forEach(function (method) {
|
|
80
|
+
if (method === 'SlowBuffer' || method === 'Buffer') return;
|
|
81
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
82
|
+
t.equal(impl[method], buffer[method], method)
|
|
83
|
+
t.notEqual(typeof impl[method], 'undefined', method)
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
t.end()
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
test('Built-in Buffer static methods/properties are inherited', function (t) {
|
|
90
|
+
Object.keys(buffer.Buffer).forEach(function (method) {
|
|
91
|
+
if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return;
|
|
92
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
93
|
+
t.equal(impl.Buffer[method], buffer.Buffer[method], method)
|
|
94
|
+
t.notEqual(typeof impl.Buffer[method], 'undefined', method)
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
t.end()
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
test('.prototype property of Buffer is inherited', function (t) {
|
|
101
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
102
|
+
t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype')
|
|
103
|
+
t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype')
|
|
104
|
+
})
|
|
105
|
+
t.end()
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
test('All Safer methods are present in Dangerous', function (t) {
|
|
109
|
+
Object.keys(safer).forEach(function (method) {
|
|
110
|
+
if (method === 'Buffer') return;
|
|
111
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
112
|
+
t.equal(impl[method], safer[method], method)
|
|
113
|
+
if (method !== 'kStringMaxLength') {
|
|
114
|
+
t.notEqual(typeof impl[method], 'undefined', method)
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
Object.keys(safer.Buffer).forEach(function (method) {
|
|
119
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
120
|
+
t.equal(impl.Buffer[method], safer.Buffer[method], method)
|
|
121
|
+
t.notEqual(typeof impl.Buffer[method], 'undefined', method)
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
t.end()
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
test('Safe methods from Dangerous methods are present in Safer', function (t) {
|
|
128
|
+
Object.keys(dangerous).forEach(function (method) {
|
|
129
|
+
if (method === 'Buffer') return;
|
|
130
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
131
|
+
t.equal(impl[method], dangerous[method], method)
|
|
132
|
+
if (method !== 'kStringMaxLength') {
|
|
133
|
+
t.notEqual(typeof impl[method], 'undefined', method)
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
Object.keys(dangerous.Buffer).forEach(function (method) {
|
|
138
|
+
if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return;
|
|
139
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
140
|
+
t.equal(impl.Buffer[method], dangerous.Buffer[method], method)
|
|
141
|
+
t.notEqual(typeof impl.Buffer[method], 'undefined', method)
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
t.end()
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
/* Behaviour tests */
|
|
148
|
+
|
|
149
|
+
test('Methods return Buffers', function (t) {
|
|
150
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
151
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0)))
|
|
152
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10)))
|
|
153
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a')))
|
|
154
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10)))
|
|
155
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x')))
|
|
156
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab')))
|
|
157
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('')))
|
|
158
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string')))
|
|
159
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8')))
|
|
160
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64')))
|
|
161
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3])))
|
|
162
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3]))))
|
|
163
|
+
t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([])))
|
|
164
|
+
});
|
|
165
|
+
['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
|
|
166
|
+
t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0)))
|
|
167
|
+
t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10)))
|
|
168
|
+
})
|
|
169
|
+
t.end()
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
test('Constructor is buffer.Buffer', function (t) {
|
|
173
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
174
|
+
t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer)
|
|
175
|
+
t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer)
|
|
176
|
+
t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer)
|
|
177
|
+
t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer)
|
|
178
|
+
t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer)
|
|
179
|
+
t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer)
|
|
180
|
+
t.equal(impl.Buffer.from('').constructor, buffer.Buffer)
|
|
181
|
+
t.equal(impl.Buffer.from('string').constructor, buffer.Buffer)
|
|
182
|
+
t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer)
|
|
183
|
+
t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer)
|
|
184
|
+
t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer)
|
|
185
|
+
t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer)
|
|
186
|
+
t.equal(impl.Buffer.from([]).constructor, buffer.Buffer)
|
|
187
|
+
});
|
|
188
|
+
[0, 10, 100].forEach(function (arg) {
|
|
189
|
+
t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer)
|
|
190
|
+
t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor)
|
|
191
|
+
})
|
|
192
|
+
t.end()
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
test('Invalid calls throw', function (t) {
|
|
196
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
197
|
+
t.throws(function () { impl.Buffer.from(0) })
|
|
198
|
+
t.throws(function () { impl.Buffer.from(10) })
|
|
199
|
+
t.throws(function () { impl.Buffer.from(10, 'utf-8') })
|
|
200
|
+
t.throws(function () { impl.Buffer.from('string', 'invalid encoding') })
|
|
201
|
+
t.throws(function () { impl.Buffer.from(-10) })
|
|
202
|
+
t.throws(function () { impl.Buffer.from(1e90) })
|
|
203
|
+
t.throws(function () { impl.Buffer.from(Infinity) })
|
|
204
|
+
t.throws(function () { impl.Buffer.from(-Infinity) })
|
|
205
|
+
t.throws(function () { impl.Buffer.from(NaN) })
|
|
206
|
+
t.throws(function () { impl.Buffer.from(null) })
|
|
207
|
+
t.throws(function () { impl.Buffer.from(undefined) })
|
|
208
|
+
t.throws(function () { impl.Buffer.from() })
|
|
209
|
+
t.throws(function () { impl.Buffer.from({}) })
|
|
210
|
+
t.throws(function () { impl.Buffer.alloc('') })
|
|
211
|
+
t.throws(function () { impl.Buffer.alloc('string') })
|
|
212
|
+
t.throws(function () { impl.Buffer.alloc('string', 'utf-8') })
|
|
213
|
+
t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') })
|
|
214
|
+
t.throws(function () { impl.Buffer.alloc(-10) })
|
|
215
|
+
t.throws(function () { impl.Buffer.alloc(1e90) })
|
|
216
|
+
t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) })
|
|
217
|
+
t.throws(function () { impl.Buffer.alloc(Infinity) })
|
|
218
|
+
t.throws(function () { impl.Buffer.alloc(-Infinity) })
|
|
219
|
+
t.throws(function () { impl.Buffer.alloc(null) })
|
|
220
|
+
t.throws(function () { impl.Buffer.alloc(undefined) })
|
|
221
|
+
t.throws(function () { impl.Buffer.alloc() })
|
|
222
|
+
t.throws(function () { impl.Buffer.alloc([]) })
|
|
223
|
+
t.throws(function () { impl.Buffer.alloc([0, 42, 3]) })
|
|
224
|
+
t.throws(function () { impl.Buffer.alloc({}) })
|
|
225
|
+
});
|
|
226
|
+
['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
|
|
227
|
+
t.throws(function () { dangerous.Buffer[method]('') })
|
|
228
|
+
t.throws(function () { dangerous.Buffer[method]('string') })
|
|
229
|
+
t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') })
|
|
230
|
+
t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) })
|
|
231
|
+
t.throws(function () { dangerous.Buffer[method](Infinity) })
|
|
232
|
+
if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) {
|
|
233
|
+
t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0')
|
|
234
|
+
} else {
|
|
235
|
+
t.throws(function () { dangerous.Buffer[method](-10) })
|
|
236
|
+
t.throws(function () { dangerous.Buffer[method](-1e90) })
|
|
237
|
+
t.throws(function () { dangerous.Buffer[method](-Infinity) })
|
|
238
|
+
}
|
|
239
|
+
t.throws(function () { dangerous.Buffer[method](null) })
|
|
240
|
+
t.throws(function () { dangerous.Buffer[method](undefined) })
|
|
241
|
+
t.throws(function () { dangerous.Buffer[method]() })
|
|
242
|
+
t.throws(function () { dangerous.Buffer[method]([]) })
|
|
243
|
+
t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) })
|
|
244
|
+
t.throws(function () { dangerous.Buffer[method]({}) })
|
|
245
|
+
})
|
|
246
|
+
t.end()
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
test('Buffers have appropriate lengths', function (t) {
|
|
250
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
251
|
+
t.equal(impl.Buffer.alloc(0).length, 0)
|
|
252
|
+
t.equal(impl.Buffer.alloc(10).length, 10)
|
|
253
|
+
t.equal(impl.Buffer.from('').length, 0)
|
|
254
|
+
t.equal(impl.Buffer.from('string').length, 6)
|
|
255
|
+
t.equal(impl.Buffer.from('string', 'utf-8').length, 6)
|
|
256
|
+
t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11)
|
|
257
|
+
t.equal(impl.Buffer.from([0, 42, 3]).length, 3)
|
|
258
|
+
t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3)
|
|
259
|
+
t.equal(impl.Buffer.from([]).length, 0)
|
|
260
|
+
});
|
|
261
|
+
['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
|
|
262
|
+
t.equal(dangerous.Buffer[method](0).length, 0)
|
|
263
|
+
t.equal(dangerous.Buffer[method](10).length, 10)
|
|
264
|
+
})
|
|
265
|
+
t.end()
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
test('Buffers have appropriate lengths (2)', function (t) {
|
|
269
|
+
t.equal(index.Buffer.alloc, safer.Buffer.alloc)
|
|
270
|
+
t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
|
|
271
|
+
var ok = true;
|
|
272
|
+
[ safer.Buffer.alloc,
|
|
273
|
+
dangerous.Buffer.allocUnsafe,
|
|
274
|
+
dangerous.Buffer.allocUnsafeSlow
|
|
275
|
+
].forEach(function (method) {
|
|
276
|
+
for (var i = 0; i < 1e2; i++) {
|
|
277
|
+
var length = Math.round(Math.random() * 1e5)
|
|
278
|
+
var buf = method(length)
|
|
279
|
+
if (!buffer.Buffer.isBuffer(buf)) ok = false
|
|
280
|
+
if (buf.length !== length) ok = false
|
|
281
|
+
}
|
|
282
|
+
})
|
|
283
|
+
t.ok(ok)
|
|
284
|
+
t.end()
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
test('.alloc(size) is zero-filled and has correct length', function (t) {
|
|
288
|
+
t.equal(index.Buffer.alloc, safer.Buffer.alloc)
|
|
289
|
+
t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
|
|
290
|
+
var ok = true
|
|
291
|
+
for (var i = 0; i < 1e2; i++) {
|
|
292
|
+
var length = Math.round(Math.random() * 2e6)
|
|
293
|
+
var buf = index.Buffer.alloc(length)
|
|
294
|
+
if (!buffer.Buffer.isBuffer(buf)) ok = false
|
|
295
|
+
if (buf.length !== length) ok = false
|
|
296
|
+
var j
|
|
297
|
+
for (j = 0; j < length; j++) {
|
|
298
|
+
if (buf[j] !== 0) ok = false
|
|
299
|
+
}
|
|
300
|
+
buf.fill(1)
|
|
301
|
+
for (j = 0; j < length; j++) {
|
|
302
|
+
if (buf[j] !== 1) ok = false
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
t.ok(ok)
|
|
306
|
+
t.end()
|
|
307
|
+
})
|
|
308
|
+
|
|
309
|
+
test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) {
|
|
310
|
+
['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
|
|
311
|
+
var ok = true
|
|
312
|
+
for (var i = 0; i < 1e2; i++) {
|
|
313
|
+
var length = Math.round(Math.random() * 2e6)
|
|
314
|
+
var buf = dangerous.Buffer[method](length)
|
|
315
|
+
if (!buffer.Buffer.isBuffer(buf)) ok = false
|
|
316
|
+
if (buf.length !== length) ok = false
|
|
317
|
+
buf.fill(0, 0, length)
|
|
318
|
+
var j
|
|
319
|
+
for (j = 0; j < length; j++) {
|
|
320
|
+
if (buf[j] !== 0) ok = false
|
|
321
|
+
}
|
|
322
|
+
buf.fill(1, 0, length)
|
|
323
|
+
for (j = 0; j < length; j++) {
|
|
324
|
+
if (buf[j] !== 1) ok = false
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
t.ok(ok, method)
|
|
328
|
+
})
|
|
329
|
+
t.end()
|
|
330
|
+
})
|
|
331
|
+
|
|
332
|
+
test('.alloc(size, fill) is `fill`-filled', function (t) {
|
|
333
|
+
t.equal(index.Buffer.alloc, safer.Buffer.alloc)
|
|
334
|
+
t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
|
|
335
|
+
var ok = true
|
|
336
|
+
for (var i = 0; i < 1e2; i++) {
|
|
337
|
+
var length = Math.round(Math.random() * 2e6)
|
|
338
|
+
var fill = Math.round(Math.random() * 255)
|
|
339
|
+
var buf = index.Buffer.alloc(length, fill)
|
|
340
|
+
if (!buffer.Buffer.isBuffer(buf)) ok = false
|
|
341
|
+
if (buf.length !== length) ok = false
|
|
342
|
+
for (var j = 0; j < length; j++) {
|
|
343
|
+
if (buf[j] !== fill) ok = false
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
t.ok(ok)
|
|
347
|
+
t.end()
|
|
348
|
+
})
|
|
349
|
+
|
|
350
|
+
test('.alloc(size, fill) is `fill`-filled', function (t) {
|
|
351
|
+
t.equal(index.Buffer.alloc, safer.Buffer.alloc)
|
|
352
|
+
t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
|
|
353
|
+
var ok = true
|
|
354
|
+
for (var i = 0; i < 1e2; i++) {
|
|
355
|
+
var length = Math.round(Math.random() * 2e6)
|
|
356
|
+
var fill = Math.round(Math.random() * 255)
|
|
357
|
+
var buf = index.Buffer.alloc(length, fill)
|
|
358
|
+
if (!buffer.Buffer.isBuffer(buf)) ok = false
|
|
359
|
+
if (buf.length !== length) ok = false
|
|
360
|
+
for (var j = 0; j < length; j++) {
|
|
361
|
+
if (buf[j] !== fill) ok = false
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
t.ok(ok)
|
|
365
|
+
t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97))
|
|
366
|
+
t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98))
|
|
367
|
+
|
|
368
|
+
var tmp = new buffer.Buffer(2)
|
|
369
|
+
tmp.fill('ok')
|
|
370
|
+
if (tmp[1] === tmp[0]) {
|
|
371
|
+
// Outdated Node.js
|
|
372
|
+
t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo'))
|
|
373
|
+
} else {
|
|
374
|
+
t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko'))
|
|
375
|
+
}
|
|
376
|
+
t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok'))
|
|
377
|
+
|
|
378
|
+
t.end()
|
|
379
|
+
})
|
|
380
|
+
|
|
381
|
+
test('safer.Buffer.from returns results same as Buffer constructor', function (t) {
|
|
382
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
383
|
+
t.deepEqual(impl.Buffer.from(''), new buffer.Buffer(''))
|
|
384
|
+
t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string'))
|
|
385
|
+
t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8'))
|
|
386
|
+
t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64'))
|
|
387
|
+
t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3]))
|
|
388
|
+
t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3])))
|
|
389
|
+
t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([]))
|
|
390
|
+
})
|
|
391
|
+
t.end()
|
|
392
|
+
})
|
|
393
|
+
|
|
394
|
+
test('safer.Buffer.from returns consistent results', function (t) {
|
|
395
|
+
[index, safer, dangerous].forEach(function (impl) {
|
|
396
|
+
t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0))
|
|
397
|
+
t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0))
|
|
398
|
+
t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0))
|
|
399
|
+
t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string'))
|
|
400
|
+
t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103]))
|
|
401
|
+
t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string')))
|
|
402
|
+
t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree'))
|
|
403
|
+
t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree'))
|
|
404
|
+
})
|
|
405
|
+
t.end()
|
|
406
|
+
})
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [ master ]
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
CI_CHECK_FAIL: ssh2
|
|
10
|
+
OPENSSL_CONF: /dev/null
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
tests-linux:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
node-version: [10.16.0, 10.x, 12.x, 14.x, 16.x, 18.x, 20.x, 22.x, 24.x]
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
persist-credentials: false
|
|
23
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
24
|
+
uses: actions/setup-node@v4
|
|
25
|
+
with:
|
|
26
|
+
node-version: ${{ matrix.node-version }}
|
|
27
|
+
- name: Check Node.js version
|
|
28
|
+
run: node -pe process.versions
|
|
29
|
+
- name: Check npm version
|
|
30
|
+
run: npm -v
|
|
31
|
+
- name: Install Python 2.7 (node <16.x)
|
|
32
|
+
if: ${{ contains(fromJSON('["10.16.0", "10.x", "12.x", "14.x"]'), matrix.node-version) }}
|
|
33
|
+
uses: LizardByte/setup-python-action@v2024.1105.190605
|
|
34
|
+
with:
|
|
35
|
+
python-version: '2.7'
|
|
36
|
+
- name: Use Python 2.7 (node <16.x)
|
|
37
|
+
if: ${{ contains(fromJSON('["10.16.0", "10.x", "12.x", "14.x"]'), matrix.node-version) }}
|
|
38
|
+
run: echo "PYTHON=$(which python2.7)" >> "$GITHUB_ENV"
|
|
39
|
+
- name: Install module
|
|
40
|
+
run: npm install
|
|
41
|
+
- name: Run tests
|
|
42
|
+
run: npm test
|
|
43
|
+
tests-macos:
|
|
44
|
+
runs-on: macos-latest
|
|
45
|
+
strategy:
|
|
46
|
+
fail-fast: false
|
|
47
|
+
matrix:
|
|
48
|
+
node-version: [16.x, 18.x, 20.x, 22.x, 24.x]
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v4
|
|
51
|
+
with:
|
|
52
|
+
persist-credentials: false
|
|
53
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
54
|
+
uses: actions/setup-node@v4
|
|
55
|
+
with:
|
|
56
|
+
node-version: ${{ matrix.node-version }}
|
|
57
|
+
- name: Install Python 3.10
|
|
58
|
+
uses: actions/setup-python@v5
|
|
59
|
+
with:
|
|
60
|
+
python-version: '3.10'
|
|
61
|
+
- name: Check Node.js version
|
|
62
|
+
run: node -pe process.versions
|
|
63
|
+
- name: Check npm version
|
|
64
|
+
run: npm -v
|
|
65
|
+
- name: Install module
|
|
66
|
+
run: npm install
|
|
67
|
+
- name: Run tests
|
|
68
|
+
run: npm test
|
|
69
|
+
tests-macos-homebrew:
|
|
70
|
+
runs-on: macos-latest
|
|
71
|
+
steps:
|
|
72
|
+
- uses: actions/checkout@v4
|
|
73
|
+
with:
|
|
74
|
+
persist-credentials: false
|
|
75
|
+
- name: Use Node.js (latest)
|
|
76
|
+
run: brew install node
|
|
77
|
+
- name: Install Python 3.10
|
|
78
|
+
uses: actions/setup-python@v5
|
|
79
|
+
with:
|
|
80
|
+
python-version: '3.10'
|
|
81
|
+
- name: Check Node.js version
|
|
82
|
+
run: node -pe process.versions
|
|
83
|
+
- name: Check npm version
|
|
84
|
+
run: npm -v
|
|
85
|
+
- name: Install module
|
|
86
|
+
run: npm install
|
|
87
|
+
- name: Run tests
|
|
88
|
+
run: npm test
|
|
89
|
+
tests-windows:
|
|
90
|
+
runs-on: windows-2022
|
|
91
|
+
strategy:
|
|
92
|
+
fail-fast: false
|
|
93
|
+
matrix:
|
|
94
|
+
node-version: [16.x, 18.x, 20.x, 22.x, 24.x]
|
|
95
|
+
steps:
|
|
96
|
+
- uses: actions/checkout@v4
|
|
97
|
+
with:
|
|
98
|
+
persist-credentials: false
|
|
99
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
100
|
+
uses: actions/setup-node@v4
|
|
101
|
+
with:
|
|
102
|
+
node-version: ${{ matrix.node-version }}
|
|
103
|
+
- name: Check Node.js version
|
|
104
|
+
run: node -pe process.versions
|
|
105
|
+
- name: Check npm version
|
|
106
|
+
run: npm -v
|
|
107
|
+
- name: Install module
|
|
108
|
+
run: npm install
|
|
109
|
+
- name: Run tests
|
|
110
|
+
run: npm test
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [ master ]
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
NODE_VERSION: 18.x
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
lint-js:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
persist-credentials: false
|
|
18
|
+
- name: Use Node.js ${{ env.NODE_VERSION }}
|
|
19
|
+
uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
22
|
+
- name: Check Node.js version
|
|
23
|
+
run: node -pe process.versions
|
|
24
|
+
- name: Install ESLint + ESLint configs/plugins
|
|
25
|
+
run: npm install --only=dev
|
|
26
|
+
- name: Lint files
|
|
27
|
+
run: npm run lint
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright Brian White. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to
|
|
5
|
+
deal in the Software without restriction, including without limitation the
|
|
6
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
7
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
18
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
19
|
+
IN THE SOFTWARE.
|