iwinfo: Fix buffer size
[oweals/iwinfo.git] / iwinfo_lua.c
index eebab8e8987d2f95ecae8d85d5f494854261875a..3d9d95e54b5fa4d36614118d569e2f82dd00f8d8 100644 (file)
@@ -89,6 +89,12 @@ static char * iwinfo_crypto_print_suites(int suites)
        if (suites & IWINFO_KMGMT_8021x)
                pos += sprintf(pos, "802.1X/");
 
+       if (suites & IWINFO_KMGMT_SAE)
+               pos += sprintf(pos, "SAE/");
+
+       if (suites & IWINFO_KMGMT_OWE)
+               pos += sprintf(pos, "OWE/");
+
        if (!suites || (suites & IWINFO_KMGMT_NONE))
                pos += sprintf(pos, "NONE/");
 
@@ -130,6 +136,13 @@ static char * iwinfo_crypto_desc(struct iwinfo_crypto_entry *c)
                        else if (c->wpa_version)
                        {
                                switch (c->wpa_version) {
+                                       case 4:
+                                               sprintf(desc, "WPA3 %s (%s)",
+                                                       iwinfo_crypto_print_suites(c->auth_suites),
+                                                       iwinfo_crypto_print_ciphers(
+                                                               c->pair_ciphers | c->group_ciphers));
+                                               break;
+
                                        case 3:
                                                sprintf(desc, "mixed WPA/WPA2 %s (%s)",
                                                        iwinfo_crypto_print_suites(c->auth_suites),
@@ -518,6 +531,9 @@ static int iwinfo_L_hwmodelist(lua_State *L, int (*func)(const char *, int *))
                lua_pushboolean(L, hwmodes & IWINFO_80211_AC);
                lua_setfield(L, -2, "ac");
 
+               lua_pushboolean(L, hwmodes & IWINFO_80211_AD);
+               lua_setfield(L, -2, "ad");
+
                return 1;
        }