Compute and return the data with its MIC and ICV
(data, mic_key, source, dest)
| 366 | |
| 367 | |
| 368 | def build_MIC_ICV(data, mic_key, source, dest): |
| 369 | """Compute and return the data with its MIC and ICV""" |
| 370 | # DATA - MIC(DA - SA - Priority=0 - 0 - 0 - 0 - DATA) - ICV |
| 371 | # 802.11i p.47 |
| 372 | |
| 373 | sa = mac2str(source) # Source MAC |
| 374 | da = mac2str(dest) # Dest MAC |
| 375 | MIC = michael(mic_key, da + sa + b"\x00" + b"\x00" * 3 + data) |
| 376 | ICV = pack("<I", crc32(data + MIC) & 0xFFFFFFFF) |
| 377 | |
| 378 | return data + MIC + ICV |
no test coverage detected