@@ -61,7 +61,7 @@ function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) {
61
61
else if ( typeof generator !== 'number' )
62
62
generator = toBuf ( generator , genEncoding ) ;
63
63
64
- legacyNativeHandle ( this , new _DiffieHellman ( sizeOrKey , generator ) ) ;
64
+ this [ kHandle ] = new _DiffieHellman ( sizeOrKey , generator ) ;
65
65
Object . defineProperty ( this , 'verifyError' , {
66
66
enumerable : true ,
67
67
value : this [ kHandle ] . verifyError ,
@@ -73,7 +73,7 @@ function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) {
73
73
function DiffieHellmanGroup ( name ) {
74
74
if ( ! ( this instanceof DiffieHellmanGroup ) )
75
75
return new DiffieHellmanGroup ( name ) ;
76
- legacyNativeHandle ( this , new _DiffieHellmanGroup ( name ) ) ;
76
+ this [ kHandle ] = new _DiffieHellmanGroup ( name ) ;
77
77
Object . defineProperty ( this , 'verifyError' , {
78
78
enumerable : true ,
79
79
value : this [ kHandle ] . verifyError ,
@@ -165,13 +165,16 @@ DiffieHellman.prototype.setPrivateKey = function setPrivateKey(key, encoding) {
165
165
return this ;
166
166
} ;
167
167
168
+ legacyNativeHandle ( DiffieHellman ) ;
169
+ legacyNativeHandle ( DiffieHellmanGroup ) ;
170
+
168
171
169
172
function ECDH ( curve ) {
170
173
if ( ! ( this instanceof ECDH ) )
171
174
return new ECDH ( curve ) ;
172
175
173
176
validateString ( curve , 'curve' ) ;
174
- legacyNativeHandle ( this , new _ECDH ( curve ) ) ;
177
+ this [ kHandle ] = new _ECDH ( curve ) ;
175
178
}
176
179
177
180
ECDH . prototype . computeSecret = DiffieHellman . prototype . computeSecret ;
@@ -192,6 +195,8 @@ ECDH.prototype.getPublicKey = function getPublicKey(encoding, format) {
192
195
return encode ( key , encoding ) ;
193
196
} ;
194
197
198
+ legacyNativeHandle ( ECDH ) ;
199
+
195
200
ECDH . convertKey = function convertKey ( key , curve , inEnc , outEnc , format ) {
196
201
if ( typeof key !== 'string' && ! isArrayBufferView ( key ) ) {
197
202
throw new ERR_INVALID_ARG_TYPE (
0 commit comments