fix: crash in ECDH.setPrivateKey (#17219)

This commit is contained in:
Jeremy Apthorp 2019-03-08 10:50:04 -08:00 committed by GitHub
parent 5afb7dc715
commit 34fb6c2f35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 0 deletions

View file

@ -487,6 +487,13 @@ describe('node feature', () => {
expect(dh.getPrime()).to.be.an.instanceof(Buffer)
expect(dh.getGenerator()).to.be.an.instanceof(Buffer)
})
it('should not crash when creating an ECDH cipher', () => {
const crypto = require('crypto')
const dh = crypto.createECDH('prime256v1')
dh.generateKeys()
dh.setPrivateKey(dh.getPrivateKey())
})
})
it('includes the electron version in process.versions', () => {