Compare commits

...

5 Commits

Author SHA1 Message Date
Michael Bestas
a0d762d22f Merge tag 'LA.UM.6.4.r1-05900-8x98.0' of https://source.codeaurora.org/quic/la/platform/system/qcom into HEAD
"LA.UM.6.4.r1-05900-8x98.0"
2018-01-17 17:07:19 +02:00
Christopher N. Hesse
d55eb82100 softap: sdk: Declare VNDK usage
Change-Id: I8d408c34947d9febf6afa95929bf9fb696d9d097
2017-12-06 12:25:42 +01:00
Peng Xu
4d42a1d281 softap: Fix KW issue for array index out of bounds
Check the length of the buffer before using it calculate
the index of the data in the buffer to prevent index becoming
a negative value.

Change-Id: I3dc440dac2e4a5437e2ff70c39577876a3a97123
CRs-fixed: 2111307
2017-09-19 11:04:49 -07:00
Srinivas Dasari
a7f0080a40 qsap: Initialize setCmd to avoid uninitialized memory access
setCmd variable is used to prepare the command with the
arguments received. This can be initialized to the string "str"
to avoid possible uninitialized memory access.

Change-Id: I60cb4de5b01560e4bb079ed92e6c3bde6cfbf9c7
CRs-Fixed: 2098740
2017-09-18 12:24:26 +05:30
Abhishek Srivastava
80064989b2 qsap: Allow empty wpa_passphrase
With this commit, wpa_passphrase should follow below condition:
1. empty string (len = 0)
2. string with length >= 8 && length <= 64

Change-Id: I029ac7cc2b32b564b4e3d6b747cc584ba59e5fde
2017-09-04 04:26:38 -07:00
3 changed files with 9 additions and 10 deletions

View File

@@ -12,6 +12,8 @@ LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS += -DSDK_VERSION=\"0.0.1.0\"
LOCAL_USE_VNDK := true
LOCAL_COPY_HEADERS_TO := sdk/softap/include
LOCAL_COPY_HEADERS := qsap_api.h
LOCAL_COPY_HEADERS += qsap.h

15
softap/sdk/qsap_api.c Executable file → Normal file
View File

@@ -260,6 +260,9 @@ static s32 qsap_read_cfg(s8 *pfile, struct Command * pcmd, s8 *presp, u32 *plen,
while(NULL != fgets(buf, MAX_CONF_LINE_LEN, fcfg)) {
s8 *pline = buf;
if (strlen(buf) == 0)
continue;
/** Skip the commented lines */
if(buf[0] == '#') {
if (ignore_comment) {
@@ -2544,7 +2547,7 @@ static void qsap_handle_set_request(s8 *pcmd, s8 *presp, u32 *plen)
pVal = pcmd + strlen(cmd_list[cNum].name);
if( (cNum != eCMD_COMMIT) &&
(cNum != eCMD_RESET_TO_DEFAULT) &&
((*pVal != '=') || (strlen(pVal) < 2)) ) {
((*pVal != '=') || (((eCMD_PASSPHRASE != cNum)) && (strlen(pVal) < 2)))) {
*plen = qsap_scnprintf(presp, *plen, "%s", ERR_INVALID_ARG);
return;
}
@@ -3157,7 +3160,7 @@ int qsapsetSoftap(int argc, char *argv[])
int i;
int hidden = 0;
int sec = SEC_MODE_NONE;
char setCmd[SET_BUF_LEN];
char setCmd[SET_BUF_LEN] = "set";
int offset = 0;
ALOGD("%s, %s, %s, %d\n", __FUNCTION__, argv[0], argv[1], argc);
@@ -3167,16 +3170,10 @@ int qsapsetSoftap(int argc, char *argv[])
}
// check if 2nd arg is dual2g/dual5g
if (argc > 2) {
// just match 'dual'
if (strncmp(argv[2], Conf_req[CONF_2g], 4) == 0) {
if (argc > 2 && (strncmp(argv[2], Conf_req[CONF_2g], 4) == 0)) {
snprintf(setCmd, SET_BUF_LEN, "set %s", argv[2]);
offset = 1;
argc--;
} else {
snprintf(setCmd, SET_BUF_LEN, "set");
offset = 0;
}
}
/* set interface */

2
softap/sdk/qsap_api.h Executable file → Normal file
View File

@@ -509,7 +509,7 @@ typedef struct sap_auto_channel_info {
#define IS_VALID_BSSID(x) (((value == ENABLE) || (value == DISABLE)) ? TRUE: FALSE)
/** Validate the length of the passphrase */
#define IS_VALID_PASSPHRASE_LEN(x) (((x >= PASSPHRASE_MIN) && (x <= PASSPHRASE_MAX)) ? TRUE: FALSE)
#define IS_VALID_PASSPHRASE_LEN(x) ((((x >= PASSPHRASE_MIN) && (x <= PASSPHRASE_MAX)) || (x == 0)) ? TRUE: FALSE)
/** Validate the beacon interval */
#define IS_VALID_BEACON(x) (((x >= BCN_INTERVAL_MIN) && (x <= BCN_INTERVAL_MAX)) ? TRUE: FALSE)