'Test that KEX_ECDH_REPLY disconnects if the signature is bad.'

def test_disconnectKEX_ECDH_REPLYBadSignature(self):

    kexmsg = ((((((((((((('\xaa' * 16) + common.NS('ecdh-sha2-nistp256')) + common.NS('ssh-rsa')) + common.NS('aes256-ctr')) + common.NS('aes256-ctr')) + common.NS('hmac-sha1')) + common.NS('hmac-sha1')) + common.NS('none')) + common.NS('none')) + common.NS('')) + common.NS('')) + '\x00') + '\x00\x00\x00\x00')
    self.proto.ssh_KEXINIT(kexmsg)
    self.proto.dataReceived('SSH-2.0-OpenSSH\r\n')
    self.proto.ecPriv = ec.generate_private_key(ec.SECP256R1(), default_backend())
    self.proto.ecPub = self.proto.ecPriv.public_key()
    thisPriv = ec.generate_private_key(ec.SECP256R1(), default_backend())
    thisPub = thisPriv.public_key()
    encPub = thisPub.public_numbers().encode_point()
    self.proto.curve = ec.SECP256R1()
    self.proto.kexAlg = 'ecdh-sha2-nistp256'
    self.proto._ssh_KEX_ECDH_REPLY(((common.NS(MockFactory().getPublicKeys()['ssh-rsa'].blob()) + common.NS(encPub)) + common.NS('bad-signature')))
    self.checkDisconnected(transport.DISCONNECT_KEY_EXCHANGE_FAILED)
