From: stsp Date: Fri, 22 Jul 2022 20:31:45 +0000 (+0000) Subject: In tcpdump(8), fix printing of multiple 802.11 RSN ciphers and AKMs. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3cfb457272d53fc3b536e26181203ae9bd7e9449;p=openbsd In tcpdump(8), fix printing of multiple 802.11 RSN ciphers and AKMs. Also, pretty-print SAE (used by WPA3) if found in AKMs. Errors introduced by me in CVS commit hgtOdzeJfB27Yyq0 / r1.40. Patch by Mikhail --- diff --git a/usr.sbin/tcpdump/print-802_11.c b/usr.sbin/tcpdump/print-802_11.c index b0641a29279..610c07abbe1 100644 --- a/usr.sbin/tcpdump/print-802_11.c +++ b/usr.sbin/tcpdump/print-802_11.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-802_11.c,v 1.42 2022/03/17 14:00:53 stsp Exp $ */ +/* $OpenBSD: print-802_11.c,v 1.43 2022/07/22 20:31:45 stsp Exp $ */ /* * Copyright (c) 2005 Reyk Floeter @@ -860,6 +860,9 @@ ieee80211_print_akm(uint8_t selector[4]) case 6: printf("SHA256-PSK"); break; + case 8: + printf("SAE"); + break; default: printf("%d", selector[3]); break; @@ -910,7 +913,7 @@ ieee80211_print_rsn(u_int8_t *data, u_int len) printf(",cipher%s ", nciphers > 1 ? "s" : ""); for (i = 0; i < nciphers; i++) { for (j = 0; j < 4; j++) - selector[j] = data[i + j]; + selector[j] = data[j]; ieee80211_print_rsncipher(selector); if (i < nciphers - 1) printf(" "); @@ -931,11 +934,11 @@ ieee80211_print_rsn(u_int8_t *data, u_int len) } printf(",akm%s ", nakms > 1 ? "s" : ""); - for (i = 0; i < nciphers; i++) { + for (i = 0; i < nakms; i++) { for (j = 0; j < 4; j++) - selector[j] = data[i + j]; + selector[j] = data[j]; ieee80211_print_akm(selector); - if (i < nciphers - 1) + if (i < nakms - 1) printf(" "); data += 4; }