|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
Go to the source code of this file.
Classes | |
| struct | _DOT11DECRYPT_MAC_FRAME |
| IEEE 802.11 MAC frame header without Address 4 field. More... | |
| struct | _DOT11DECRYPT_MAC_FRAME_ADDR4 |
| IEEE 802.11 MAC frame header with Address 4 field (WDS / mesh, both To DS and From DS set). More... | |
| struct | _DOT11DECRYPT_MAC_FRAME_QOS |
| IEEE 802.11 MAC frame header without Address 4 field, with QoS Control field (QoS data frames). More... | |
| struct | _DOT11DECRYPT_MAC_FRAME_ADDR4_QOS |
| IEEE 802.11 MAC frame header with both Address 4 and QoS Control fields (WDS QoS data frames). More... | |
Macros | |
| #define | DOT11DECRYPT_TYPE_MANAGEMENT 0 |
| #define | DOT11DECRYPT_TYPE_CONTROL 1 |
| #define | DOT11DECRYPT_TYPE_DATA 2 |
| #define | DOT11DECRYPT_SUBTYPE_ASSOC_REQ 0 |
| #define | DOT11DECRYPT_SUBTYPE_ASSOC_RESP 1 |
| #define | DOT11DECRYPT_SUBTYPE_REASSOC_REQ 2 |
| #define | DOT11DECRYPT_SUBTYPE_REASSOC_RESP 3 |
| #define | DOT11DECRYPT_SUBTYPE_PROBE_REQ 4 |
| #define | DOT11DECRYPT_SUBTYPE_PROBE_RESP 5 |
| #define | DOT11DECRYPT_SUBTYPE_MEASUREMENT_PILOT 6 |
| #define | DOT11DECRYPT_SUBTYPE_BEACON 8 |
| #define | DOT11DECRYPT_SUBTYPE_ATIM 9 |
| #define | DOT11DECRYPT_SUBTYPE_DISASS 10 |
| #define | DOT11DECRYPT_SUBTYPE_AUTHENTICATION 11 |
| #define | DOT11DECRYPT_SUBTYPE_DEAUTHENTICATION 12 |
| #define | DOT11DECRYPT_SUBTYPE_ACTION 13 |
| #define | DOT11DECRYPT_SUBTYPE_ACTION_NO_ACK 14 |
| #define | DOT11DECRYPT_CIPHER_USE_GROUP 0 |
| #define | DOT11DECRYPT_CIPHER_WEP40 1 |
| #define | DOT11DECRYPT_CIPHER_TKIP 2 |
| #define | DOT11DECRYPT_CIPHER_CCMP 4 |
| #define | DOT11DECRYPT_CIPHER_WEP104 5 |
| #define | DOT11DECRYPT_CIPHER_BIP_CMAC 6 |
| #define | DOT11DECRYPT_CIPHER_GROUP_NA 7 |
| #define | DOT11DECRYPT_CIPHER_GCMP 8 |
| #define | DOT11DECRYPT_CIPHER_GCMP256 9 |
| #define | DOT11DECRYPT_CIPHER_CCMP256 10 |
| #define | DOT11DECRYPT_CIPHER_BIP_GMAC 11 |
| #define | DOT11DECRYPT_CIPHER_BIP_GMAC256 12 |
| #define | DOT11DECRYPT_CIPHER_BIP_CMAC256 13 |
| #define | DOT11DECRYPT_CRYPTED_DATA_MINLEN 9 |
| #define | DOT11DECRYPT_TA_OFFSET 10 |
| #define | DOT11DECRYPT_TYPE(FrameControl_0) (uint8_t)((FrameControl_0 >> 2) & 0x3) |
| #define | DOT11DECRYPT_SUBTYPE(FrameControl_0) (uint8_t)((FrameControl_0 >> 4) & 0xF) |
| #define | DOT11DECRYPT_DS_BITS(FrameControl_1) (uint8_t)(FrameControl_1 & 0x3) |
| #define | DOT11DECRYPT_TO_DS(FrameControl_1) (uint8_t)(FrameControl_1 & 0x1) |
| #define | DOT11DECRYPT_FROM_DS(FrameControl_1) (uint8_t)((FrameControl_1 >> 1) & 0x1) |
| #define | DOT11DECRYPT_WEP(FrameControl_1) (uint8_t)((FrameControl_1 >> 6) & 0x1) |
| #define | DOT11DECRYPT_EXTIV(KeyID) ((KeyID >> 5) & 0x1) |
| #define | DOT11DECRYPT_KEY_INDEX(KeyID) ((KeyID >> 6) & 0x3) /** Used to determine TKIP group key from unicast (group = 1, unicast = 0) */ |
| #define | DOT11DECRYPT_EAP_KEY_DESCR_VER(KeyInfo_1) ((unsigned char)(KeyInfo_1 & 0x3)) |
| #define | DOT11DECRYPT_EAP_KEY(KeyInfo_1) ((KeyInfo_1 >> 3) & 0x1) |
| #define | DOT11DECRYPT_EAP_INST(KeyInfo_1) ((KeyInfo_1 >> 6) & 0x1) |
| #define | DOT11DECRYPT_EAP_ACK(KeyInfo_1) ((KeyInfo_1 >> 7) & 0x1) |
| #define | DOT11DECRYPT_EAP_MIC(KeyInfo_0) (KeyInfo_0 & 0x1) |
| #define | DOT11DECRYPT_EAP_SEC(KeyInfo_0) ((KeyInfo_0 >> 1) & 0x1) |
| #define | DOT11DECRYPT_FC1_DIR_MASK 0x03 |
| #define | IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */ |
| #define | IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */ |
| #define | IEEE80211_FC1_DIR_FROMDS 0x02 /* AP ->STA */ |
| #define | DOT11DECRYPT_FC1_DIR_DSTODS 0x03 /* AP ->AP */ |
| #define | DOT11DECRYPT_FC0_SUBTYPE_QOS 0x80 |
| #define | DOT11DECRYPT_FC0_TYPE_DATA 0x08 |
| #define | DOT11DECRYPT_FC0_TYPE_MASK 0x0c |
| #define | DOT11DECRYPT_SEQ_FRAG_MASK 0x000f |
| #define | DOT11DECRYPT_QOS_HAS_SEQ(wh) |
| #define | DOT11DECRYPT_ADDR_COPY(dst, src) memcpy(dst, src, DOT11DECRYPT_MAC_LEN) |
| #define | DOT11DECRYPT_IS_4ADDRESS(wh) ((wh->fc[1] & DOT11DECRYPT_FC1_DIR_MASK) == DOT11DECRYPT_FC1_DIR_DSTODS) |
| #define | DOT11DECRYPT_IS_QOS_DATA(wh) DOT11DECRYPT_QOS_HAS_SEQ(wh) |
Typedefs | |
| typedef struct _DOT11DECRYPT_MAC_FRAME | DOT11DECRYPT_MAC_FRAME |
| IEEE 802.11 MAC frame header without Address 4 field. | |
| typedef struct _DOT11DECRYPT_MAC_FRAME * | PDOT11DECRYPT_MAC_FRAME |
| typedef struct _DOT11DECRYPT_MAC_FRAME_ADDR4 | DOT11DECRYPT_MAC_FRAME_ADDR4 |
| IEEE 802.11 MAC frame header with Address 4 field (WDS / mesh, both To DS and From DS set). | |
| typedef struct _DOT11DECRYPT_MAC_FRAME_ADDR4 * | PDOT11DECRYPT_MAC_FRAME_ADDR4 |
| typedef struct _DOT11DECRYPT_MAC_FRAME_QOS | DOT11DECRYPT_MAC_FRAME_QOS |
| IEEE 802.11 MAC frame header without Address 4 field, with QoS Control field (QoS data frames). | |
| typedef struct _DOT11DECRYPT_MAC_FRAME_QOS * | PDOT11DECRYPT_MAC_FRAME_QOS |
| typedef struct _DOT11DECRYPT_MAC_FRAME_ADDR4_QOS | DOT11DECRYPT_MAC_FRAME_ADDR4_QOS |
| IEEE 802.11 MAC frame header with both Address 4 and QoS Control fields (WDS QoS data frames). | |
| typedef struct _DOT11DECRYPT_MAC_FRAME_ADDR4_QOS * | PDOT11DECRYPT_MAC_FRAME_ADDR4_QOS |
Functions | |
| int | Dot11DecryptCcmpDecrypt (uint8_t *m, int mac_header_len, int len, uint8_t *TK1, int tk_len, int mic_len, const uint8_t *ap_mld_mac, const uint8_t *sta_mld_mac) |
| Decrypt CCMP encrypted MPDU. | |
| int | Dot11DecryptGcmpDecrypt (uint8_t *m, int mac_header_len, int len, uint8_t *TK1, int tk_len, const uint8_t *ap_mld_mac, const uint8_t *sta_mld_mac) |
| Decrypt GCMP encrypted MPDU. | |
| int | Dot11DecryptTkipDecrypt (uint8_t *mpdu, size_t mac_header_len, size_t mpdu_len, unsigned char TK[16]) |
| Decrypt TKIP encrypted MPDU. | |
| WS_DLL_PUBLIC int | Dot11DecryptWepDecrypt (const unsigned char *seed, size_t seed_len, unsigned char *cypher_text, size_t data_len) |
| Decrypt WEP-encrypted 802.11 payload using RC4 stream cipher. | |
Copyright (c) 2006 CACE Technologies, Davis (California) All rights reserved.
SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
| #define DOT11DECRYPT_EXTIV | ( | KeyID | ) | ((KeyID >> 5) & 0x1) |
Get the Key ID from the Initialization Vector (last byte)
| #define DOT11DECRYPT_QOS_HAS_SEQ | ( | wh | ) |
| #define DOT11DECRYPT_TYPE | ( | FrameControl_0 | ) | (uint8_t)((FrameControl_0 >> 2) & 0x3) |
Macros to get various bits of a 802.11 control frame
| int Dot11DecryptCcmpDecrypt | ( | uint8_t * | m, |
| int | mac_header_len, | ||
| int | len, | ||
| uint8_t * | TK1, | ||
| int | tk_len, | ||
| int | mic_len, | ||
| const uint8_t * | ap_mld_mac, | ||
| const uint8_t * | sta_mld_mac | ||
| ) |
Decrypt CCMP encrypted MPDU.
| m | Pointer to the MPDU to decrypt (in-place). |
| mac_header_len | Length of the MAC header in bytes. |
| len | Total length of the MPDU in bytes. |
| TK1 | Pointer to the Temporal Key (TK) used for decryption. |
| tk_len | Length of the Temporal Key in bytes. |
| mic_len | Length of the Message Integrity Code (MIC) in bytes. |
| ap_mld_mac | Pointer to the AP's MAC address (for MLD). |
| sta_mld_mac | Pointer to the station's MAC address (for MLD). |
| int Dot11DecryptGcmpDecrypt | ( | uint8_t * | m, |
| int | mac_header_len, | ||
| int | len, | ||
| uint8_t * | TK1, | ||
| int | tk_len, | ||
| const uint8_t * | ap_mld_mac, | ||
| const uint8_t * | sta_mld_mac | ||
| ) |
Decrypt GCMP encrypted MPDU.
| m | Pointer to the MPDU to decrypt (in-place). |
| mac_header_len | Length of the MAC header in bytes. |
| len | Total length of the MPDU in bytes. |
| TK1 | Pointer to the Temporal Key (TK) used for decryption. |
| tk_len | Length of the Temporal Key in bytes. |
| ap_mld_mac | Pointer to the AP's MAC address (for MLD). |
| sta_mld_mac | Pointer to the station's MAC address (for MLD). |
| int Dot11DecryptTkipDecrypt | ( | uint8_t * | mpdu, |
| size_t | mac_header_len, | ||
| size_t | mpdu_len, | ||
| unsigned char | TK[16] | ||
| ) |
Decrypt TKIP encrypted MPDU.
| mpdu | Pointer to the MPDU to decrypt (in-place). |
| mac_header_len | Length of the MAC header in bytes. |
| mpdu_len | Total length of the MPDU in bytes. |
| TK | Pointer to the Temporal Key (TK) used for decryption. |
| WS_DLL_PUBLIC int Dot11DecryptWepDecrypt | ( | const unsigned char * | seed, |
| size_t | seed_len, | ||
| unsigned char * | cypher_text, | ||
| size_t | data_len | ||
| ) |
Decrypt WEP-encrypted 802.11 payload using RC4 stream cipher.
Performs WEP decryption on the provided cypher_text buffer using the RC4 algorithm seeded with the specified initialization vector and WEP key. The decryption is done in-place, modifying cypher_text directly.
This function assumes the input data is WEP-encrypted and that the seed contains both the IV and the shared WEP key. It verifies the ICV assumed to follow right after the cypher_text.
| seed | Pointer to the RC4 seed (IV + WEP key). |
| seed_len | Length of the seed in bytes. |
| cypher_text | Pointer to the encrypted data buffer (will be decrypted in-place). |
| data_len | Length of the encrypted data in bytes. |