cleanup: use ssh_ prefix in the agent (non-static) functions

Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Fabiano Fidêncio
2015-09-16 22:13:09 +02:00
parent 898be61fc6
commit 77052d3a1e
5 changed files with 14 additions and 14 deletions

View File

@@ -143,7 +143,7 @@ static size_t atomicio(struct ssh_agent_struct *agent, void *buf, size_t n, int
}
}
ssh_agent agent_new(struct ssh_session_struct *session) {
ssh_agent ssh_agent_new(struct ssh_session_struct *session) {
ssh_agent agent = NULL;
agent = malloc(sizeof(struct ssh_agent_struct));
@@ -205,7 +205,7 @@ int ssh_set_agent_socket(ssh_session session, socket_t fd){
return SSH_OK;
}
void agent_close(struct ssh_agent_struct *agent) {
void ssh_agent_close(struct ssh_agent_struct *agent) {
if (agent == NULL) {
return;
}
@@ -213,13 +213,13 @@ void agent_close(struct ssh_agent_struct *agent) {
ssh_socket_close(agent->sock);
}
void agent_free(ssh_agent agent) {
void ssh_agent_free(ssh_agent agent) {
if (agent) {
if (agent->ident) {
ssh_buffer_free(agent->ident);
}
if (agent->sock) {
agent_close(agent);
ssh_agent_close(agent);
ssh_socket_free(agent->sock);
}
SAFE_FREE(agent);
@@ -484,7 +484,7 @@ ssh_key ssh_agent_get_next_ident(struct ssh_session_struct *session,
return key;
}
int agent_is_running(ssh_session session) {
int ssh_agent_is_running(ssh_session session) {
if (session == NULL || session->agent == NULL) {
return 0;
}

View File

@@ -770,7 +770,7 @@ int ssh_userauth_agent(ssh_session session,
return SSH_AUTH_ERROR;
}
if (!agent_is_running(session)) {
if (!ssh_agent_is_running(session)) {
return SSH_AUTH_DENIED;
}
if (!session->agent_state){

View File

@@ -92,7 +92,7 @@ ssh_session ssh_new(void) {
session->maxchannel = FIRST_CHANNEL;
#ifndef _WIN32
session->agent = agent_new(session);
session->agent = ssh_agent_new(session);
if (session->agent == NULL) {
goto err;
}
@@ -222,7 +222,7 @@ void ssh_free(ssh_session session) {
crypto_free(session->next_crypto);
#ifndef _WIN32
agent_free(session->agent);
ssh_agent_free(session->agent);
#endif /* _WIN32 */
ssh_key_free(session->srv.dsa_key);