def build_eapol_key_1_2(kck, key_data, replay_counter=3, key_info=0x1382, extra_len=0, descr_type=2, key_len=16): msg = {} msg['version'] = 2 msg['type'] = 3 msg['length'] = 95 + len(key_data) + extra_len msg['descr_type'] = descr_type msg['rsn_key_info'] = key_info msg['rsn_key_len'] = key_len msg['rsn_replay_counter'] = struct.pack('>Q', replay_counter) msg['rsn_key_nonce'] = binascii.unhexlify( '0000000000000000000000000000000000000000000000000000000000000000') msg['rsn_key_iv'] = binascii.unhexlify('00000000000000000000000000000000') msg['rsn_key_rsc'] = binascii.unhexlify('0000000000000000') msg['rsn_key_id'] = binascii.unhexlify('0000000000000000') msg['rsn_key_data_len'] = len(key_data) msg['rsn_key_data'] = key_data eapol_key_mic(kck, msg) return msg
def build_eapol_key_1_2(kck, key_data, replay_counter=3, key_info=0x1382, extra_len=0, descr_type=2, key_len=16): msg = {} msg['version'] = 2 msg['type'] = 3 msg['length'] = 95 + len(key_data) + extra_len msg['descr_type'] = descr_type msg['rsn_key_info'] = key_info msg['rsn_key_len'] = key_len msg['rsn_replay_counter'] = struct.pack('>Q', replay_counter) msg['rsn_key_nonce'] = binascii.unhexlify('0000000000000000000000000000000000000000000000000000000000000000') msg['rsn_key_iv'] = binascii.unhexlify('00000000000000000000000000000000') msg['rsn_key_rsc'] = binascii.unhexlify('0000000000000000') msg['rsn_key_id'] = binascii.unhexlify('0000000000000000') msg['rsn_key_data_len'] = len(key_data) msg['rsn_key_data'] = key_data eapol_key_mic(kck, msg) return msg