Qustion about hostap_ccmp_encrypt and decrypt functions

hareesh.khattri at ndsu.edu hareesh.khattri at ndsu.edu
Thu Jun 2 16:41:12 EDT 2005


I am studying the hostap_crypt_ccmp.c code.I want to ask about the the
hostap_ccmp_encrypt and decrypt functions.


static int hostap_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)

This function functions takes an sk_buff that has first hdr_len bytes of
it's data in hostap_ieee80211_hdr struct and the rest is the data to be
encrypted.

The priv variable is a pointer to hostap_ccmp_data struct. Where the
u8 key[CCMP_TK_LEN]; /*contains the 16 byte IV for MIC evaluation*/
u8 tx_pn[CCMP_PN_LEN]; /*contains the 6 byte PN value for counter mode*/
int key_set;/*used to detect if key is assigned*/

The function keeps the header field intact at the start of sk_buff and
encrypts the data using counter mode and appends the MIC at the end of the
sk_buff.

The decrypt function reverses the encrypt one. I want to ask if this is
the correct operation of these function??





More information about the HostAP mailing list