Skip to content

Hash.prototype._flush does not set state[kFinalized] #38727

Closed
@misos1

Description

@misos1
  • Version: v16.1.0
  • Platform: Darwin Kernel Version 20.4.0
  • Subsystem: crypto

What steps will reproduce the bug?

https://github.com/nodejs/node/blob/master/lib/internal/crypto/hash.js#L90-L93

When using the stream interface of hash it will call this[kHandle].digest() in Hash.prototype._flush. After that it is possible to call Hash.prototype.digest which will call this[kHandle].digest() again. If that is ok then why is Hash.prototype.digest made in a way that it is not possible to call it more than once?

How often does it reproduce? Is there a required condition?

What is the expected behavior?

What do you see instead?

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    cryptoIssues and PRs related to the crypto subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions