mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
crypto: runtime deprecate hmac constructor
PR-URL: https://github.com/nodejs/node/pull/52071 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
This commit is contained in:
parent
8bc745944e
commit
d62ab3a1ef
@ -3598,12 +3598,15 @@ deprecated due to being internals, not intended for public use.
|
||||
|
||||
<!-- YAML
|
||||
changes:
|
||||
- version: REPLACEME
|
||||
pr-url: https://github.com/nodejs/node/pull/52071
|
||||
description: Runtime deprecation.
|
||||
- version: REPLACEME
|
||||
pr-url: https://github.com/nodejs/node/pull/51881
|
||||
description: Documentation-only deprecation.
|
||||
-->
|
||||
|
||||
Type: Documentation-only
|
||||
Type: Runtime
|
||||
|
||||
Calling `Hmac` class directly with `Hmac()` or `new Hmac()` is
|
||||
deprecated due to being internals, not intended for public use.
|
||||
|
@ -232,7 +232,7 @@ module.exports = {
|
||||
DiffieHellmanGroup,
|
||||
ECDH,
|
||||
Hash: deprecate(Hash, 'crypto.Hash constructor is deprecated.', 'DEP0179'),
|
||||
Hmac,
|
||||
Hmac: deprecate(Hmac, 'crypto.Hmac constructor is deprecated.', 'DEP0181'),
|
||||
KeyObject,
|
||||
Sign,
|
||||
Verify,
|
||||
|
@ -459,3 +459,13 @@ assert.strictEqual(
|
||||
crypto.createHmac('sha256', keyObject).update('foo').digest(),
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
crypto.Hmac('sha256', 'Node');
|
||||
common.expectWarning({
|
||||
DeprecationWarning: [
|
||||
['crypto.Hmac constructor is deprecated.',
|
||||
'DEP0181'],
|
||||
]
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user