Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
dot11decrypt_user.h File Reference
#include <glib.h>
#include "ws_symbol_export.h"

Go to the source code of this file.

Classes

struct  decryption_key_t
 
struct  _DOT11DECRYPT_KEY_ITEM
 
union  _DOT11DECRYPT_KEY_ITEM::DOT11DECRYPT_KEY_ITEMDATA
 
struct  _DOT11DECRYPT_KEY_ITEM::DOT11DECRYPT_KEY_ITEMDATA::DOT11DECRYPT_KEY_ITEMDATA_WEP
 
struct  _DOT11DECRYPT_KEY_ITEM::DOT11DECRYPT_KEY_ITEMDATA::DOT11DECRYPT_KEY_ITEMDATA_WPA
 
struct  _DOT11DECRYPT_KEY_ITEM::DOT11DECRYPT_KEY_ITEMDATA_TK
 
struct  _DOT11DECRYPT_KEY_ITEM::DOT11DECRYPT_KEY_ITEMDATA_MSK
 
struct  _DOT11DECRYPT_KEY_ITEM::DOT11DECRYPT_KEY_ITEMDATA_PWD
 
struct  _DOT11DECRYPT_KEYS_COLLECTION
 

Macros

#define DOT11DECRYPT_KEY_TYPE_WEP   0
 
#define DOT11DECRYPT_KEY_TYPE_WEP_40   1
 
#define DOT11DECRYPT_KEY_TYPE_WEP_104   2
 
#define DOT11DECRYPT_KEY_TYPE_WPA_PWD   3
 
#define DOT11DECRYPT_KEY_TYPE_WPA_PSK   4
 
#define DOT11DECRYPT_KEY_TYPE_WPA_PMK   5
 
#define DOT11DECRYPT_KEY_TYPE_TK   6
 
#define DOT11DECRYPT_KEY_TYPE_MSK   7
 
#define DOT11DECRYPT_KEY_TYPE_TKIP   100
 
#define DOT11DECRYPT_KEY_TYPE_CCMP   101
 
#define DOT11DECRYPT_KEY_TYPE_CCMP_256   102
 
#define DOT11DECRYPT_KEY_TYPE_GCMP   103
 
#define DOT11DECRYPT_KEY_TYPE_GCMP_256   104
 
#define DOT11DECRYPT_KEY_TYPE_UNKNOWN   -1
 
#define DOT11DECRYPT_WEP_KEY_MINLEN   1
 
#define DOT11DECRYPT_WEP_KEY_MAXLEN   32
 
#define DOT11DECRYPT_WEP_40_KEY_LEN   5
 
#define DOT11DECRYPT_WEP_104_KEY_LEN   13
 
#define DOT11DECRYPT_WPA_PASSPHRASE_MIN_LEN   8
 
#define DOT11DECRYPT_WPA_PASSPHRASE_MAX_LEN   63 /* null-terminated string, the actual length of the storage is 64 */
 
#define DOT11DECRYPT_WPA_SSID_MIN_LEN   0
 
#define DOT11DECRYPT_WPA_SSID_MAX_LEN   32
 
#define DOT11DECRYPT_WPA_PMK_MAX_LEN   48
 
#define DOT11DECRYPT_WPA_PWD_PSK_LEN   32
 
#define DOT11DECRYPT_TK_MAX_LEN   32
 
#define DOT11DECRYPT_MSK_MIN_LEN   64
 
#define DOT11DECRYPT_MSK_MAX_LEN   128
 

Typedefs

typedef struct _DOT11DECRYPT_KEY_ITEM DOT11DECRYPT_KEY_ITEM
 
typedef struct _DOT11DECRYPT_KEY_ITEMPDOT11DECRYPT_KEY_ITEM
 
typedef struct _DOT11DECRYPT_KEYS_COLLECTION DOT11DECRYPT_KEYS_COLLECTION
 
typedef struct _DOT11DECRYPT_KEYS_COLLECTIONPDOT11DECRYPT_KEYS_COLLECTION
 

Functions

WS_DLL_PUBLIC decryption_key_tparse_key_string (char *key_string, uint8_t key_type, char **error)
 
WS_DLL_PUBLIC void free_key_string (decryption_key_t *dk)
 

Detailed Description

Copyright (c) 2006 CACE Technologies, Davis (California) All rights reserved.

SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)

Typedef Documentation

◆ DOT11DECRYPT_KEY_ITEM

Key item used during the decryption process.

◆ DOT11DECRYPT_KEYS_COLLECTION

Collection of keys to use to decrypt packets

Function Documentation

◆ free_key_string()

WS_DLL_PUBLIC void free_key_string ( decryption_key_t dk)

Releases memory associated with a given decryption_key_t struct.

Parameters
dk[IN] Pointer to the key to be freed
See also
parse_key_string()

◆ parse_key_string()

WS_DLL_PUBLIC decryption_key_t * parse_key_string ( char *  key_string,
uint8_t  key_type,
char **  error 
)

Returns the decryption_key_t struct given a string describing the key.

Parameters
key_string[IN] Key string in one of the following formats:
  • 0102030405 (40/64-bit WEP)
  • 01:02:03:04:05 (40/64-bit WEP)
  • 0102030405060708090a0b0c0d (104/128-bit WEP)
  • 01:02:03:04:05:06:07:08:09:0a:0b:0c:0d (104/128-bit WEP)
  • MyPassword (WPA + plaintext password + "wildcard" SSID)
  • MyPassword:MySSID (WPA + plaintext password + specific SSID)
  • 01020304... (WPA + 256-bit raw key)
key_type[IN] Type of key used for string. Possibilities include:
  • DOT11DECRYPT_KEY_TYPE_WEP (40/64-bit and 104/128-bit WEP)
  • DOT11DECRYPT_KEY_TYPE_WPA_PWD (WPA + plaintext password + "wildcard" SSID or WPA + plaintext password + specific SSID)
  • DOT11DECRYPT_KEY_TYPE_WPA_PSK (WPA + 256-bit raw key)
error[OUT] If not NULL, on failure will be set to point to an error message explaining why parsing failed. Must be freed.
Returns
A pointer to a freshly-g_malloc()ed decryption_key_t struct on success, or NULL on failure.
See also
free_key_string()