Page MenuHomeFreeBSD

net80211: add the 802.11-2016 cipher list to the crypto array set.
Needs RevisionPublic

Authored by adrian on Mon, Apr 22, 3:39 AM.
Referenced Files
Unknown Object (File)
Wed, May 1, 6:47 PM
Unknown Object (File)
Tue, Apr 30, 8:29 PM
Unknown Object (File)
Tue, Apr 30, 10:24 AM
Unknown Object (File)
Tue, Apr 30, 9:55 AM
Unknown Object (File)
Tue, Apr 30, 9:54 AM
Unknown Object (File)
Tue, Apr 30, 12:12 AM
Unknown Object (File)
Sun, Apr 28, 4:15 AM
Unknown Object (File)
Sat, Apr 27, 4:49 AM

Details

Reviewers
cc
bz
Group Reviewers
wireless
Summary

These are the bitmap / cipher module number fields used for net80211
ciphers.

This requires a kernel recompile, but nothing (currently) in userland
is using these.

Diff Detail

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

Event Timeline

bz added inline comments.
sys/net80211/ieee80211_crypto.h
147

I love enums.

cc added inline comments.
sys/net80211/ieee80211_crypto.h
147

I love enums.

+1

167–170

In C printf, this is what I get. Also the output in Eclipse IDE console is a little different than in a Mac terminal. Is the result what we expected?

printf("%s\n", IEEE80211_CRYPTO_BITS);

quoted result:
WEPTKIPAESAES_CCMTKIPMICCKIPNONEAES_CCM_256 BIP_CMAC_128
BIP_CMAC_256 BIP_GMAC_128 BIP_CMAC_256
AES_GCM_128AES_GCM_256

sys/net80211/ieee80211_crypto.h
167–170

For use with printf(9)'s %b:

The %b identifier expects two arguments: an int and a char *.  These are
used as a register value and a print mask for decoding bitmasks.  The
print mask is made up of two parts: the base and the arguments.  The base
value is the output base (radix) expressed as an octal value; for
example, \10 gives octal and \20 gives hexadecimal.  The arguments are
made up of a sequence of bit identifiers.  Each bit identifier begins
with an octal value which is the number of the bit (starting from 1) this
identifier describes.  The rest of the identifier is a string of
characters containing the name of the bit.  The string is terminated by
either the bit number at the start of the next bit identifier or NUL for
the last bit identifier.
sys/net80211/ieee80211_crypto.h
167–170

For use with printf(9)'s %b:

The %b identifier expects two arguments: an int and a char *.  These are

Thanks for letting me know what I am missing. But after applying this patch in main, the ifconfig does not show the "cryptocaps". In verbose mode, it is empty. Any idea if there is a bug?

before the patch:
root@n2fbsd:/usr/src # ifconfig wlan0 list caps
drivercaps=581c001<STA,SHSLOT,SHPREAMBLE,MONITOR,WPA1,WPA2,WME>
cryptocaps=b<WEP,TKIP,AES_CCM>

after the patch:
root@n2fbsd:~ # ifconfig wlan0 list caps
drivercaps=581c001<STA,SHSLOT,SHPREAMBLE,MONITOR,WPA1,WPA2,WME>
root@n2fbsd:~ #

root@n2fbsd:~ # ifconfig -v wlan0 list caps
drivercaps=581c001<STA,SHSLOT,SHPREAMBLE,MONITOR,WPA1,WPA2,WME>
cryptocaps=0<>
htcaps=0<>
vhtcaps=0<>
...

sys/net80211/ieee80211_crypto.h
167–170

Hold on a second. I think I forgot to compile the kernel with the HW CRYPTO defined. Let me test again.

cc added inline comments.
sys/net80211/ieee80211_crypto.h
167–170

No surprise. To list it, HW CRYPTO must be defined for my driver.

After the patch:

root@n2fbsd:~ # ifconfig wlan0 list caps
drivercaps=581c001<STA,SHSLOT,SHPREAMBLE,MONITOR,WPA1,WPA2,WME>
cryptocaps=b<WEP,TKIP,AES_CCM>
root@n2fbsd:~ #

This revision is now accepted and ready to land.Wed, May 1, 8:55 PM
bz requested changes to this revision.Thu, May 2, 7:40 PM
bz added inline comments.
sys/net80211/ieee80211_crypto.h
168

In reality there is no "\7NONE" as we do not define the IEEE80211_CRYPTO_NONE? Where do we want to be consistent: in the defines or the printf?

This revision now requires changes to proceed.Thu, May 2, 7:40 PM