aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-01-13 16:02:20 (GMT)
committerJouni Malinen <j@w1.fi>2013-01-13 16:02:20 (GMT)
commit62769a88db69030aed82979e43af09c8d6916756 (patch)
tree4f8411b774ba23bbccd2a253cedaea93ecf99aa0 /src/common
parentcf830c1c54cb505045e9227bc6906effcde07e58 (diff)
downloadhostap-62769a88db69030aed82979e43af09c8d6916756.zip
hostap-62769a88db69030aed82979e43af09c8d6916756.tar.gz
hostap-62769a88db69030aed82979e43af09c8d6916756.tar.bz2
Move cipher to enum wpa_cipher conversion into wpa_common.c
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/wpa_common.c20
-rw-r--r--src/common/wpa_common.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c
index c786b0a..a8cf6be 100644
--- a/src/common/wpa_common.c
+++ b/src/common/wpa_common.c
@@ -1132,6 +1132,26 @@ 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_TKIP:
+ default:
+ return CIPHER_TKIP;
+ }
+}
+
+
int wpa_cipher_valid_pairwise(int cipher)
{
return cipher == WPA_CIPHER_CCMP ||
diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
index a326950..2d63662 100644
--- a/src/common/wpa_common.h
+++ b/src/common/wpa_common.h
@@ -392,6 +392,7 @@ int wpa_ft_parse_ies(const u8 *ies, size_t ies_len, struct wpa_ft_ies *parse);
int wpa_cipher_key_len(int cipher);
int wpa_cipher_rsc_len(int cipher);
int wpa_cipher_to_alg(int cipher);
+enum wpa_cipher wpa_cipher_to_suite_driver(int cipher);
int wpa_cipher_valid_pairwise(int cipher);
u32 wpa_cipher_to_suite(int proto, int cipher);
int rsn_cipher_put_suites(u8 *pos, int ciphers);