]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Clear GO negotiation results from stack after use
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 10 Oct 2024 20:45:07 +0000 (23:45 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 13 Oct 2024 18:41:53 +0000 (21:41 +0300)
struct p2p_go_neg_results contains private keys, so clear it from stack
explicitly to avoid leaving any unnecessary copies of keys in memory.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/p2p/p2p.c

index 907cc08a8f2f0b30958223a47f7fbb1a954bec79..13e30231eba9a19c3a568968ec3bb96bb7b2b570 100644 (file)
@@ -1931,6 +1931,7 @@ void p2p_go_complete(struct p2p_data *p2p, struct p2p_device *peer)
 
        p2p_set_state(p2p, P2P_PROVISIONING);
        p2p->cfg->go_neg_completed(p2p->cfg->cb_ctx, &res);
+       forced_memzero(&res, sizeof(res));
 }