From 3b878dae7e7bb00f8d886426dc4f75bf45b8113f Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Fri, 11 Sep 2009 15:35:10 +0200 Subject: Removed chunk_from_buf() in favor of a simpler chunk_from_chars() macro --- src/libstrongswan/plugins/agent/agent_private_key.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libstrongswan/plugins/agent/agent_private_key.c') diff --git a/src/libstrongswan/plugins/agent/agent_private_key.c b/src/libstrongswan/plugins/agent/agent_private_key.c index 1c48d706c..2bc6dea34 100644 --- a/src/libstrongswan/plugins/agent/agent_private_key.c +++ b/src/libstrongswan/plugins/agent/agent_private_key.c @@ -161,7 +161,7 @@ static bool read_key(private_agent_private_key_t *this, public_key_t *pubkey) { int len, count; char buf[2048]; - chunk_t blob = chunk_from_buf(buf), key, type, n; + chunk_t blob, key, type, n; len = htonl(1); buf[0] = SSH_AGENT_ID_REQUEST; @@ -172,6 +172,7 @@ static bool read_key(private_agent_private_key_t *this, public_key_t *pubkey) return FALSE; } + blob = chunk_create(buf, sizeof(buf)); blob.len = read(this->socket, blob.ptr, blob.len); if (blob.len < sizeof(u_int32_t) + sizeof(u_char) || @@ -226,7 +227,7 @@ static bool sign(private_agent_private_key_t *this, signature_scheme_t scheme, { u_int32_t len, flags; char buf[2048]; - chunk_t blob = chunk_from_buf(buf); + chunk_t blob; if (scheme != SIGN_RSA_EMSA_PKCS1_SHA1) { @@ -267,6 +268,7 @@ static bool sign(private_agent_private_key_t *this, signature_scheme_t scheme, return FALSE; } + blob = chunk_create(buf, sizeof(buf)); blob.len = read(this->socket, blob.ptr, blob.len); if (blob.len < sizeof(u_int32_t) + sizeof(u_char) || read_uint32(&blob) != blob.len || -- cgit v1.2.3