Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Use asserts as a suggestion #67

Open
wants to merge 113 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
d12a5ef
Add support for Zephyr RTOS (#1)
sr1dh48r Jul 7, 2022
3aa5f4d
Fix build error (#4)
krish2718 Jul 11, 2022
dbd03bc
MbedTLS compat changes for build (#3)
krish2718 Jul 11, 2022
9fa7549
Adding CODEOWNERS file .. (#2)
sr1dh48r Jul 11, 2022
2cc498b
Fix crash in case supplicant init fails (#5)
krish2718 Jul 14, 2022
5d33e59
Cleanups related to Wi-Fi shell (#6)
krish2718 Jul 15, 2022
bf7be56
Fix upstream warnings
Jul 15, 2022
5a77ce2
Support build with IPv6 enabled only
Damian-Nordic Jul 19, 2022
4f47e17
Remove AF_PACKET workaround
Jul 20, 2022
c2400e7
Add workaround for filtering unnecessary frames
Jul 20, 2022
3dabc36
Fix a build warning
Jul 21, 2022
386a52e
Compile out logs based on configured log level
Damian-Nordic Aug 3, 2022
db69d6c
Add Nordic copyright for MbedTLS files
Aug 27, 2022
5d2e29e
Redesign the events passing to wpa_supplicant from driver
Jul 20, 2022
36fa7a5
Clear scan results flag for failure cases
Jul 20, 2022
261b608
Fix scan results free crash
Jul 20, 2022
32f4655
Fix uninitialized capabilities
Jul 26, 2022
96be2d5
Restructure wpa_supplicant interface handle
Aug 14, 2022
460d1eb
Fix scan results crash
Aug 14, 2022
40e297d
Fix logging level
Aug 17, 2022
c6a11ef
Implement nRF Wi-Fi management APIs
rado17 Jul 21, 2022
b50bcfa
Migrate wpa_cli from NCS/sdk-nrf
Aug 16, 2022
1508f2b
Remove display scan
Aug 29, 2022
449aad8
Use UNIX sockets instead of networking sockets
Aug 31, 2022
8c5ed9a
Restart DHCP for every association
Aug 31, 2022
5c474aa
Fix WPA CLI build
Sep 5, 2022
13ff9da
Enable sub-menu only if menu is selected
Sep 5, 2022
76bd09e
Fix the WPA_SUPP help
Sep 5, 2022
106aea4
COV-177625: Fix double free
Sep 8, 2022
8d34988
COV-176030: Fix resource leak
Sep 8, 2022
7bcefa7
COV-175739: Fix use after free
Sep 8, 2022
fed22d4
COV-175332: Fix memory leak
Sep 8, 2022
f0031e9
COV-175218: Fix L2 handle leak
Sep 8, 2022
9d2d405
Use 64bit data type to store time
Sep 8, 2022
47399f0
Add a null check for ifname
Sep 9, 2022
e41edad
Support signal polling
rado17 Sep 2, 2022
4848da7
Wait for WPA supplicant initialization
Sep 19, 2022
74352f6
Fix both API and Shell usage
Sep 25, 2022
b979102
Add support for channel selection
Sep 26, 2022
6754055
Enable support for MBO
ajayparida Sep 27, 2022
a6da521
Increase log buffer size
Oct 4, 2022
cbc3ae3
Fix mutex unlock
Oct 4, 2022
4ee2a9c
Choose necessary MbedTLS Kconfig symbols by default
Oct 6, 2022
35ede8e
Fix Zephyr includes with latest up-merge
Oct 10, 2022
9337fe0
Fix deadlock during connect
Oct 10, 2022
7d084aa
(dis)connection status: Terminate gracefully
Oct 10, 2022
f89bd52
Fix header file prefix
Oct 11, 2022
306b36c
Remove nRF Wi-Fi management
Oct 10, 2022
b5033d1
wifi: MBO Pre-certification bugfixes
sr1dh48r Oct 18, 2022
8578a9d
Fix link address buffer overflow
Oct 18, 2022
2e7d29c
Fix build warnings with Zephyr toolchain
Oct 18, 2022
4b6dba3
Use the PMF setting from the user
Oct 25, 2022
f665cad
Fix sending terminate event for first requests
Oct 24, 2022
6a4ba89
Remove unncessary error message
Oct 28, 2022
9315821
Explicitly enabled CBC/CTR
Oct 31, 2022
5ee5972
wifi: PMF Pre-certification bugfixes
ajayparida Nov 1, 2022
9424933
Fix spurious hash
Oct 31, 2022
1e7b716
Fix MbedTLS addmod operation
Nov 2, 2022
cf08365
Fix square modulo operation
Nov 7, 2022
c636389
Use MbedTLS macro to check for return value
Nov 7, 2022
454c4f9
Fixed the connection timeout handling,
markaj-nordic Nov 25, 2022
49fddb8
Fix handling connection timeout equal to 0
Damian-Nordic Nov 29, 2022
8bac62c
Correct the logic to check for 11b rates
rado17 Oct 27, 2022
9526c7f
Identify legacy mode connections
rado17 Oct 27, 2022
d92b1bd
Display correct link mode in "wifi status" output
rado17 Oct 27, 2022
23d54fd
wifi : Add support for handling WIPHY cap., RX MLME frames
sr1dh48r Nov 17, 2022
bd9013f
Fix MbedTLS EC parameter A
Dec 2, 2022
2b288d5
Fix SAE-H2E sliding window exponentiation
Dec 8, 2022
903c774
MbedTLS: Remove aliasing of inputs and outputs
Dec 8, 2022
93f17e2
Add support for list_networks
Dec 12, 2022
6a9684e
Formatting changes
Dec 12, 2022
2a54d32
Set encryption capabilities
Dec 12, 2022
28ac1ba
Fix reply processing
Dec 13, 2022
ace8452
Reduce the control interface reply size
Dec 13, 2022
c1f1e05
Fix WEP key installation
Dec 19, 2022
dd36427
Implement connect and disconnect events to Zephyr
Jan 5, 2023
9b039d8
Fix BSS age underflow
Jan 9, 2023
fdb6774
Add interface up check for connect
sachinthegreen Jan 9, 2023
15af888
Add callback for MAC address change
sachinthegreen Jan 9, 2023
00da43b
Mark WPA supplicant as experimental
Jan 11, 2023
7856cab
Fix duplicate (dis)connection events
Jan 17, 2023
fc38654
Rename the namespace
Jan 21, 2023
ea26378
Add support for WPA CLI zephyr
Jan 22, 2023
044ed05
Make WPA CLI as passthrough
Jan 22, 2023
0ab6939
Use WPA CLI to interact with supplicant
Jan 22, 2023
4bf4967
Disable non-zephyr-wifi commands by default
Jan 24, 2023
a913c45
Fix unnecessary delay in getting wiphy info
Jan 19, 2023
ca396ab
Use semaphore for scan instead of sleep
Jan 19, 2023
207e050
Fix WPA2-PSK-SHA256 security
Feb 6, 2023
f65559c
Fix data access violation
Feb 6, 2023
0558483
Remove editing support
Feb 7, 2023
ccda687
Send connect success after authorizing port
Feb 7, 2023
ea5cbfe
Initialize the argv array to zeroes
Feb 4, 2023
7dd5323
Add support for global control interface
Feb 4, 2023
128cee9
Fix namespaces
Feb 4, 2023
f62b9d5
Add interfaces hotplugging support
Feb 4, 2023
733a887
Fix error reporting
Feb 4, 2023
4e39fa3
Reduce control interface stack size
Feb 4, 2023
eca80cc
Implement channel in connect command
Feb 4, 2023
d4d6845
Removed unused prototype
Feb 6, 2023
e0ff634
Check return value
Feb 6, 2023
d02ac2f
Fix the printf
Feb 6, 2023
aa41230
Improve the security check
Feb 6, 2023
af0d09d
Fix socketpair size for control interface
Feb 7, 2023
bb6dbb3
Indent using tabs
Feb 8, 2023
20ebeef
Increase network management stack size
Feb 8, 2023
fa53e2c
Mark Wi-Fi supported for nRF7002DK
Feb 7, 2023
4240dc1
Configure maximum polling sockets
Feb 13, 2023
dd71da3
Get extended capabilities from driver
sr1dh48r Feb 14, 2023
3dc8b0e
Don't print non-output statuses
Feb 13, 2023
8d3f26d
Fix the indent
Feb 13, 2023
4ccdf05
Add assert for minimum libc HEAP
Feb 14, 2023
17fb40e
Use asserts as a suggestion
Feb 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# CODEOWNERS for autoreview assigning in github

# https://help.github.com/en/articles/about-code-owners#codeowners-syntax
# Order is important; the last matching pattern takes the most
# precedence.

# Root folder
* @krish2718 @sr1dh48r @rlubos @sachinthegreen
4 changes: 2 additions & 2 deletions src/common/ieee802_11_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,15 +1556,15 @@ int supp_rates_11b_only(struct ieee802_11_elems *elems)
return 0;

for (i = 0; elems->supp_rates && i < elems->supp_rates_len; i++) {
if (is_11b(elems->supp_rates[i]))
if (is_11b(elems->supp_rates[i] & 0x7f))
num_11b++;
else
num_others++;
}

for (i = 0; elems->ext_supp_rates && i < elems->ext_supp_rates_len;
i++) {
if (is_11b(elems->ext_supp_rates[i]))
if (is_11b(elems->ext_supp_rates[i] & 0x7f))
num_11b++;
else
num_others++;
Expand Down
36 changes: 34 additions & 2 deletions src/common/wpa_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
#ifdef CONFIG_CTRL_IFACE_UNIX
#include <sys/stat.h>
#include <fcntl.h>
#ifndef CONFIG_ZEPHYR
#include <sys/un.h>
#endif
#include <unistd.h>
#include <fcntl.h>
#endif /* CONFIG_CTRL_IFACE_UNIX */
Expand All @@ -35,8 +37,7 @@
#include "wpa_ctrl.h"
#include "common.h"


#if defined(CONFIG_CTRL_IFACE_UNIX) || defined(CONFIG_CTRL_IFACE_UDP)
#if defined(CONFIG_CTRL_IFACE_UNIX) || defined(CONFIG_CTRL_IFACE_UDP) || defined(CONFIG_CTRL_IFACE_ZEPHYR)
#define CTRL_IFACE_SOCKET
#endif /* CONFIG_CTRL_IFACE_UNIX || CONFIG_CTRL_IFACE_UDP */

Expand Down Expand Up @@ -72,6 +73,9 @@ struct wpa_ctrl {
#ifdef CONFIG_CTRL_IFACE_NAMED_PIPE
HANDLE pipe;
#endif /* CONFIG_CTRL_IFACE_NAMED_PIPE */
#ifdef CONFIG_CTRL_IFACE_ZEPHYR
int s;
#endif /* CONFIG_CTRL_IFACE_ZEPHYR */
};


Expand Down Expand Up @@ -579,6 +583,34 @@ int wpa_ctrl_request(struct wpa_ctrl *ctrl, const char *cmd, size_t cmd_len,
}
#endif /* CTRL_IFACE_SOCKET */

#ifdef CONFIG_CTRL_IFACE_ZEPHYR
struct wpa_ctrl * wpa_ctrl_open(const int sock)
{
struct wpa_ctrl *ctrl;

if (sock < 0) {
wpa_printf(MSG_ERROR, "Invalid socket : %d\n", sock);
return NULL;
}

ctrl = os_zalloc(sizeof(*ctrl));
if (ctrl == NULL) {
wpa_printf(MSG_ERROR, "Failed to allocate memory: %d\n", sizeof(*ctrl));
return NULL;
}

/* We use one of the socketpair opened in ctrl_iface_zephyr.c */
ctrl->s = sock;

return ctrl;
}

void wpa_ctrl_close(struct wpa_ctrl *ctrl)
{
close(ctrl->s);
os_free(ctrl);
}
#endif

static int wpa_ctrl_attach_helper(struct wpa_ctrl *ctrl, int attach)
{
Expand Down
16 changes: 16 additions & 0 deletions src/common/wpa_ctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#ifdef __cplusplus
extern "C" {
#endif
extern struct wpa_ctrl *ctrl_conn;
extern char *ifname_prefix;

/* wpa_supplicant control interface - fixed message prefixes */

Expand Down Expand Up @@ -476,6 +478,17 @@ enum wpa_vendor_elem_frame {

/* wpa_supplicant/hostapd control interface access */

#ifdef CONFIG_CTRL_IFACE_ZEPHYR
/**
* wpa_ctrl_open - Open a control interface to wpa_supplicant/hostapd
* @sock: one of the pair of UNIX domain socket (socketpair)
* Returns: Pointer to abstract control interface data or %NULL on failure
*
* This function is used to open a control interface to wpa_supplicant/hostapd
* using a connected socketpair.
*/
struct wpa_ctrl * wpa_ctrl_open(const int sock);
#else
/**
* wpa_ctrl_open - Open a control interface to wpa_supplicant/hostapd
* @ctrl_path: Path for UNIX domain sockets; ignored if UDP sockets are used.
Expand All @@ -487,6 +500,7 @@ enum wpa_vendor_elem_frame {
* interface need to use matching path configuration.
*/
struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path);
#endif

/**
* wpa_ctrl_open2 - Open a control interface to wpa_supplicant/hostapd
Expand Down Expand Up @@ -634,6 +648,8 @@ void wpa_ctrl_cleanup(void);
char * wpa_ctrl_get_remote_ifname(struct wpa_ctrl *ctrl);
#endif /* CONFIG_CTRL_IFACE_UDP */

int wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd);
int wpa_request(struct wpa_ctrl *ctrl, int argc, char *argv[]);

#ifdef __cplusplus
}
Expand Down
Loading