Get rid of duplicated cipher suite and AKM definitions

WPA_CIPHER_* and CIPHER_* are used for the exact same set of cipher
suites with the main difference being that the WPA_CIPHER_* version is
suitable to be used as a bitfield. Similarly, WPA_KEY_MGMT_* and
KEY_MGMT_* have similar design for AKMs. There is no need to maintain
two separate copies of the definitions since the bitfield compatible
version can be used for both needs. Get rid of the CIPHER_* and
KEY_MGMT_* versions to clean up the implementation by getting rid of
unnecessary mapping functions.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-12-30 19:33:39 +02:00
parent de4ed4a89b
commit 4848a38d85
12 changed files with 68 additions and 187 deletions

View file

@ -1151,30 +1151,6 @@ int wpa_cipher_to_alg(int cipher)
}
enum wpa_cipher wpa_cipher_to_suite_driver(int cipher)
{
switch (cipher) {
case WPA_CIPHER_NONE:
return CIPHER_NONE;
case WPA_CIPHER_WEP40:
return CIPHER_WEP40;
case WPA_CIPHER_WEP104:
return CIPHER_WEP104;
case WPA_CIPHER_CCMP:
return CIPHER_CCMP;
case WPA_CIPHER_GCMP:
return CIPHER_GCMP;
case WPA_CIPHER_CCMP_256:
return CIPHER_CCMP_256;
case WPA_CIPHER_GCMP_256:
return CIPHER_GCMP_256;
case WPA_CIPHER_TKIP:
default:
return CIPHER_TKIP;
}
}
int wpa_cipher_valid_pairwise(int cipher)
{
return cipher == WPA_CIPHER_CCMP_256 ||