def get_lm_response(self, flags, challenge):
        """
        Computes the 24 byte LMHash password hash given the 8 byte server challenge.
        :param challenge: The 8-byte challenge message generated by the server
        :return: The 24 byte LMHash
        """
        # If lm compatibility level lower than 3, but the server negotiated NTLM2, generate an
        # NTLM2 response in preference to the weaker LMv1
        if flags & NegotiateFlag.NTLMSSP_NTLM2_KEY and self._lm_compatibility < 3:
            response, key = self._client_challenge + b'\0' * 16, None

        elif 0 <= self._lm_compatibility <= 1:
            response, key = PasswordAuthentication._get_lm_response(self._password, challenge)
        elif self._lm_compatibility == 2:
            response, key = PasswordAuthentication.get_ntlmv1_response(self._password, challenge)
        else:
            response, key = PasswordAuthentication.get_lmv2_response(self._domain, self._username, self._password,
                                                                     challenge, self._client_challenge)
        return response, key