Skip to content

crypto: set DEFAULT_ENCODING property to non-enumerable#1

Closed
aduh95 wants to merge 1 commit into
masterfrom
remove-crypto-warnings
Closed

crypto: set DEFAULT_ENCODING property to non-enumerable#1
aduh95 wants to merge 1 commit into
masterfrom
remove-crypto-warnings

Conversation

@aduh95

@aduh95 aduh95 commented Oct 2, 2018

Copy link
Copy Markdown
Owner

Since it is a deprecated API, a deprecation warning is printed when
loading crypto module from ESM. Making it non enumerable remove the
deprecation warning and make the API non-available to named imports.

Fixes: nodejs#23203

The Credentials API was already removed by nodejs#21153.

It is a breaking change, but IMHO it should be integrated to Node 11 before it's released as it is a minor semver change.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Since it is a deprecated API, a deprecation warning is printed when
loading crypto module from ESM. Making it non enumerable remove the
deprecation warning and make the API non-available to named imports.

Fixes: nodejs#23203
@aduh95

aduh95 commented Oct 2, 2018

Copy link
Copy Markdown
Owner Author

Aaaannndd I submitted this to the wrong fork

@aduh95 aduh95 closed this Oct 2, 2018
aduh95 pushed a commit that referenced this pull request Nov 7, 2018
Reverting this enables us to provide slower, but longer-lasting
replacements for the deprecated APIs.

