Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: KeyObject helper functions return JSCryptoKey #15658

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

DonIsaac
Copy link
Contributor

@DonIsaac DonIsaac commented Dec 8, 2024

What does this PR do?

Refactors helper functions in KeyObject.cpp to return JSCryptoKey objects instead of EncodeJSValues, along with some other minor refactors. Prereq refactor to KeyObject JS -> native migration. Part of #15585.

Note to reviewers: I recommend reviewing each commit individually.

How did you verify your code works?

Tests already exist for this logic.

@robobun
Copy link

robobun commented Dec 8, 2024

❌ Your commit 907632e has 13 failures in #7629:

  • test/regression/issue/09041.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/regression/issue/09041.test.ts - 1 failing on 🐧 3.20 x64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64-baseline
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64
  • test/cli/hot/hot.test.ts - timeout on 🐧 24.04 x64
  • test/cli/hot/hot.test.ts - timeout on 🐧 3.20 aarch64
  • test/cli/hot/hot.test.ts - timeout on 🐧 3.20 x64
  • test/bundler/bundler_compile.test.ts - 1 failing on 🐧 20.04 x64-baseline
  • test/js/bun/spawn/spawn.test.ts - 1 failing on 🐧 24.04 aarch64
  • test/js/bun/util/sleep.test.ts - 1 failing on 🪟 2019 x64-baseline
  • test/integration/next-pages/test/next-build.test.ts - 1 failing on 🪟 2019 x64
  • test/integration/next-pages/test/next-build.test.ts - 1 failing on 🪟 2019 x64-baseline
  • test/js/web/fetch/fetch.test.ts - 1 failing on 🍎 14 aarch64
  • test/integration/next-pages/test/dev-server-ssr-100.test.ts - segmentation fault at address 0x20 on 🪟 2019 x64
  • test/cli/run/require-cache.test.ts - 1 failing on 🪟 2019 x64
  • test/cli/run/require-cache.test.ts - 1 failing on 🪟 2019 x64-baseline
  • test/js/node/test/parallel/test-crypto-keygen-async-named-elliptic-curve.js - SIGABRT on 🍎 13 aarch64
  • test/js/node/test/parallel/test-crypto-keygen-async-named-elliptic-curve.js - SIGABRT on 🍎 14 aarch64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🍎 13 aarch64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🍎 14 aarch64
  • test/js/node/crypto/crypto.key-objects.test.ts - code STATUS_STACK_BUFFER_OVERRUN on 🪟 2019 x64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 22.04 aarch64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 11 aarch64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 12 aarch64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 20.04 aarch64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🍎 13 x64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 24.04 aarch64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🍎 14 x64
  • test/js/node/crypto/crypto.key-objects.test.ts - code STATUS_STACK_BUFFER_OVERRUN on 🪟 2019 x64-baseline
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 11 x64-baseline
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 12 x64-baseline
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 22.04 x64-baseline
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 11 x64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 24.04 x64-baseline
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 12 x64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 22.04 x64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 20.04 x64-baseline
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 20.04 x64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 24.04 x64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 3.20 aarch64
  • test/js/node/crypto/crypto.key-objects.test.ts - SIGABRT on 🐧 3.20 x64
  • test/js/node/test/parallel/test-crypto-keygen-async-explicit-elliptic-curve.js - SIGABRT on 🍎 13 aarch64
  • test/js/node/test/parallel/test-crypto-keygen-async-explicit-elliptic-curve.js - SIGABRT on 🍎 14 aarch64
  • Copy link
    Member

    @cirospaciari cirospaciari left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Test failures

    @@ -88,6 +88,12 @@ JSC_DECLARE_HOST_FUNCTION(KeyObject__privateDecrypt);

    namespace WebCore {

    /// Encodes `undefined` if `key` is `nullptr`.
    JSC::EncodedJSValue encodeKey(const std::optional<JSCryptoKey*> key)
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    I would choose another name here just to add what is being encoded and to what is being encoded example: encodeKeyObjectToJS

    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.

    3 participants