aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
Diffstat (limited to 'epan')
-rw-r--r--epan/crypt/airpdcap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/crypt/airpdcap.c b/epan/crypt/airpdcap.c
index d2bfee9102..bc1ca32567 100644
--- a/epan/crypt/airpdcap.c
+++ b/epan/crypt/airpdcap.c
@@ -1737,7 +1737,8 @@ AirPDcapGetBssidAddress(
}
}
-/* Function used to derive the PTK. Refer to IEEE 802.11I-2004, pag. 74 */
+/* Function used to derive the PTK. Refer to IEEE 802.11I-2004, pag. 74
+ * and IEEE 802.11i-2004, pag. 164 */
static void
AirPDcapRsnaPrfX(
AIRPDCAP_SEC_ASSOCIATION *sa,
@@ -1749,6 +1750,7 @@ AirPDcapRsnaPrfX(
UINT8 i;
UCHAR R[100];
INT offset=sizeof("Pairwise key expansion");
+ UCHAR output[80]; /* allow for sha1 overflow. */
memset(R, 0, 100);
@@ -1785,8 +1787,9 @@ AirPDcapRsnaPrfX(
for(i = 0; i < (x+159)/160; i++)
{
R[offset] = i;
- sha1_hmac(pmk, 32, R, 100, ptk + i * 20);
+ sha1_hmac(pmk, 32, R, 100, &output[20 * i]);
}
+ memcpy(ptk, output, x/8);
}
static INT