'Verify the passphrase given by users is corrected
:param packet: A scapy.layers.RadioTap object
:param passphrase: passphrase from phishinghttp
:type self: Handshakeverify
:type passphrase: str
:return True if verifcation is done
:rtype: bool
..note: Since scapy doesn\'t parse the EAPOL key data for us we need
to index the field by ourself. It is possible that the frame
is malformed so catch the IndexError to prevent this.'

def _verify_creds(self, passphrase):

    try:
        essid = self._data.target_ap_essid
        ap_mac = binascii.a2b_hex(''.join(self._data.target_ap_bssid.split(':')))
        ap_nonce = self._eapols[0].load[13:45]
        client_mac = binascii.a2b_hex(''.join(self._eapols[0].addr1.split(':')))
        client_nonce = self._eapols[1].load[13:45]
        const_b = (((min(ap_mac, client_mac) + max(ap_mac, client_mac)) + min(ap_nonce, client_nonce)) + max(ap_nonce, client_nonce))
        pmk = PBKDF2(passphrase, essid, 4096).read(32)
        ptk = self._prf512(pmk, constants.CONST_A, const_b)
        msg4 = self._eapols[3]
        key_version = (1 if (ord(msg4.load[2]) & 7) else 0)
        msg4_data = ((format(msg4[dot11.EAPOL].version, '02x') + format(msg4[dot11.EAPOL].type, '02x')) + format(msg4[dot11.EAPOL].len, '04x'))
        msg4_data += binascii.b2a_hex(msg4.load)[:154]
        msg4_data += ('00' * 18)
        msg4_data = binascii.a2b_hex(msg4_data)
        if key_version:
            msg4_mic_cal = hmac.new(ptk[0:16], msg4_data, hashlib.sha1).hexdigest()[:32]
        else:
            msg4_mic_cal = hmac.new(ptk[0:16], msg4_data).hexdigest()[:32]
        msg4_mic_cmp = binascii.b2a_hex(msg4.load[(-18):(-2)])
        if (msg4_mic_cmp == msg4_mic_cal):
            return DONE
        return FAIL
    except IndexError:
        return FAIL
