_session.write(kexPacket); // Send key exchange init message to server
JSch.getLogger().log(Logger.Level.INFO, "SSH_MSG_KEXINIT sent");
} catch(Exception e) {
throw new KexException("Failed to send SSH_MSG_KEXINIT", e);
} finally {
kexBuffer.clear(); // Clear buffer to ensure sensitive data is wiped
}
}
/**
* <p>Receives the server's key exchange KEXINIT from the specified