]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Include PTID in PV1 nonce construction for CCMP test vector
authorHenry Ptasinski <henry@e78com.com>
Thu, 13 Jul 2023 13:29:32 +0000 (15:29 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 11 Aug 2023 08:46:29 +0000 (11:46 +0300)
Includ the PTID in the PV1 nonce construction.

Signed-off-by: Henry Ptasinski <henry@e78com.com>
wlantest/ccmp.c

index 894aa743b2386b0fef6bcdcbba6358ade134a0a2..e1978e78763fa96fd246db49b79570d946362d21 100644 (file)
@@ -91,7 +91,7 @@ static void ccmp_aad_nonce_pv1(const u8 *hdr, const u8 *a1, const u8 *a2,
                               const u8 *a3, const u8 *pn,
                               u8 *aad, size_t *aad_len, u8 *nonce)
 {
-       u16 fc, type;
+       u16 fc, type, ptid;
        u8 *pos;
 
        nonce[0] = BIT(5); /* PV1 */
@@ -102,6 +102,11 @@ static void ccmp_aad_nonce_pv1(const u8 *hdr, const u8 *a1, const u8 *a2,
 
        if (type == 1)
                nonce[0] |= 0x10; /* Management */
+       else if ((type == 0) || (type == 3)) {
+               /* QoS Data */
+               ptid = (fc & (BIT(5) | BIT(6) | BIT(7))) >> 5;
+               nonce[0] |= ptid;
+       }
 
        fc &= ~(BIT(10) | BIT(11) | BIT(13) | BIT(14) | BIT(15));
        fc |= BIT(12);