mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: crash in crypto.createDiffieHellman (#27674)
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user