# DF-3421 — DDB 802.11 pretty-printers dump raw key material (ieee80211_ddb.c:810-816)

`_db_show_key()` prints the unredacted `wk->wk_key` bytes of every
programmed wlan key straight to the DDB console:

```c
810	if (memcmp(wk->wk_key, zerodata, keylen) != 0) {
811		int i;
812
813		db_printf(" <");
814		for (i = 0; i < keylen; i++)
815			db_printf("%02x", wk->wk_key[i]);   /* raw key bytes */
816		db_printf(">");
```

Coverage per cipher (same switch, :779-807):
- WEP: full key (5/13 bytes)
- TKIP: temporal key (32-16 = 16 bytes; only the MIC bytes are excluded)
- AES-CCM: full 16-byte PTK/GTK
- station unicast keys additionally expose RSC/TSC (:817-822)

Reachable DDB commands (compiled when `DDB` + wlan): `show vap <addr>`
(iterates `iv_nw_keys[0..IEEE80211_WEP_NKID-1]` at :488-489),
`show com <addr> /s` (station table → `_db_show_sta` → `ni_ucastkey` at
:292), `show sta <addr>`.

## Impact

Cryptographic key material written to the debug console — and therefore
into any serial-console capture, `dmesg`-adjacent console log, or a crash
dump taken while DDB output is on the console. Requires reaching DDB
(break on panic, `debug.kdb.enter` sysctl as root, or a physical/serial
console break) — console access is normally privileged, which is why this
is Low and hardening-grade rather than a general info leak. The identical
code is present upstream (FreeBSD ieee80211_ddb.c), so this is an
inherited issue.

## Not testable on this guest

The audit guest (`vtnet0 lo0`) has no 802.11 hardware and QEMU does not
emulate any wifi chipset, so no `ieee80211com`/`ieee80211vap` with keys
can exist to run `show vap` against. Verification: code-level (cited
lines), not executed. No panic/leak run performed; no `verdict.json`.

## Fix

Print key *presence/length*, never the bytes:

```diff
--- a/sys/netproto/802_11/wlan/ieee80211_ddb.c
+++ b/sys/netproto/802_11/wlan/ieee80211_ddb.c
@@ -807,13 +807,8 @@ _db_show_key(const char *tag, int ix, const struct ieee80211_key *wk)
 	default:
 		db_printf(" UNKNOWN (0x%x) %u:%u-bit",
 			cip->ic_cipher, wk->wk_keyix, 8*keylen);
 		break;
 	}
-	if (memcmp(wk->wk_key, zerodata, keylen) != 0) {
-		int i;
-
-		db_printf(" <");
-		for (i = 0; i < keylen; i++)
-			db_printf("%02x", wk->wk_key[i]);
-		db_printf(">");
-		if (cip->ic_cipher != IEEE80211_CIPHER_WEP &&
-		    wk->wk_keyrsc[IEEE80211_NONQOS_TID] != 0)
-			db_printf(" rsc %ju", (uintmax_t)wk->wk_keyrsc[IEEE80211_NONQOS_TID]);
-		if (cip->ic_cipher != IEEE80211_CIPHER_WEP &&
-		    wk->wk_keytsc != 0)
-			db_printf(" tsc %ju", (uintmax_t)wk->wk_keytsc);
-		db_printf(" flags=%pb%i", IEEE80211_KEY_BITS, wk->wk_flags);
-	}
+	if (memcmp(wk->wk_key, zerodata, keylen) != 0)
+		db_printf(" <set> flags=%pb%i",
+		    IEEE80211_KEY_BITS, wk->wk_flags);
 	db_printf("\n");
 }
```
