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

Fix decryption of strings larger than 4 MiB #411

Merged
merged 5 commits into from
Sep 24, 2024

Commits on Sep 24, 2024

  1. fix: fix decrypting strings larger than 4 MiB

    The `cloakedStringRegex` fails to parse ciphertexts larger than about
    4 MiB. This is due to [limitations in V8's regex engine][1].
    
    I've adapted the implementation from
    validatorjs/validator.js#503 under the MIT
    license, as it solves the error.
    
    [1]: https://issues.chromium.org/issues/42207207
    aloisklink committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    8e2b826 View commit details
    Browse the repository at this point in the history
  2. feat: export parseCloakedString function

    This function can be used instead of `cloakedStringRegex` on large
    strings.
    aloisklink committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    db7c948 View commit details
    Browse the repository at this point in the history
  3. feat: deprecate cloakedStringRegex

    This regex fails on large 4 MiB + strings.
    `parseCloakedString` should be used instead when possible.
    aloisklink committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    e19ac07 View commit details
    Browse the repository at this point in the history
  4. test: test decrypting strings larger than 4 MiB

    This fails in Node.JS v20.17.0 with @47ng/cloak v1.1.0.
    aloisklink committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    52042f3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7081165 View commit details
    Browse the repository at this point in the history