From 41a8897cd6f0ab609a4d2e9cf903f9c10954b60c Mon Sep 17 00:00:00 2001 From: wpaul Date: Thu, 7 Sep 2000 17:05:12 +0000 Subject: [PATCH] Close PR #20963. Do not pass encryption keys back to the caller via wi_ioctl() unless they're the superuser. --- sys/dev/wi/if_wi.c | 3 +++ sys/i386/isa/if_wi.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index df6fb2ac3254..32fef23db642 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -1008,6 +1008,9 @@ static int wi_ioctl(ifp, command, data) error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); if (error) break; + /* Don't show WEP keys to non-root users. */ + if (wreq.wi_type == WI_RID_DEFLT_CRYPT_KEYS && suser(p)) + break; if (wreq.wi_type == WI_RID_IFACE_STATS) { bcopy((char *)&sc->wi_stats, (char *)&wreq.wi_val, sizeof(sc->wi_stats)); diff --git a/sys/i386/isa/if_wi.c b/sys/i386/isa/if_wi.c index df6fb2ac3254..32fef23db642 100644 --- a/sys/i386/isa/if_wi.c +++ b/sys/i386/isa/if_wi.c @@ -1008,6 +1008,9 @@ static int wi_ioctl(ifp, command, data) error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); if (error) break; + /* Don't show WEP keys to non-root users. */ + if (wreq.wi_type == WI_RID_DEFLT_CRYPT_KEYS && suser(p)) + break; if (wreq.wi_type == WI_RID_IFACE_STATS) { bcopy((char *)&sc->wi_stats, (char *)&wreq.wi_val, sizeof(sc->wi_stats));