()
| 1548 | this.hashName = hashName; |
| 1549 | } |
| 1550 | start() { |
| 1551 | if (!this._protocol._server) { |
| 1552 | this._protocol._debug && this._protocol._debug( |
| 1553 | 'Outbound: Sending KEXDH_INIT' |
| 1554 | ); |
| 1555 | const pubKey = this.getPublicKey(); |
| 1556 | let p = this._protocol._packetRW.write.allocStartKEX; |
| 1557 | const packet = |
| 1558 | this._protocol._packetRW.write.alloc(1 + 4 + pubKey.length, true); |
| 1559 | packet[p] = MESSAGE.KEXDH_INIT; |
| 1560 | writeUInt32BE(packet, pubKey.length, ++p); |
| 1561 | packet.set(pubKey, p += 4); |
| 1562 | this._protocol._cipher.encrypt( |
| 1563 | this._protocol._packetRW.write.finalize(packet, true) |
| 1564 | ); |
| 1565 | } |
| 1566 | } |
| 1567 | generateKeys() { |
| 1568 | if (!this._dh) { |
| 1569 | this._dh = createDiffieHellmanGroup(this.groupName); |
no test coverage detected