Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bad assertion in crypto functions that use BN_bn2bin_padded #17220

Merged
merged 2 commits into from Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEPS
Expand Up @@ -12,7 +12,7 @@ vars = {
'chromium_version':
'73.0.3683.61',
'node_version':
'fac6d766c143db8db05bb3b0c0871df8f032363c',
'70a78f07b1c4d53f3da462b08cef42a4ff8f949f',

'boto_version': 'f7574aa6cc2c819430c1f05e9a1a1a666ef8169b',
'pyyaml_version': '3.12',
Expand Down
18 changes: 18 additions & 0 deletions spec/node-spec.js
Expand Up @@ -472,6 +472,24 @@ describe('node feature', () => {
const iv = Buffer.from('fedcba9876543210', 'hex')
require('crypto').createCipheriv('des-ede-cbc', key, iv)
})

it('should not crash when getting an ECDH key', () => {
const ecdh = require('crypto').createECDH('prime256v1')
expect(ecdh.getPrivateKey()).to.be.a(Buffer)
})

it('should not crash when generating DH keys', () => {
const dh = require('crypto').createDiffieHellman('modp15')
expect(dh.generateKeys()).to.be.a(Buffer)
})

it('should not crash when fetching DH parameters', () => {
const dh = require('crypto').createDiffieHellman('modp15')
expect(dh.getPrime()).to.be.a(Buffer)
expect(dh.getGenerator()).to.be.a(Buffer)
expect(dh.getPublicKey()).to.be.a(Buffer)
expect(dh.getPrivateKey()).to.be.a(Buffer)
})
})

it('includes the electron version in process.versions', () => {
Expand Down