shithub: riscv

Download patch

ref: 6a1f3823bbadb7a779423e21575fb38f52ae9b22
parent: 58f8d7874b01892553ac5679d6f784dc1fa0949b
author: ppatience0 <[email protected]>
date: Sat Jun 22 05:27:56 EDT 2013

wpa: s/peerwise/pairwise/g, fix bug where p is not incremented after
reading wpa1oui into w, making the later memcmp with wpatkipoui
bogus.

--- a/sys/src/cmd/aux/wpa.c
+++ b/sys/src/cmd/aux/wpa.c
@@ -75,8 +75,8 @@
 	0x14,			/* length */
 	0x01, 0x00,		/* version 1 */
 	0x00, 0x0F, 0xAC, 0x04,	/* group cipher suite CCMP */
-	0x01, 0x00,		/* peerwise cipher suite count 1 */
-	0x00, 0x0F, 0xAC, 0x04,	/* peerwise cipher suite CCMP */
+	0x01, 0x00,		/* pairwise cipher suite count 1 */
+	0x00, 0x0F, 0xAC, 0x04,	/* pairwise cipher suite CCMP */
 	0x01, 0x00,		/* authentication suite count 1 */
 	0x00, 0x0F, 0xAC, 0x02,	/* authentication suite PSK */
 	0x00, 0x00,		/* capabilities */
@@ -92,8 +92,8 @@
 	0x00, 0x50, 0xf2, 0x01,	/* WPAIE type 1 */
 	0x01, 0x00,		/* version 1 */
 	0x00, 0x50, 0xf2, 0x02,	/* group cipher suite TKIP */
-	0x01, 0x00,		/* peerwise cipher suite count 1 */
-	0x00, 0x50, 0xf2, 0x02,	/* peerwise cipher suite TKIP */
+	0x01, 0x00,		/* pairwise cipher suite count 1 */
+	0x00, 0x50, 0xf2, 0x02,	/* pairwise cipher suite TKIP */
 	0x01, 0x00,		/* authentication suite count 1 */
 	0x00, 0x50, 0xf2, 0x02,	/* authentication suite PSK */
 };
@@ -194,6 +194,7 @@
 
 		memmove(w, wpa1oui, 4);
 		w += 4;
+		p += 4;
 	} else {
 		sysfatal("unrecognized RSNE type; brsne: %s", buf);
 		return 0;
@@ -775,7 +776,7 @@
 					tsc = rsc;
 					rsc = 0LL;
 				}
-				/* install peerwise receive key */
+				/* install pairwise receive key */
 				if(fprint(cfd, "rxkey %.*H %s:%.*H@%llux", Eaddrlen, amac,
 					peercipher->name, peercipher->keylen, ptk+32, tsc) < 0)
 					sysfatal("write rxkey: %r");
@@ -790,7 +791,7 @@
 				reply(smac, amac, flags & ~(Fack|Fenc|Fsec), kd, nil, 0);
 				sleep(100);
 
-				/* install peerwise transmit key */ 
+				/* install pairwise transmit key */ 
 				if(fprint(cfd, "txkey %.*H %s:%.*H@%llux", Eaddrlen, amac,
 					peercipher->name, peercipher->keylen, ptk+32, tsc) < 0)
 					sysfatal("write txkey: %r");