fix: crash in crypto.createDiffieHellman (#27674)
This commit is contained in:
parent
87064e5b5e
commit
9063e84b7c
2 changed files with 45 additions and 27 deletions
|
@ -303,6 +303,20 @@ describe('node feature', () => {
|
|||
expect(cipherText).to.equal(result);
|
||||
}
|
||||
});
|
||||
|
||||
it('does not crash when using crypto.diffieHellman() constructors', () => {
|
||||
const crypto = require('crypto');
|
||||
|
||||
crypto.createDiffieHellman('abc');
|
||||
crypto.createDiffieHellman('abc', 2);
|
||||
|
||||
// Needed to test specific DiffieHellman ctors.
|
||||
|
||||
// eslint-disable-next-line no-octal
|
||||
crypto.createDiffieHellman('abc', Buffer.from([02]));
|
||||
// eslint-disable-next-line no-octal
|
||||
crypto.createDiffieHellman('abc', '123');
|
||||
});
|
||||
});
|
||||
|
||||
describe('process.stdout', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue