aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libssh/priv.h4
-rw-r--r--libssh/session.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 81dd6158..0c7105c7 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -425,6 +425,7 @@ struct ssh_message {
struct ssh_channel_request channel_request;
};
+#ifndef _WIN32
/* agent.c */
/**
* @brief Create a new ssh agent structure.
@@ -434,13 +435,14 @@ struct ssh_message {
struct agent_struct *agent_new(struct ssh_session *session);
void agent_close(struct agent_struct *agent);
+
/**
* @brief Free an allocated ssh agent structure.
*
* @param agent The ssh agent structure to free.
*/
void agent_free(struct agent_struct *agent);
-#ifndef _WIN32
+
/**
* @brief Check if the ssh agent is running.
*
diff --git a/libssh/session.c b/libssh/session.c
index c8e5a681..36028714 100644
--- a/libssh/session.c
+++ b/libssh/session.c
@@ -48,7 +48,9 @@ SSH_SESSION *ssh_new(void) {
session->log_indent=0;
session->out_buffer=buffer_new();
session->in_buffer=buffer_new();
+#ifndef _WIN32
session->agent=agent_new(session);
+#endif /* _WIN32 */
return session;
}
@@ -77,8 +79,10 @@ void ssh_cleanup(SSH_SESSION *session){
// delete all channels
while(session->channels)
channel_free(session->channels);
+#ifndef _WIN32
if (session->agent)
agent_free(session->agent);
+#endif /* _WIN32 */
if(session->client_kex.methods)
for(i=0;i<10;i++)
if(session->client_kex.methods[i])