@@ -61,7 +61,7 @@ function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) {
6161 else if ( typeof generator !== 'number' )
6262 generator = toBuf ( generator , genEncoding ) ;
6363
64- legacyNativeHandle ( this , new _DiffieHellman ( sizeOrKey , generator ) ) ;
64+ this [ kHandle ] = new _DiffieHellman ( sizeOrKey , generator ) ;
6565 Object . defineProperty ( this , 'verifyError' , {
6666 enumerable : true ,
6767 value : this [ kHandle ] . verifyError ,
@@ -73,7 +73,7 @@ function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) {
7373function DiffieHellmanGroup ( name ) {
7474 if ( ! ( this instanceof DiffieHellmanGroup ) )
7575 return new DiffieHellmanGroup ( name ) ;
76- legacyNativeHandle ( this , new _DiffieHellmanGroup ( name ) ) ;
76+ this [ kHandle ] = new _DiffieHellmanGroup ( name ) ;
7777 Object . defineProperty ( this , 'verifyError' , {
7878 enumerable : true ,
7979 value : this [ kHandle ] . verifyError ,
@@ -165,13 +165,16 @@ DiffieHellman.prototype.setPrivateKey = function setPrivateKey(key, encoding) {
165165 return this ;
166166} ;
167167
168+ legacyNativeHandle ( DiffieHellman ) ;
169+ legacyNativeHandle ( DiffieHellmanGroup ) ;
170+
168171
169172function ECDH ( curve ) {
170173 if ( ! ( this instanceof ECDH ) )
171174 return new ECDH ( curve ) ;
172175
173176 validateString ( curve , 'curve' ) ;
174- legacyNativeHandle ( this , new _ECDH ( curve ) ) ;
177+ this [ kHandle ] = new _ECDH ( curve ) ;
175178}
176179
177180ECDH . prototype . computeSecret = DiffieHellman . prototype . computeSecret ;
@@ -192,6 +195,8 @@ ECDH.prototype.getPublicKey = function getPublicKey(encoding, format) {
192195 return encode ( key , encoding ) ;
193196} ;
194197
198+ legacyNativeHandle ( ECDH ) ;
199+
195200ECDH . convertKey = function convertKey ( key , curve , inEnc , outEnc , format ) {
196201 if ( typeof key !== 'string' && ! isArrayBufferView ( key ) ) {
197202 throw new ERR_INVALID_ARG_TYPE (
0 commit comments