Page MenuHomeFreeBSD

iwx: migrate to new net80211 encryption key API
Needs ReviewPublic

Authored by adrian on Fri, Jan 2, 11:43 PM.
Referenced Files
Unknown Object (File)
Sat, Jan 10, 2:06 PM
Unknown Object (File)
Thu, Jan 8, 4:36 AM
Unknown Object (File)
Tue, Jan 6, 8:10 AM
Unknown Object (File)
Sun, Jan 4, 11:05 PM
Unknown Object (File)
Sun, Jan 4, 10:32 PM
Unknown Object (File)
Sat, Jan 3, 2:10 PM
Subscribers

Details

Reviewers
None
Group Reviewers
wireless
Summary

Migrate to the new encryption key API rather than poking at the
key struct directly.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69576
Build 66459: arc lint + arc unit

Event Timeline

bz added inline comments.
sys/dev/iwx/if_iwx.c
11133
const uint8_t *wk_key:
uint16_t wk_keylen;

wk_key = ieee80211_crypto_get_key_data(k);
wk_keylen = ieee80211_crypto_get_key_len(k);

memcpy(cmd.common.key, wk_key, MIN(sizeof(cmd.common.key), wk_keylen));
IWX_DPRINTF(sc, IWX_DEBUG_KEYMGMT, "%s: key: id=%d, len=%i, key=%*D\n",
    __func__, id, wk_keylen, wk_keylen, wk_key, "");

Looks a lot more readable in the long run and fits into 80 char wide lines.

Though it still doesn't ensure that the actual key_data does not change from under you for as long as the key_update_begin/end are dummy functions; the pointer will stay fine.