'Test that the KEX_DH_GEX_REQUEST message causes the server to reply
with a KEX_DH_GEX_GROUP message with the correct Diffie-Hellman
group.'

def test_KEX_DH_GEX_REQUEST(self):

    self.proto.supportedKeyExchanges = [self.kexAlgorithm]
    self.proto.supportedPublicKeys = ['ssh-rsa']
    self.proto.dataReceived(self.transport.value())
    self.proto.ssh_KEX_DH_GEX_REQUEST(('\x00\x00\x04\x00\x00\x00\x08\x00' + '\x00\x00\x0c\x00'))
    (dhGenerator, dhPrime) = self.proto.factory.getPrimes().get(2048)[0]
    self.assertEqual(self.packets, [(transport.MSG_KEX_DH_GEX_GROUP, (common.MP(dhPrime) + '\x00\x00\x00\x01\x03'))])
    self.assertEqual(self.proto.g, 3)
    self.assertEqual(self.proto.p, dhPrime)
