lua: fix WPA cipher reporting
authorJo-Philipp Wich <jo@mein.io>
Wed, 21 Sep 2016 19:02:10 +0000 (21:02 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 21 Sep 2016 19:02:15 +0000 (21:02 +0200)
Use the same logic as the command line interface for reporting the used WPA
ciphers. Instead of printing the intersection of pairwise and group ciphers,
report both group and pairwise ciphers.

This fixes a case where a connection which uses CCMP for pairwise and TKIP
as groupwise cipher is getting reported as using the NONE cipher.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
iwinfo_lua.c

index 94913ac0d41e2e1a3527bf28e1735407275ae1ed..14211115c9881873b5a91e930a348876ffcf2bb5 100644 (file)
@@ -134,21 +134,21 @@ static char * iwinfo_crypto_desc(struct iwinfo_crypto_entry *c)
                                                sprintf(desc, "mixed WPA/WPA2 %s (%s)",
                                                        iwinfo_crypto_print_suites(c->auth_suites),
                                                        iwinfo_crypto_print_ciphers(
-                                                               c->pair_ciphers & c->group_ciphers));
+                                                               c->pair_ciphers | c->group_ciphers));
                                                break;
 
                                        case 2:
                                                sprintf(desc, "WPA2 %s (%s)",
                                                        iwinfo_crypto_print_suites(c->auth_suites),
                                                        iwinfo_crypto_print_ciphers(
-                                                               c->pair_ciphers & c->group_ciphers));
+                                                               c->pair_ciphers | c->group_ciphers));
                                                break;
 
                                        case 1:
                                                sprintf(desc, "WPA %s (%s)",
                                                        iwinfo_crypto_print_suites(c->auth_suites),
                                                        iwinfo_crypto_print_ciphers(
-                                                               c->pair_ciphers & c->group_ciphers));
+                                                               c->pair_ciphers | c->group_ciphers));
                                                break;
                                }
                        }