Original commit message:

    Put back deleted V8_DEPRECATE_SOON methods

    This partially reverts
    https://chromium-review.googlesource.com/c/v8/v8/+/1177861,
    which deleted many V8_DEPRECATE_SOON methods rather than moving them to
    V8_DEPRECATED first. This puts them back and marks them V8_DEPRECATED.

    Note V8_DEPRECATED that were deleted in the same CL stay deleted.

    NOTRY=true
    NOPRESUBMIT=true
    NOTREECHECKS=true

    Bug: v8:7786, v8:8240
    Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
    Change-Id: I00330036d957f98dab403465b25e30d8382aac22
    Reviewed-on: https://chromium-review.googlesource.com/1251422
    Commit-Queue: Dan Elphick <delphick@chromium.org>
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Reviewed-by: Michael Hablich <hablich@chromium.org>
    Cr-Commit-Position: refs/branch-heads/7.0@{nodejs#49}
    Cr-Branched-From: 6e2adae6f7f8e891cfd01f3280482b20590427a6-refs/heads/7.0.276@{#1}
    Cr-Branched-From: bc08a8624cbbea7a2d30071472bc73ad9544eadf-refs/heads/master@{nodejs#55424}

Refs: v8/v8@9136dd8
Refs: nodejs#23122

PR-URL: nodejs#23158
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
aduh95 pushed a commit that referenced this pull request Sep 22, 2024
Original commit message:

    Merged: [runtime] Set instance prototypes directly on maps

    Bug: chromium:1452137
    (cherry picked from commit c7c447735f762f6d6d0878e229371797845ef4ab)

    Change-Id: I611c41f942e2e51f3c4b4f1d119c18410617188e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4637888
    Commit-Queue: Igor Sheludko <ishell@chromium.org>
    Auto-Submit: Igor Sheludko <ishell@chromium.org>
    Commit-Queue: Toon Verwaest <verwaest@chromium.org>
    Reviewed-by: Toon Verwaest <verwaest@chromium.org>
    Cr-Commit-Position: refs/branch-heads/11.4@{nodejs#47}
    Cr-Branched-From: 8a8a1e7086dacc426965d3875914efa66663c431-refs/heads/11.4.183@{#1}
    Cr-Branched-From: 5483d8e816e0bbce865cbbc3fa0ab357e6330bab-refs/heads/main@{#87241}

Refs: v8/v8@a1efa53
PR-URL: nodejs#50077
Refs: nodejs/nodejs-dependency-vuln-assessments#151
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
aduh95 pushed a commit that referenced this pull request Sep 22, 2024
Original commit message:

    Merged: [compiler] StackCheck can have side effects

    Bug: chromium:1452137
    (cherry picked from commit e548943e473b020fdc1de6e5543ca31b24d8b7f9)

    Change-Id: Ibd7c9b02efd12341b452e4c34a635a58a817649f
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4637129
    Reviewed-by: Toon Verwaest <verwaest@chromium.org>
    Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
    Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
    Commit-Queue: Toon Verwaest <verwaest@chromium.org>
    Cr-Commit-Position: refs/branch-heads/11.4@{nodejs#49}
    Cr-Branched-From: 8a8a1e7086dacc426965d3875914efa66663c431-refs/heads/11.4.183@{#1}
    Cr-Branched-From: 5483d8e816e0bbce865cbbc3fa0ab357e6330bab-refs/heads/main@{#87241}

Refs: v8/v8@840650f
PR-URL: nodejs#50077
Refs: nodejs/nodejs-dependency-vuln-assessments#151
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
aduh95 pushed a commit that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit that referenced this pull request Nov 20, 2024
Notable changes:

doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) nodejs#55732
src:
  * (SEMVER-MINOR) add cli option to preserve env vars on dr (Rafael Gonzaga) nodejs#55697
util:
  * (SEMVER-MINOR) add sourcemap support to getCallSites (Marco Ippolito) nodejs#55589
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) nodejs#55626

PR-URL: #1
aduh95 pushed a commit that referenced this pull request Jun 4, 2026
This function call can fail with `Z_VERSION_ERROR` if the compiled
library vs loaded library mismatched in version number or in
stream structure size.
In those cases, zlib doesn't initialize the `strm_.msg` field to
null. Therefore, when a `CompressionError` object is created via
`ErrorForMessage()`, it can read a stale or uninitialized `strm_.msg`
pointer that will cause a crash.

Example ASAN report:
```
AddressSanitizer: SEGV on unknown address
    #0 __strlen_avx2
        string/../sysdeps/x86_64/multiarch/strlen-avx2.S:76
    #1 strlen (/work/node/out/Debug/node+0x1a42ab7)
    #2 v8::(anonymous namespace)::StringLength(char const*)
        /work/node/out/../deps/v8/src/api/api.cc:7581:16
    #3 v8::(anonymous namespace)::StringLength(unsigned char const*)
        /work/node/out/../deps/v8/src/api/api.cc:7587:10
    #4 v8::String::NewFromOneByte(v8::Isolate*,
        unsigned char const*, v8::NewStringType, int)
        /work/node/out/../deps/v8/src/api/api.cc:7677:3
    #5 node::OneByteString(v8::Isolate*,
        char const*, int, v8::NewStringType)
        /work/node/out/../src/util-inl.h:166:10
    #6 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::EmitError(node::(anonymous namespace)
        ::CompressionError const&)
        /work/node/out/../src/node_zlib.cc:565:7
    #7 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::CheckError()
        /work/node/out/../src/node_zlib.cc:519:5
    #8 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::AfterThreadPoolWork(int)
        /work/node/out/../src/node_zlib.cc:543:10
    #9 node::ThreadPoolWork::ScheduleWork()
        ::'lambda'(uv_work_s*, int)
        ::operator()(uv_work_s*, int) const
        /work/node/out/../src/threadpoolwork-inl.h:57:15
    #10 node::ThreadPoolWork::ScheduleWork()
        ::'lambda'(uv_work_s*, int)
        ::__invoke(uv_work_s*, int)
        /work/node/out/../src/threadpoolwork-inl.h:48:7
    #11 uv__work_done /work/libuv-1.51.0/src/threadpool.c:330:5
    #12 uv__async_io.part.0
        /work/libuv-1.51.0/src/unix/async.c:208:5
```

Signed-off-by: ndossche <nora.dossche@ugent.be>
PR-URL: nodejs#63476
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crypto warnings coming up for import crypto from 'crypto'

1 participant