diff options
author | Luca Casonato <hello@lcas.dev> | 2024-07-05 10:10:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-05 10:10:22 +0200 |
commit | 08e5606c3400d3a993c0ce6748901c56fc3db35b (patch) | |
tree | 032d3a09c6d22763ceb703e7908ca159d3d7a809 /ext/node/polyfills/internal/crypto/sig.ts | |
parent | b290fd01f3f5d32f9d010fc719ced0240759c049 (diff) |
fix(ext/node): rewrite digest handling (#24392)
Previously we had many different code paths all
handling digests in different places, all with
wildly different digest support. This commit
rewrites this to use a single digest handling
mechanism for all digest operations.
It adds various aliases for digest algorithms,
like node does. For example
`sha1WithRSAEncryption` is an alias for `sha1`.
It also adds support for `md5-sha1` digests in
various places.
Diffstat (limited to 'ext/node/polyfills/internal/crypto/sig.ts')
-rw-r--r-- | ext/node/polyfills/internal/crypto/sig.ts | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/ext/node/polyfills/internal/crypto/sig.ts b/ext/node/polyfills/internal/crypto/sig.ts index 5a9611780..473670d2a 100644 --- a/ext/node/polyfills/internal/crypto/sig.ts +++ b/ext/node/polyfills/internal/crypto/sig.ts @@ -67,10 +67,6 @@ export class SignImpl extends Writable { algorithm = algorithm.toLowerCase(); - if (algorithm.startsWith("rsa-")) { - // Allows RSA-[digest_algorithm] as a valid algorithm - algorithm = algorithm.slice(4); - } this.#digestType = algorithm; this.hash = createHash(this.#digestType); } @@ -121,11 +117,6 @@ export class VerifyImpl extends Writable { algorithm = algorithm.toLowerCase(); - if (algorithm.startsWith("rsa-")) { - // Allows RSA-[digest_algorithm] as a valid algorithm - algorithm = algorithm.slice(4); - } - this.#digestType = algorithm; this.hash = createHash(this.#digestType); } |