'This represents different key exchange methods that share the same
integer value.  If the message is determined to be a KEXDH_INIT,
L{_ssh_KEXDH_INIT} is called to handle it. If it is a KEX_ECDH_INIT,
L{_ssh_KEX_ECDH_INIT} is called.
Otherwise, for KEX_DH_GEX_REQUEST_OLD payload::
integer ideal (ideal size for the Diffie-Hellman prime)
We send the KEX_DH_GEX_GROUP message with the group that is
closest in size to ideal.
If we were told to ignore the next key exchange packet by ssh_KEXINIT,
drop it on the floor and return.
@type packet: L{bytes}
@param packet: The message data.'

def ssh_KEX_DH_GEX_REQUEST_OLD(self, packet):

    if self.ignoreNextPacket:
        self.ignoreNextPacket = 0
        return
    if _kex.isFixedGroup(self.kexAlg):
        return self._ssh_KEXDH_INIT(packet)
    elif _kex.isEllipticCurve(self.kexAlg):
        return self._ssh_KEX_ECDH_INIT(packet)
    else:
        self.dhGexRequest = packet
        ideal = struct.unpack('>L', packet)[0]
        (self.g, self.p) = self.factory.getDHPrime(ideal)
        self.sendPacket(MSG_KEX_DH_GEX_GROUP, (MP(self.p) + MP(self.g)))
