-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ext/node): resource leak in createHmac (#18229)
This commit fixes #18140. Verified that test fails on `main`.
- Loading branch information
1 parent
2c7174a
commit 1300d61
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. | ||
import { createHash, createHmac } from "node:crypto"; | ||
import { assertEquals } from "../../../test_util/std/testing/asserts.ts"; | ||
|
||
// https://github.com/denoland/deno/issues/18140 | ||
Deno.test({ | ||
name: "createHmac digest", | ||
fn() { | ||
assertEquals( | ||
createHmac("sha256", "secret").update("hello").digest("hex"), | ||
"88aab3ede8d3adf94d26ab90d3bafd4a2083070c3bcce9c014ee04a443847c0b", | ||
); | ||
}, | ||
}); | ||
|
||
Deno.test({ | ||
name: "createHash digest", | ||
fn() { | ||
assertEquals( | ||
createHash("sha256").update("hello").digest("hex"), | ||
"2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", | ||
); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters