charon-nm: Pass configured user when connecting to SSH/GPG agent

This prevents an attack similar to the one fixed previously where a
user passes the path to credentials of another user, in this case the
path to the agent socket of that user.
This commit is contained in:
Tobias Brunner
2025-12-10 18:34:19 +01:00
parent 8b467ad39a
commit 7cc8973db7
+1
View File
@@ -637,6 +637,7 @@ static bool add_auth_cfg_cert(NMStrongswanPluginPrivate *priv,
private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY,
public->get_type(public),
BUILD_AGENT_SOCKET, str,
BUILD_AGENT_USER, user,
BUILD_PUBLIC_KEY, public,
BUILD_END);
public->destroy(public);