Skip to content

node:crypto: split #2013 argument-validation parity tail #3955

@andrewtdiz

Description

@andrewtdiz

Summary

Split from #2013 after the fs validation reconciliation. The broad #2013 tracker named crypto as a historical stdlib validation cluster, but the current open crypto issues mostly cover manifest/export shape, KeyObject surface, algorithms, or behavior-specific gaps rather than a validation-only child.

This issue owns Node-compatible argument validation and error-code parity for the claimed node:crypto surface.

Local scope signals

Current curated crypto fixtures include validation/error coverage such as:

  • test-parity/node-suite/crypto/random/arg-validation.ts
  • test-parity/node-suite/crypto/random/random-fill-validation.ts
  • test-parity/node-suite/crypto/random/random-int-range-validation.ts
  • test-parity/node-suite/crypto/random/random-uuid-validation.ts
  • test-parity/node-suite/crypto/timing/timing-safe-equal-validation.ts
  • test-parity/node-suite/crypto/x509/invalid-constructor.ts
  • test-parity/node-suite/crypto/hash/unknown-algorithm.ts
  • test-parity/node-suite/crypto/hmac/unknown-algorithm.ts
  • test-parity/node-suite/crypto/webcrypto/errors/*

Scope

Validate and, where needed, fix invalid argument behavior for supported crypto APIs, including random bytes/fill/int/UUID options, timingSafeEqual, hash/HMAC/cipher/sign/KDF constructors and update/finalization paths, X509 constructor validation, WebCrypto algorithm/key mismatch errors, and key-generation/key-object validation where covered.

Match Node's thrown or rejected error class and .code where applicable, including ERR_INVALID_ARG_TYPE, ERR_OUT_OF_RANGE, ERR_INVALID_ARG_VALUE, ERR_CRYPTO_*, and DOMException names used by WebCrypto.

Acceptance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions