|
@@ -33,7 +33,7 @@
|
|
|
*
|
|
|
*
|
|
|
* This file was automatically generated by 'framesc'
|
|
|
- * Thu Feb 8 19:55:19 2018 from the following file(s):
|
|
|
+ * Fri Feb 16 12:30:33 2018 from the following file(s):
|
|
|
*
|
|
|
* dot11f.frms
|
|
|
*
|
|
@@ -4866,6 +4866,8 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx,
|
|
|
bool append_ie)
|
|
|
{
|
|
|
uint32_t status = DOT11F_PARSE_SUCCESS;
|
|
|
+ uint8_t def_cipher_suite[4] = {0x00, 0x0f, 0xac, 0x04};
|
|
|
+ uint8_t def_akm_suite[4] = {0x00, 0x0f, 0xac, 0x01};
|
|
|
(void) pBuf; (void)ielen; /* Shutup the compiler */
|
|
|
if (pDst->present)
|
|
|
status = DOT11F_DUPLICATE_IE;
|
|
@@ -4878,26 +4880,55 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx,
|
|
|
return status | DOT11F_BAD_FIXED_VALUE;
|
|
|
}
|
|
|
if (!ielen) {
|
|
|
- pDst->pwise_cipher_suite_count = 0U;
|
|
|
- pDst->akm_suite_count = 0U;
|
|
|
+ pDst->RSN_Cap_present = 0U;
|
|
|
+ pDst->gp_mgmt_cipher_suite_present = 0U;
|
|
|
+ pDst->gp_cipher_suite_present = 1;
|
|
|
+ DOT11F_MEMCPY(pCtx, pDst->gp_cipher_suite, def_cipher_suite, 4);
|
|
|
+ pDst->pwise_cipher_suite_count = 1;
|
|
|
+ DOT11F_MEMCPY(pCtx,
|
|
|
+ pDst->pwise_cipher_suites, def_cipher_suite, 4);
|
|
|
+ pDst->akm_suite_cnt = 1;
|
|
|
+ DOT11F_MEMCPY(pCtx, pDst->akm_suite, def_akm_suite, 4);
|
|
|
pDst->pmkid_count = 0U;
|
|
|
return 0U;
|
|
|
} else {
|
|
|
+ pDst->gp_cipher_suite_present = 1;
|
|
|
+ if (ielen < 4) {
|
|
|
+ pDst->present = 0;
|
|
|
+ return DOT11F_SKIPPED_BAD_IE;
|
|
|
+ }
|
|
|
+
|
|
|
DOT11F_MEMCPY(pCtx, pDst->gp_cipher_suite, pBuf, 4);
|
|
|
pBuf += 4;
|
|
|
ielen -= (uint8_t)4;
|
|
|
}
|
|
|
if (!ielen) {
|
|
|
- pDst->pwise_cipher_suite_count = 0U;
|
|
|
- pDst->akm_suite_count = 0U;
|
|
|
+ pDst->RSN_Cap_present = 0U;
|
|
|
+ pDst->gp_mgmt_cipher_suite_present = 0U;
|
|
|
+ pDst->pwise_cipher_suite_count = 1;
|
|
|
+ DOT11F_MEMCPY(pCtx,
|
|
|
+ pDst->pwise_cipher_suites, def_cipher_suite, 4);
|
|
|
+ pDst->akm_suite_cnt = 1;
|
|
|
+ DOT11F_MEMCPY(pCtx, pDst->akm_suite, def_akm_suite, 4);
|
|
|
pDst->pmkid_count = 0U;
|
|
|
return 0U;
|
|
|
} else {
|
|
|
+ if (ielen < 2) {
|
|
|
+ pDst->present = 0;
|
|
|
+ return DOT11F_SKIPPED_BAD_IE;
|
|
|
+ }
|
|
|
+
|
|
|
framesntohs(pCtx, &pDst->pwise_cipher_suite_count, pBuf, 0);
|
|
|
pBuf += 2;
|
|
|
ielen -= (uint8_t)2;
|
|
|
}
|
|
|
- if (pDst->pwise_cipher_suite_count > 6) {
|
|
|
+ if (!pDst->pwise_cipher_suite_count ||
|
|
|
+ pDst->pwise_cipher_suite_count > 6) {
|
|
|
+ pDst->present = 0;
|
|
|
+ return DOT11F_SKIPPED_BAD_IE;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ielen < pDst->pwise_cipher_suite_count * 4) {
|
|
|
pDst->present = 0;
|
|
|
return DOT11F_SKIPPED_BAD_IE;
|
|
|
}
|
|
@@ -4906,34 +4937,63 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx,
|
|
|
pBuf += (pDst->pwise_cipher_suite_count * 4);
|
|
|
ielen -= (pDst->pwise_cipher_suite_count * 4);
|
|
|
if (!ielen) {
|
|
|
- pDst->akm_suite_count = 0U;
|
|
|
+ pDst->RSN_Cap_present = 0U;
|
|
|
+ pDst->gp_mgmt_cipher_suite_present = 0U;
|
|
|
+ pDst->akm_suite_cnt = 1;
|
|
|
+ DOT11F_MEMCPY(pCtx, pDst->akm_suite, def_akm_suite, 4);
|
|
|
pDst->pmkid_count = 0U;
|
|
|
return 0U;
|
|
|
} else {
|
|
|
- framesntohs(pCtx, &pDst->akm_suite_count, pBuf, 0);
|
|
|
+ if (ielen < 2) {
|
|
|
+ pDst->present = 0;
|
|
|
+ return DOT11F_SKIPPED_BAD_IE;
|
|
|
+ }
|
|
|
+
|
|
|
+ framesntohs(pCtx, &pDst->akm_suite_cnt, pBuf, 0);
|
|
|
pBuf += 2;
|
|
|
ielen -= (uint8_t)2;
|
|
|
}
|
|
|
- if (pDst->akm_suite_count > 6) {
|
|
|
+ if (!pDst->akm_suite_cnt ||
|
|
|
+ pDst->akm_suite_cnt > 6) {
|
|
|
pDst->present = 0;
|
|
|
return DOT11F_SKIPPED_BAD_IE;
|
|
|
}
|
|
|
|
|
|
- DOT11F_MEMCPY(pCtx, pDst->akm_suites, pBuf, (pDst->akm_suite_count * 4));
|
|
|
- pBuf += (pDst->akm_suite_count * 4);
|
|
|
- ielen -= (pDst->akm_suite_count * 4);
|
|
|
+ if (ielen < pDst->akm_suite_cnt * 4) {
|
|
|
+ pDst->present = 0;
|
|
|
+ return DOT11F_SKIPPED_BAD_IE;
|
|
|
+ }
|
|
|
+
|
|
|
+ DOT11F_MEMCPY(pCtx, pDst->akm_suite, pBuf, (pDst->akm_suite_cnt * 4));
|
|
|
+ pBuf += (pDst->akm_suite_cnt * 4);
|
|
|
+ ielen -= (pDst->akm_suite_cnt * 4);
|
|
|
if (!ielen) {
|
|
|
+ pDst->RSN_Cap_present = 0U;
|
|
|
+ pDst->gp_mgmt_cipher_suite_present = 0U;
|
|
|
pDst->pmkid_count = 0U;
|
|
|
return 0U;
|
|
|
} else {
|
|
|
+ pDst->RSN_Cap_present = 1;
|
|
|
+ if (ielen < 2) {
|
|
|
+ pDst->present = 0;
|
|
|
+ return DOT11F_SKIPPED_BAD_IE;
|
|
|
+ }
|
|
|
+
|
|
|
DOT11F_MEMCPY(pCtx, pDst->RSN_Cap, pBuf, 2);
|
|
|
pBuf += 2;
|
|
|
ielen -= (uint8_t)2;
|
|
|
}
|
|
|
if (!ielen) {
|
|
|
+ pDst->RSN_Cap_present = 0U;
|
|
|
+ pDst->gp_mgmt_cipher_suite_present = 0U;
|
|
|
pDst->pmkid_count = 0U;
|
|
|
return 0U;
|
|
|
} else {
|
|
|
+ if (ielen < 2) {
|
|
|
+ pDst->present = 0;
|
|
|
+ return DOT11F_SKIPPED_BAD_IE;
|
|
|
+ }
|
|
|
+
|
|
|
framesntohs(pCtx, &pDst->pmkid_count, pBuf, 0);
|
|
|
pBuf += 2;
|
|
|
ielen -= (uint8_t)2;
|
|
@@ -4943,12 +5003,23 @@ uint32_t dot11f_unpack_ie_rsn(tpAniSirGlobal pCtx,
|
|
|
return DOT11F_SKIPPED_BAD_IE;
|
|
|
}
|
|
|
|
|
|
+ if (ielen < pDst->pmkid_count * 16) {
|
|
|
+ pDst->present = 0;
|
|
|
+ return DOT11F_SKIPPED_BAD_IE;
|
|
|
+ }
|
|
|
+
|
|
|
DOT11F_MEMCPY(pCtx, pDst->pmkid, pBuf, (pDst->pmkid_count * 16));
|
|
|
pBuf += (pDst->pmkid_count * 16);
|
|
|
ielen -= (pDst->pmkid_count * 16);
|
|
|
if (!ielen) {
|
|
|
return 0U;
|
|
|
} else {
|
|
|
+ pDst->gp_mgmt_cipher_suite_present = 1;
|
|
|
+ if (ielen < 4) {
|
|
|
+ pDst->present = 0;
|
|
|
+ return DOT11F_SKIPPED_BAD_IE;
|
|
|
+ }
|
|
|
+
|
|
|
DOT11F_MEMCPY(pCtx, pDst->gp_mgmt_cipher_suite, pBuf, 4);
|
|
|
}
|
|
|
(void)pCtx;
|
|
@@ -13128,7 +13199,8 @@ uint32_t dot11f_get_packed_iersn(tpAniSirGlobal pCtx,
|
|
|
(void)pCtx;
|
|
|
while (pIe->present) {
|
|
|
*pnNeeded += 2;
|
|
|
- if (pIe->gp_cipher_suite) {
|
|
|
+ if (pIe->gp_cipher_suite_present) {
|
|
|
+
|
|
|
*pnNeeded += 4;
|
|
|
} else {
|
|
|
break;
|
|
@@ -13139,22 +13211,30 @@ uint32_t dot11f_get_packed_iersn(tpAniSirGlobal pCtx,
|
|
|
break;
|
|
|
}
|
|
|
*pnNeeded += (pIe->pwise_cipher_suite_count * 4);
|
|
|
- if (pIe->akm_suite_count) {
|
|
|
+ if (pIe->akm_suite_cnt) {
|
|
|
+ *pnNeeded += 2;
|
|
|
+ } else {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ *pnNeeded += (pIe->akm_suite_cnt * 4);
|
|
|
+ if (pIe->RSN_Cap_present) {
|
|
|
+
|
|
|
*pnNeeded += 2;
|
|
|
} else {
|
|
|
break;
|
|
|
}
|
|
|
- *pnNeeded += (pIe->akm_suite_count * 4);
|
|
|
- /* RSN_Cap */
|
|
|
- *pnNeeded += 2;
|
|
|
if (pIe->pmkid_count) {
|
|
|
*pnNeeded += 2;
|
|
|
} else {
|
|
|
break;
|
|
|
}
|
|
|
*pnNeeded += (pIe->pmkid_count * 16);
|
|
|
- /* gp_mgmt_cipher_suite */
|
|
|
- *pnNeeded += 4;
|
|
|
+ if (pIe->gp_mgmt_cipher_suite_present) {
|
|
|
+
|
|
|
+ *pnNeeded += 4;
|
|
|
+ } else {
|
|
|
+ break;
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
return status;
|
|
@@ -21414,7 +21494,7 @@ uint32_t dot11f_pack_ie_rsn(tpAniSirGlobal pCtx,
|
|
|
frameshtons(pCtx, pBuf, pSrc->version, 0);
|
|
|
*pnConsumed += 2;
|
|
|
pBuf += 2;
|
|
|
- if (pSrc->gp_cipher_suite) {
|
|
|
+ if (pSrc->gp_cipher_suite_present) {
|
|
|
DOT11F_MEMCPY(pCtx, pBuf, pSrc->gp_cipher_suite, 4);
|
|
|
*pnConsumed += 4;
|
|
|
pBuf += 4;
|
|
@@ -21431,20 +21511,23 @@ uint32_t dot11f_pack_ie_rsn(tpAniSirGlobal pCtx,
|
|
|
DOT11F_MEMCPY(pCtx, pBuf, &(pSrc->pwise_cipher_suites), (pSrc->pwise_cipher_suite_count * 4));
|
|
|
*pnConsumed += (pSrc->pwise_cipher_suite_count * 4);
|
|
|
pBuf += (pSrc->pwise_cipher_suite_count * 4);
|
|
|
- if (pSrc->akm_suite_count) {
|
|
|
- frameshtons(pCtx, pBuf, pSrc->akm_suite_count, 0);
|
|
|
+ if (pSrc->akm_suite_cnt) {
|
|
|
+ frameshtons(pCtx, pBuf, pSrc->akm_suite_cnt, 0);
|
|
|
+ *pnConsumed += 2;
|
|
|
+ pBuf += 2;
|
|
|
+ } else {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ DOT11F_MEMCPY(pCtx, pBuf, &(pSrc->akm_suite), (pSrc->akm_suite_cnt * 4));
|
|
|
+ *pnConsumed += (pSrc->akm_suite_cnt * 4);
|
|
|
+ pBuf += (pSrc->akm_suite_cnt * 4);
|
|
|
+ if (pSrc->RSN_Cap_present) {
|
|
|
+ DOT11F_MEMCPY(pCtx, pBuf, pSrc->RSN_Cap, 2);
|
|
|
*pnConsumed += 2;
|
|
|
pBuf += 2;
|
|
|
} else {
|
|
|
break;
|
|
|
}
|
|
|
- DOT11F_MEMCPY(pCtx, pBuf, &(pSrc->akm_suites), (pSrc->akm_suite_count * 4));
|
|
|
- *pnConsumed += (pSrc->akm_suite_count * 4);
|
|
|
- pBuf += (pSrc->akm_suite_count * 4);
|
|
|
- /* RSN_Cap */
|
|
|
- DOT11F_MEMCPY(pCtx, pBuf, pSrc->RSN_Cap, 2);
|
|
|
- *pnConsumed += 2;
|
|
|
- pBuf += 2;
|
|
|
if (pSrc->pmkid_count) {
|
|
|
frameshtons(pCtx, pBuf, pSrc->pmkid_count, 0);
|
|
|
*pnConsumed += 2;
|
|
@@ -21455,10 +21538,13 @@ uint32_t dot11f_pack_ie_rsn(tpAniSirGlobal pCtx,
|
|
|
DOT11F_MEMCPY(pCtx, pBuf, &(pSrc->pmkid), (pSrc->pmkid_count * 16));
|
|
|
*pnConsumed += (pSrc->pmkid_count * 16);
|
|
|
pBuf += (pSrc->pmkid_count * 16);
|
|
|
- /* gp_mgmt_cipher_suite */
|
|
|
- DOT11F_MEMCPY(pCtx, pBuf, pSrc->gp_mgmt_cipher_suite, 4);
|
|
|
- *pnConsumed += 4;
|
|
|
- /* fieldsEndFlag = 1 */
|
|
|
+ if (pSrc->gp_mgmt_cipher_suite_present) {
|
|
|
+ DOT11F_MEMCPY(pCtx, pBuf, pSrc->gp_mgmt_cipher_suite, 4);
|
|
|
+ *pnConsumed += 4;
|
|
|
+ /* fieldsEndFlag = 1 */
|
|
|
+ } else {
|
|
|
+ break;
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
(void)pCtx;
|