57 #define WEP_MAX_KEY 16 60 #define WEP_HEADER_LEN 4 63 #define WEP_TRAILER_LEN 4 66 #define WEP_OVERHEAD 8 202 DBGC ( crypto,
"WEP %p CRC mismatch: expect %08x, get %08x\n",
216 .priv_len =
sizeof (
struct wep_ctx ),
243 DBGC ( dev,
"802.11 %p cannot do WEP without a key\n", dev );
249 if (
len != 5 &&
len != 13 &&
len != 16 ) {
250 DBGC ( dev,
"802.11 %p invalid WEP key length %d\n",
255 DBGC ( dev,
"802.11 %p installing %d-bit WEP\n", dev,
len * 8 );
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
enum net80211_crypto_alg crypto
Cryptographic algorithm used on the network.
#define iob_put(iobuf, len)
struct golan_inbox_hdr hdr
Message header.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
#define WEP_MAX_KEY
Maximum length of WEP key.
An 802.11 data or management frame without QoS or WDS header fields.
FILE_LICENCE(GPL2_OR_LATER)
#define WEP_IV_LEN
Length of WEP initialisation vector.
int fetch_raw_setting(struct settings *settings, const struct setting *setting, void *data, size_t len)
Fetch value of setting.
#define EACCES
Permission denied.
struct golan_eq_context ctx
Network protected with WEP (awful RC4-based system)
int(* init)(struct net80211_crypto *crypto, const void *key, int keylen, const void *rsc)
Initialize cryptosystem using a given key.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
u8 iv[16]
Initialization vector.
Definitions for general secured-network routines.
u32 crc32_le(u32 seed, const void *data, size_t len)
Calculate 32-bit little-endian CRC checksum.
#define cipher_encrypt(cipher, ctx, src, dst, len)
#define WEP_HEADER_LEN
Amount of data placed before the encrypted bytes.
enum net80211_crypto_alg algorithm
The cryptographic algorithm implemented.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
struct net80211_crypto * crypto
802.11 cryptosystem for our current network
u8 key[WEP_IV_LEN+WEP_MAX_KEY]
Encoded WEP key.
#define IEEE80211_TYP_FRAME_HEADER_LEN
Frame header length for frames we might work with.
#define __unused
Declare a variable or data structure as unused.
#define WEP_OVERHEAD
Total WEP overhead bytes.
u8 rsc[8]
Receive sequence counter for GTK.
enum net80211_security_proto protocol
The security handshaking protocol implemented.
u16 datalen
Length of the data field in bytes, network byte order.
int sec80211_install(struct net80211_crypto **which, enum net80211_crypto_alg crypt, const void *key, int len, const void *rsc)
Install 802.11 cryptosystem.
#define IEEE80211_FC_PROTECTED
802.11 Frame Control field: Protected flag
Context for WEP encryption and decryption.
The iPXE 802.11 MAC layer.
int keylen
Length of WEP key (not including IV bytes)
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
Structure encapsulating the complete state of an 802.11 device.
No security, an "Open" network.
long int random(void)
Generate a pseudo-random number between 0 and 2147483647L or 2147483562?
static struct io_buffer * wep_decrypt(struct net80211_crypto *crypto, struct io_buffer *eiob)
Decrypt packet using WEP.
#define cipher_decrypt(cipher, ctx, src, dst, len)
struct net80211_wlan * associating
Network with which we are associating.
Interface to an 802.11 security handshaking protocol.
void * priv
Private data for the algorithm to store key and state info.
static int wep_init(struct net80211_crypto *crypto, const void *key, int keylen, const void *rsc __unused)
Initialize WEP algorithm.
static int trivial_init(struct net80211_device *dev)
Initialize trivial 802.11 security handshaker.
struct cipher_algorithm arc4_algorithm
struct net_device * netdev
The net_device that wraps us.
struct net80211_handshaker trivial_handshaker __net80211_handshaker
Trivial 802.11 security handshaker.
#define WEP_ICV_LEN
Length of WEP ICV checksum.
void * data
Start of data.
static struct io_buffer * wep_encrypt(struct net80211_crypto *crypto, struct io_buffer *iob)
Encrypt packet using WEP.
struct net80211_crypto wep_crypto __net80211_crypto
WEP cryptosystem for 802.11.
static int trivial_change_key(struct net80211_device *dev)
Check for key change on trivial 802.11 security handshaker.
Interface to an 802.11 cryptosystem.
struct arc4_ctx arc4
ARC4 context.
#define NULL
NULL pointer (VOID *)
static int cipher_setkey(struct cipher_algorithm *cipher, void *ctx, const void *key, size_t keylen)