summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/agent/agent_private_key.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2010-05-25 19:01:36 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2010-05-25 19:01:36 +0000
commit1ac70afcc1f7d6d2738a34308810719b0976d29f (patch)
tree805f6ce2a15d1a717781d7cbceac8408a74b6b0c /src/libstrongswan/plugins/agent/agent_private_key.c
parented7d79f96177044949744da10f4431c1d6242241 (diff)
downloadvyos-strongswan-1ac70afcc1f7d6d2738a34308810719b0976d29f.tar.gz
vyos-strongswan-1ac70afcc1f7d6d2738a34308810719b0976d29f.zip
[svn-upgrade] Integrating new upstream version, strongswan (4.4.0)
Diffstat (limited to 'src/libstrongswan/plugins/agent/agent_private_key.c')
-rw-r--r--src/libstrongswan/plugins/agent/agent_private_key.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/libstrongswan/plugins/agent/agent_private_key.c b/src/libstrongswan/plugins/agent/agent_private_key.c
index d0a2da87f..4247f849e 100644
--- a/src/libstrongswan/plugins/agent/agent_private_key.c
+++ b/src/libstrongswan/plugins/agent/agent_private_key.c
@@ -137,7 +137,8 @@ static int open_connection(char *path)
s = socket(AF_UNIX, SOCK_STREAM, 0);
if (s == -1)
{
- DBG1("opening ssh-agent socket %s failed: %s:", path, strerror(errno));
+ DBG1(DBG_LIB, "opening ssh-agent socket %s failed: %s:", path,
+ strerror(errno));
return -1;
}
@@ -147,7 +148,8 @@ static int open_connection(char *path)
if (connect(s, (struct sockaddr*)&addr, SUN_LEN(&addr)) != 0)
{
- DBG1("connecting to ssh-agent socket failed: %s", strerror(errno));
+ DBG1(DBG_LIB, "connecting to ssh-agent socket failed: %s",
+ strerror(errno));
close(s);
return -1;
}
@@ -168,7 +170,7 @@ static bool read_key(private_agent_private_key_t *this, public_key_t *pubkey)
if (write(this->socket, &len, sizeof(len)) != sizeof(len) ||
write(this->socket, &buf, 1) != 1)
{
- DBG1("writing to ssh-agent failed");
+ DBG1(DBG_LIB, "writing to ssh-agent failed");
return FALSE;
}
@@ -179,7 +181,7 @@ static bool read_key(private_agent_private_key_t *this, public_key_t *pubkey)
read_uint32(&blob) != blob.len ||
read_byte(&blob) != SSH_AGENT_ID_RESPONSE)
{
- DBG1("received invalid ssh-agent identity response");
+ DBG1(DBG_LIB, "received invalid ssh-agent identity response");
return FALSE;
}
count = read_uint32(&blob);
@@ -231,7 +233,7 @@ static bool sign(private_agent_private_key_t *this, signature_scheme_t scheme,
if (scheme != SIGN_RSA_EMSA_PKCS1_SHA1)
{
- DBG1("signature scheme %N not supported by ssh-agent",
+ DBG1(DBG_LIB, "signature scheme %N not supported by ssh-agent",
signature_scheme_names, scheme);
return FALSE;
}
@@ -241,7 +243,7 @@ static bool sign(private_agent_private_key_t *this, signature_scheme_t scheme,
if (write(this->socket, &len, sizeof(len)) != sizeof(len) ||
write(this->socket, &buf, 1) != 1)
{
- DBG1("writing to ssh-agent failed");
+ DBG1(DBG_LIB, "writing to ssh-agent failed");
return FALSE;
}
@@ -249,7 +251,7 @@ static bool sign(private_agent_private_key_t *this, signature_scheme_t scheme,
if (write(this->socket, &len, sizeof(len)) != sizeof(len) ||
write(this->socket, this->key.ptr, this->key.len) != this->key.len)
{
- DBG1("writing to ssh-agent failed");
+ DBG1(DBG_LIB, "writing to ssh-agent failed");
return FALSE;
}
@@ -257,14 +259,14 @@ static bool sign(private_agent_private_key_t *this, signature_scheme_t scheme,
if (write(this->socket, &len, sizeof(len)) != sizeof(len) ||
write(this->socket, data.ptr, data.len) != data.len)
{
- DBG1("writing to ssh-agent failed");
+ DBG1(DBG_LIB, "writing to ssh-agent failed");
return FALSE;
}
flags = htonl(0);
if (write(this->socket, &flags, sizeof(flags)) != sizeof(flags))
{
- DBG1("writing to ssh-agent failed");
+ DBG1(DBG_LIB, "writing to ssh-agent failed");
return FALSE;
}
@@ -274,7 +276,7 @@ static bool sign(private_agent_private_key_t *this, signature_scheme_t scheme,
read_uint32(&blob) != blob.len ||
read_byte(&blob) != SSH_AGENT_SIGN_RESPONSE)
{
- DBG1("received invalid ssh-agent signature response");
+ DBG1(DBG_LIB, "received invalid ssh-agent signature response");
return FALSE;
}
/* parse length */
@@ -285,7 +287,7 @@ static bool sign(private_agent_private_key_t *this, signature_scheme_t scheme,
blob = read_string(&blob);
if (!blob.len)
{
- DBG1("received invalid ssh-agent signature response");
+ DBG1(DBG_LIB, "received invalid ssh-agent signature response");
return FALSE;
}
*signature = chunk_clone(blob);
@@ -306,7 +308,7 @@ static key_type_t get_type(private_agent_private_key_t *this)
static bool decrypt(private_agent_private_key_t *this,
chunk_t crypto, chunk_t *plain)
{
- DBG1("private key decryption not supported by ssh-agent");
+ DBG1(DBG_LIB, "private key decryption not supported by ssh-agent");
return FALSE;
}