Define allowed pairwise/group cipher suites in a header file

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-01-13 17:10:38 +02:00
parent a39c78be41
commit 031453265f
2 changed files with 8 additions and 4 deletions

View file

@ -20,6 +20,12 @@
#define WPA_GMK_LEN 32 #define WPA_GMK_LEN 32
#define WPA_GTK_MAX_LEN 32 #define WPA_GTK_MAX_LEN 32
#define WPA_ALLOWED_PAIRWISE_CIPHERS \
(WPA_CIPHER_CCMP | WPA_CIPHER_GCMP | WPA_CIPHER_TKIP | WPA_CIPHER_NONE)
#define WPA_ALLOWED_GROUP_CIPHERS \
(WPA_CIPHER_CCMP | WPA_CIPHER_GCMP | WPA_CIPHER_TKIP | WPA_CIPHER_WEP104 | \
WPA_CIPHER_WEP40)
#define WPA_SELECTOR_LEN 4 #define WPA_SELECTOR_LEN 4
#define WPA_VERSION 1 #define WPA_VERSION 1
#define RSN_SELECTOR_LEN 4 #define RSN_SELECTOR_LEN 4

View file

@ -728,8 +728,7 @@ static int wpa_config_parse_pairwise(const struct parse_data *data,
val = wpa_config_parse_cipher(line, value); val = wpa_config_parse_cipher(line, value);
if (val == -1) if (val == -1)
return -1; return -1;
if (val & ~(WPA_CIPHER_CCMP | WPA_CIPHER_GCMP | WPA_CIPHER_TKIP | if (val & ~WPA_ALLOWED_PAIRWISE_CIPHERS) {
WPA_CIPHER_NONE)) {
wpa_printf(MSG_ERROR, "Line %d: not allowed pairwise cipher " wpa_printf(MSG_ERROR, "Line %d: not allowed pairwise cipher "
"(0x%x).", line, val); "(0x%x).", line, val);
return -1; return -1;
@ -758,8 +757,7 @@ static int wpa_config_parse_group(const struct parse_data *data,
val = wpa_config_parse_cipher(line, value); val = wpa_config_parse_cipher(line, value);
if (val == -1) if (val == -1)
return -1; return -1;
if (val & ~(WPA_CIPHER_CCMP | WPA_CIPHER_GCMP | WPA_CIPHER_TKIP | if (val & ~WPA_ALLOWED_GROUP_CIPHERS) {
WPA_CIPHER_WEP104 | WPA_CIPHER_WEP40)) {
wpa_printf(MSG_ERROR, "Line %d: not allowed group cipher " wpa_printf(MSG_ERROR, "Line %d: not allowed group cipher "
"(0x%x).", line, val); "(0x%x).", line, val);
return -1; return -1;