_readMac.update(buffer.buffer, 0, buffer.index);
_readMac.doFinal(_clientMacDigest, 0);
getByte(_serverMacDigest, 0, _serverMacDigest.length); // Read server sent MAC
if( !Arrays.equals(_clientMacDigest, _serverMacDigest) ) {
if( remaining > Packet.MAX_SIZE ) {
throw new MACException("Inbound packet is corrupt: MAC verification failed");
}
startDiscard(buffer, packetLen, Packet.MAX_SIZE - remaining, "MAC verification failed", SSH_DISCONNECT_MAC_ERROR);
}
}